ManimCommunity / ManimCommunity/manim

PointCloudDot doesn't animate color or alpha

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

Nobody has claimed this yet.

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

Description

Description of bug / unexpected behavior

The PointCloudDot object doesn't animate the color or alpha of its points. Whether using fade_to, animate.fade_to or FadeIn/FadeOut, the points will just animate some weird double-blinking.

Expected behavior

As all other MObjects, the PointCloudDot should properly animate fade, i.e. alpha, at least for all child points at the same time.

How to reproduce the issue

pf = PointCloudDot(
    color=RED, stroke_width=7, density=20)
self.add(pf)
self.play(pf.animate.fade_to(color=RED, alpha=0))
Code for reproducing the problem
class MWE(Scene):
    def construct(self):
        pf = self.make_pressure_field().shift(UP*.5)
        self.add(pf)
        # I'd like to replace this line with a set_color_and_alpha or something, as it shouldn't be animated.
        self.play(pf.animate.fade_to(color=BLUE, alpha=0))
        self.play(pf.animate.fade_to(color=BLUE, alpha=1))

        self.wait()

    def make_pressure_field(self):
        cloud = PointCloudDot(
            color=BLUE, stroke_width=7, density=20)
        cloud.apply_complex_function(
            lambda z: complex(random(-6, 6), random(-3, 3)))
        return cloud

Additional media files

Images/GIFs

https://user-images.githubusercontent.com/28656157/144118675-8002d8fa-416c-4f3e-ba57-a41e8dacc1ce.mp4

Logs

Terminal output

[11/30/21 18:49:03] DEBUG    Hashing ...                                                                                                                   hashing.py:344
                    DEBUG    Hashing done in 0.009390 s.                                                                                                   hashing.py:356
                    DEBUG    Hash generated :  450974505_3712993816_2214048929                                                                             hashing.py:359
                    DEBUG    List of the first few animation hashes of the scene: ['450974505_3712993816_2214048929']                                cairo_renderer.py:83
[11/30/21 18:49:05] INFO     Animation 0 : Partial movie file written in 'FOLDER                          scene_file_writer.py:510
                             \media\videos\main\1080p60\partial_movie_files\MWE\450974505_3712993816_2214048929.mp4'
                    DEBUG    Hashing ...                                                                                                                   hashing.py:344
                    DEBUG    Hashing done in 0.004477 s.                                                                                                   hashing.py:356
                    DEBUG    Hash generated :  34786186_3712993816_2214048929                                                                              hashing.py:359
                    DEBUG    List of the first few animation hashes of the scene: ['450974505_3712993816_2214048929',                                cairo_renderer.py:83
                             '34786186_3712993816_2214048929']
[11/30/21 18:49:07] INFO     Animation 1 : Partial movie file written in 'FOLDER                          scene_file_writer.py:510
                             \media\videos\main\1080p60\partial_movie_files\MWE\34786186_3712993816_2214048929.mp4'
                    DEBUG    Animation with empty mobject                                                                                                animation.py:165
                    DEBUG    Hashing ...                                                                                                                   hashing.py:344
                    DEBUG    Hashing done in 0.003417 s.                                                                                                   hashing.py:356
                    DEBUG    Hash generated :  34786186_3493041802_2135821444                                                                              hashing.py:359
                    DEBUG    List of the first few animation hashes of the scene: ['450974505_3712993816_2214048929',                                cairo_renderer.py:83
                             '34786186_3712993816_2214048929', '34786186_3493041802_2135821444']
                    INFO     Animation 2 : Partial movie file written in 'FOLDER                          scene_file_writer.py:510
                             \media\videos\main\1080p60\partial_movie_files\MWE\34786186_3493041802_2135821444.mp4'
                    INFO     Combining to Movie file.                                                                                            scene_file_writer.py:604
                    DEBUG    Partial movie files to combine (3 files): ['FOLDER                    scene_file_writer.py:547
                             \\media\\videos\\digital-audio\\1080p60\\partial_movie_files\\MWE\\450974505_3712993816_2214048929.mp4',
                             'FOLDER\\media\\videos\\main\\1080p60\\partial_movie_files\\MWE\\34786186_3712993816_2214048929.mp4',
                             'FOLDER\\media\\videos\\main\\1080p60\\partial_movie_files\\MWE\\34786186_3493041802_2135821444.mp4']
                    INFO                                                                                                                         scene_file_writer.py:718
                             File ready at 'FOLDER\media\videos\main\1080p60\MWE.mp4'

                    INFO     Rendered MWE                                                                                                                    scene.py:234
                             Played 3 animations
[11/30/21 18:49:08] INFO     Previewed File at: 'FOLDER\media\videos\main\1080p60\MWE.mp4'          file_ops.py:202

System specifications

System Details
  • OS: Windows 10 21H1
  • RAM: 32GB
  • Python version (python/py/python3 --version): 3.8.3
  • Installed modules (provide output from pip list):
Package                           Version
--------------------------------- ---------
2to3                              1.0
absl-py                           0.11.0
alabaster                         0.7.12
argon2-cffi                       20.1.0
astor                             0.8.1
astunparse                        1.6.3
async-generator                   1.10
attrs                             20.3.0
autopep8                          1.5.3
Babel                             2.8.0
backcall                          0.2.0
backports.entry-points-selectable 1.1.0
beautifulsoup4                    4.9.1
bleach                            3.3.0
bs4                               0.0.1
cachetools                        4.2.0
certifi                           2020.6.20
cffi                              1.14.5
cfgv                              3.3.1
chardet                           3.0.4
click                             8.0.1
click-default-group               1.2.2
cloudpickle                       2.0.0
cloup                             0.7.1
colorama                          0.4.3
colour                            0.1.5
commonmark                        0.9.1
css-parser                        1.0.4
cycler                            0.10.0
decorator                         5.0.7
defusedxml                        0.7.1
deprecation                       2.1.0
distlib                           0.3.3
docutils                          0.16
doit                              0.33.1
entrypoints                       0.3
eyeD3                             0.9.5
filelock                          3.3.2
filetype                          1.0.7
flatbuffers                       1.12
gast                              0.3.3
glcontext                         2.3.4
google-api-core                   1.31.0
google-api-python-client          2.12.0
google-auth                       1.32.1
google-auth-httplib2              0.1.0
google-auth-oauthlib              0.4.4
google-pasta                      0.2.0
googleapis-common-protos          1.53.0
grpcio                            1.32.0
h5py                              2.10.0
httplib2                          0.19.1
identify                          2.3.3
idna                              2.10
imagesize                         1.2.0
ipykernel                         5.5.3
ipython                           7.22.0
ipython-genutils                  0.2.0
ipywidgets                        7.6.3
isosurfaces                       0.1.0
jedi                              0.18.0
Jinja2                            2.11.2
jsonschema                        3.2.0
jupyter                           1.0.0
jupyter-client                    6.1.12
jupyter-console                   6.4.0
jupyter-core                      4.7.1
jupyterlab-pygments               0.1.2
jupyterlab-widgets                1.0.0
Keras-Applications                1.0.8
Keras-Preprocessing               1.1.2
kiwisolver                        1.3.1
lxml                              4.5.2
manim                             0.12.0
ManimPango                        0.3.0
mapbox-earcut                     0.12.10
Markdown                          3.3.3
MarkupSafe                        1.1.1
matplotlib                        3.4.2
mistune                           0.8.4
moderngl                          5.6.4
moderngl-window                   2.4.0
multipledispatch                  0.6.0
nbclient                          0.5.3
nbconvert                         6.0.7
nbformat                          5.1.3
nest-asyncio                      1.5.1
networkx                          2.6.2
nhentai.py                        1.0.5
nodeenv                           1.6.0
notebook                          6.3.0
numpy                             1.20.1
oauthlib                          3.1.0
opbasm                            1.3
opencv-python                     4.5.1.48
opt-einsum                        3.3.0
packaging                         20.4
pandocfilters                     1.4.3
parso                             0.8.2
pickleshare                       0.7.5
Pillow                            8.1.0
pip                               21.3.1
platformdirs                      2.4.0
pre-commit                        2.15.0
prometheus-client                 0.10.1
prompt-toolkit                    3.0.18
protobuf                          3.14.0
pyasn1                            0.4.8
pyasn1-modules                    0.2.8
pycairo                           1.20.1
pycodestyle                       2.6.0
pycparser                         2.20
pydub                             0.25.1
pyee                              8.1.0
pyglet                            1.5.18
Pygments                          2.7.1
pyparsing                         2.4.7
pyrr                              0.10.3
pyrsistent                        0.17.3
PySide2                           5.15.2
python-dateutil                   2.8.1
python-ffmpeg                     1.0.11
pytz                              2020.1
pywin32                           300
pywinpty                          0.5.7
PyYAML                            6.0
pyzmq                             22.0.3
qtconsole                         5.0.3
QtPy                              1.9.0
requests                          2.24.0
requests-oauthlib                 1.3.0
rich                              10.6.0
rsa                               4.6
rstcheck                          3.3.1
scipy                             1.7.1
screeninfo                        0.6.7
Send2Trash                        1.5.0
setuptools                        41.2.0
shiboken2                         5.15.2
six                               1.15.0
skia-pathops                      0.7.1
snowballstemmer                   2.0.0
soupsieve                         2.0.1
Sphinx                            3.2.1
sphinx-rtd-theme                  0.5.0
sphinxcontrib-applehelp           1.0.2
sphinxcontrib-devhelp             1.0.2
sphinxcontrib-htmlhelp            1.0.3
sphinxcontrib-jsmath              1.0.1
sphinxcontrib-qthelp              1.0.3
sphinxcontrib-serializinghtml     1.1.4
stackprinter                      0.2.4
tensorboard                       2.4.0
tensorboard-plugin-wit            1.7.0
tensorflow-estimator              2.4.0
tensorflow-gpu                    2.4.0
termcolor                         1.1.0
terminado                         0.9.4
testpath                          0.4.4
toml                              0.10.1
tornado                           6.1
tqdm                              4.61.2
traitlets                         5.0.5
typing-extensions                 3.7.4.3
uritemplate                       3.0.1
urllib3                           1.25.9
virtualenv                        20.10.0
watchdog                          2.1.3
wcwidth                           0.2.5
webencodings                      0.5.1
Werkzeug                          1.0.1
wheel                             0.36.2
Whoosh                            2.7.4
widgetsnbextension                3.5.1
wrapt                             1.12.1
youtube-dl                        2021.6.6

Output of ffmpeg -version:

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.1 (GCC) 20200726
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

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 MWE and inspect PointCloudDot together with fade_to, animate.fade_to, FadeIn, and FadeOut. Trace how color and alpha are propagated to the child points, then verify that fading the cloud changes all points consistently without double-blinking.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.