ManimCommunity / ManimCommunity/manim

Reset after FadeOut when MObject is added to VGroup after Create

Open
#2,940 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

When using the default renderer an MObject that is added to a VGroup after the MObject has undergone the Create animation, reappears after the VGroup has undergone the FadeOut animation, when it should stay faded out. This is not the case when using the openql renderer. See attached example code and video to make it clearer.

## Expected behavior

## How to reproduce the issue

The following code executed with the default renderer shows the issue.

Code for reproducing the problem

```py
from manim import *

class Bug(Scene):

def construct(self):

g = VGroup()
g.add(Line(start=LEFT, end=RIGHT))

extra_line = Line(start=LEFT+UP, end=RIGHT+UP)

self.play(Create(g))
self.wait()

# If the line is added to the VGroup BEFORE the Create animation
# the problem does not appear
# g.add(extra_line)

self.play(Create(extra_line))
self.wait()

# If the line is added to the VGroup AFTER the Create animation
# it will reappear after beeing faded out
g.add(extra_line)

self.play(FadeOut(g))
self.wait()
```

When executing with
```
manim -p cairo_renderer_bug.py Bug --renderer=opengl
```
the issue is gone.

## Additional media files

This is what the example from the previous section looks like for me:

Images/GIFs

https://user-images.githubusercontent.com/7346166/188282060-5204bd2c-8250-4f5f-b127-c023b5d16b58.mp4

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Archlinux
- RAM: 16GB
- Python version (`python/py/python3 --version`): Python 3.9.13
- Installed modules (provide output from `pip list`):
```
Package Version Editable project location
----------------------------- ------------ -------------------------
alabaster 0.7.12
asttokens 2.0.8
attrs 21.4.0
Babel 2.9.1
backcall 0.2.0
backports.functools-lru-cache 1.6.4
beautifulsoup4 4.10.0
bibtexparser 1.2.0
brotlipy 0.7.0
CacheControl 0.12.11
cachy 0.3.0
certifi 2021.10.8
cffi 1.15.1
cfgv 3.3.1
charset-normalizer 2.0.11
cleo 0.8.1
click 8.0.3
click-default-group 1.2.2
clikit 0.6.2
cloup 0.13.1
colorama 0.4.4
colour 0.1.5
commonmark 0.9.1
crashtest 0.3.1
cryptography 37.0.1
dataclasses 0.8
decorator 5.1.1
distlib 0.3.4
docutils 0.17.1
executing 0.10.0
filelock 3.4.2
Flask 2.2.2
future 0.18.2
gitdir 1.2.4
glcontext 2.3.4
html5lib 1.1
identify 2.4.7
idna 3.3
imagesize 1.3.0
importlib-metadata 4.10.1
ipython 8.4.0
isbnlib 3.10.7
isosurfaces 0.1.0
itsdangerous 2.0.1
jedi 0.18.1
jeepney 0.8.0
Jinja2 3.0.3
jsonschema 4.15.0
keyring 23.8.2
lockfile 0.12.2
manim 0.16.0.post0
manim-editor 0.3.8
ManimPango 0.4.0.post2
mapbox-earcut 0.12.11
markdown-it-py 1.1.0
MarkupSafe 2.1.1
matplotlib-inline 0.1.6
mdit-py-plugins 0.2.8
moderngl 5.6.4
moderngl-window 2.4.1
msgpack 1.0.4
multipledispatch 0.6.0
mypy-extensions 0.4.3
networkx 2.6.3
nodeenv 1.6.0
numpy 1.21.1
packaging 21.3
parso 0.8.3
pastel 0.2.1
pathspec 0.9.0
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.2.0
pip 22.2.2
pkginfo 1.8.3
platformdirs 2.4.1
poetry 1.1.14
poetry-core 1.0.8
prompt-toolkit 3.0.30
ptyprocess 0.7.0
pure-eval 0.2.2
pycairo 1.21.0
pycparser 2.21
pydub 0.25.1
pyglet 1.5.21
Pygments 2.11.2
pylev 1.4.0
pyOpenSSL 22.0.0
pyparsing 3.0.7
pyrr 0.10.3
pyrsistent 0.18.1
PySocks 1.7.1
pytz 2021.3
PyYAML 6.0
requests 2.27.1
requests-toolbelt 0.9.1
rich 11.1.0
scipy 1.9.1
screeninfo 0.8
SecretStorage 3.3.3
setuptools 65.2.0
shellingham 1.5.0
six 1.16.0
skia-pathops 0.7.2
snowballstemmer 2.2.0
soupsieve 2.3.1
Sphinx 4.4.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
srt 3.5.1
stack-data 0.4.0
texbib 0.3.1 /home/lars/src/texbib
toml 0.10.2
tomli 1.2.3
tomlkit 0.11.4
tqdm 4.62.3
traitlets 5.3.0
typing_extensions 4.0.1
urllib3 1.26.8
virtualenv 20.13.0
waitress 2.1.2
watchdog 2.1.6
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 2.2.2
wheel 0.37.1
zipp 3.7.0
```

LaTeX details

+ LaTeX distribution (e.g. TeX Live 2020): Tex Live 2022.62885-1
+ Installed LaTeX packages: (Couldn't get this to work, but I don't think its relevant.)

FFMPEG

Output of `ffmpeg -version`:

```
ffmpeg version 5.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 10.4.0 (conda-forge gcc 10.4.0-16)
configuration: --prefix=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac --cc=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_build_env/bin/x86_64-conda-linux-gnu-cc --cxx=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_build_env/bin/x86_64-conda-linux-gnu-c++ --nm=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_build_env/bin/x86_64-conda-linux-gnu-nm --ar=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_build_env/bin/x86_64-conda-linux-gnu-ar --disable-doc --disable-openssl --enable-demuxer=dash --enable-hardcoded-tables --enable-libfreetype --enable-libfontconfig --enable-libopenh264 --enable-gnutls --enable-libmp3lame --enable-libvpx --enable-pthreads --enable-vaapi --enable-gpl --enable-libx264 --enable-libx265 --enable-libaom --enable-libsvtav1 --enable-libxml2 --enable-pic --enable-shared --disable-static --enable-version3 --enable-zlib --pkg-config=/home/conda/feedstock_root/build_artifacts/ffmpeg_1660921496784/_build_env/bin/pkg-config
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
```

## Additional comments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Bug scene with the default renderer and compare it with the --renderer=opengl command. Trace the Create, VGroup.add, and FadeOut sequence in the renderer behavior; done means the added line remains faded out after FadeOut, matching the OpenGL result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.