ManimCommunity / ManimCommunity/manim
First Transformation works, second transformation runs into an error (openGL)
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
Transformation in line 12 is working just fine. Shouldn't line 13 do so aswell?
UPDATE: It's a problem with the openGL editor. Without, it works fine.
## Expected behavior
Drawing two vectors (works).
Transforming one into another vector (works).
Transforming also the other one into another vector (error).
## How to reproduce the issue
Code for reproducing the problem
I am using openGL with these settings:
manim -qm -p --renderer=opengl MultipleVectors.py WhatIsHappening
```py
class WhatIsHappening(Scene):
def construct(self):
numberplane = NumberPlane()
self.add(numberplane)
vector1 = Vector([1,1])
vector2 = Vector([2,1])
vector3 = Vector([0,1])
vector4 = Vector([3,1])
self.play(Create(vector1), Create(vector2))
self.play(Transform(vector1,vector3))
self.play(Transform(vector2,vector4))
```
Images/GIFs
## Logs
Terminal output
```
Manim Community v0.17.3
[08/27/23 21:41:16] DEBUG Hashing ... hashing.py:350 DEBUG Hashing done in 0.238243 s. hashing.py:362 DEBUG Hash generated : 2465576764_714205924_625213502 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['2465576764_714205924_625213502'] caching.py:61
[08/27/23 21:41:17] DEBUG Hashing ... hashing.py:350[08/27/23 21:41:18] DEBUG Hashing done in 0.258957 s. hashing.py:362 DEBUG Hash generated : 3212569724_3509630900_2297691547 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['2465576764_714205924_625213502', '3212569724_3509630900_2297691547'] caching.py:61
[08/27/23 21:41:19] DEBUG Hashing ... hashing.py:350 DEBUG Hashing done in 0.244040 s. hashing.py:362 DEBUG Hash generated : 3212569724_396083016_1458670921 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['2465576764_714205924_625213502', '3212569724_3509630900_2297691547', caching.py:61 '3212569724_396083016_1458670921']
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\cli\render\commands.py:97 in render │
│ │
│ 94 │ │ │ │ for SceneClass in scene_classes_from_file(file): │
│ 95 │ │ │ │ │ with tempconfig({}): │
│ 96 │ │ │ │ │ │ scene = SceneClass(renderer) │
│ ❱ 97 │ │ │ │ │ │ rerun = scene.render() │
│ 98 │ │ │ │ │ if rerun or config["write_all"]: │
│ 99 │ │ │ │ │ │ renderer.num_plays = 0 │
│ 100 │ │ │ │ │ │ continue │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\scene\scene.py:223 in render │
│ │
│ 220 │ │ """ │
│ 221 │ │ self.setup() │
│ 222 │ │ try: │
│ ❱ 223 │ │ │ self.construct() │
│ 224 │ │ except EndSceneEarlyException: │
│ 225 │ │ │ pass │
│ 226 │ │ except RerunSceneException as e: │
│ │
│ C:\Users\Maris\Desktop\Brueckenkurs\MultipleVectors.py:114 in construct │
│ │
│ 111 │ │ self.play(Create(vector1), Create(vector2)) │
│ 112 │ │ │
│ 113 │ │ self.play(Transform(vector1,vector3)) │
│ ❱ 114 │ │ self.play(Transform(vector2,vector4)) │
│ 115 │
│ 116 │
│ 117 │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\scene\scene.py:1082 in play │
│ │
│ 1079 │ │ │ return │
│ 1080 │ │ │
│ 1081 │ │ start_time = self.renderer.time │
│ ❱ 1082 │ │ self.renderer.play(self, *args, **kwargs) │
│ 1083 │ │ run_time = self.renderer.time - start_time │
│ 1084 │ │ if subcaption: │
│ 1085 │ │ │ if subcaption_duration is None: │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\utils\caching.py:65 in wrapper │
│ │
│ 62 │ │ │ "List of the first few animation hashes of the scene: %(h)s", │
│ 63 │ │ │ {"h": str(self.animations_hashes[:5])}, │
│ 64 │ │ ) │
│ ❱ 65 │ │ func(self, scene, *args, **kwargs) │
│ 66 │ │
│ 67 │ return wrapper │
│ 68 │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\renderer\opengl_renderer.py:424 in play │
│ │
│ 421 │ │ self.file_writer.begin_animation(not self.skip_animations) │
│ 422 │ │ │
│ 423 │ │ scene.compile_animation_data(*args, **kwargs) │
│ ❱ 424 │ │ scene.begin_animations() │
│ 425 │ │ if scene.is_current_animation_frozen_frame(): │
│ 426 │ │ │ self.update_frame(scene) │
│ 427 │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\scene\scene.py:1210 in begin_animations │
│ │
│ 1207 │ │ """Start the animations of the scene.""" │
│ 1208 │ │ for animation in self.animations: │
│ 1209 │ │ │ animation._setup_scene(self) │
│ ❱ 1210 │ │ │ animation.begin() │
│ 1211 │ │ │
│ 1212 │ │ if config.renderer == RendererType.CAIRO: │
│ 1213 │ │ │ # Paint all non-moving objects onto the screen, so they don't │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\animation\transform.py:204 in begin │
│ │
│ 201 │ │ │ self.mobject.align_data_and_family(self.target_copy) │
│ 202 │ │ else: │
│ 203 │ │ │ self.mobject.align_data(self.target_copy) │
│ ❱ 204 │ │ super().begin() │
│ 205 │ │
│ 206 │ def create_target(self) -> Mobject: │
│ 207 │ │ # Has no meaningful effect here, but may be useful │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\animation\animation.py:203 in begin │
│ │
│ 200 │ │ │ # the internal updaters of self.starting_mobject, │
│ 201 │ │ │ # or any others among self.get_all_mobjects() │
│ 202 │ │ │ self.mobject.suspend_updating() │
│ ❱ 203 │ │ self.interpolate(0) │
│ 204 │ │
│ 205 │ def finish(self) -> None: │
│ 206 │ │ # TODO: begin and finish should require a scene as parameter. │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\animation\animation.py:323 in interpolate │
│ │
│ 320 │ │ │ The relative time to set the animation to, 0 meaning the start, 1 meaning │
│ 321 │ │ │ the end. │
│ 322 │ │ """ │
│ ❱ 323 │ │ self.interpolate_mobject(alpha) │
│ 324 │ │
│ 325 │ def interpolate_mobject(self, alpha: float) -> None: │
│ 326 │ │ """Interpolates the mobject of the :class:`Animation` based on alpha value. │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\animation\animation.py:338 in │
│ interpolate_mobject │
│ │
│ 335 │ │ families = list(self.get_all_families_zipped()) │
│ 336 │ │ for i, mobs in enumerate(families): │
│ 337 │ │ │ sub_alpha = self.get_sub_alpha(alpha, i, len(families)) │
│ ❱ 338 │ │ │ self.interpolate_submobject(*mobs, sub_alpha) │
│ 339 │ │
│ 340 │ def interpolate_submobject( │
│ 341 │ │ self, │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\animation\transform.py:241 in │
│ interpolate_submobject │
│ │
│ 238 │ │ target_copy: Mobject, │
│ 239 │ │ alpha: float, │
│ 240 │ ) -> Transform: │
│ ❱ 241 │ │ submobject.interpolate(starting_submobject, target_copy, alpha, self.path_func) │
│ 242 │ │ return self │
│ 243 │
│ 244 │
│ │
│ C:\Users\Maris\anaconda3\lib\site-packages\manim\mobject\opengl\opengl_vectorized_mobject.py:130 │
│ 4 in interpolate │
│ │
│ 1301 │ │ │ if self.has_fill(): │
│ 1302 │ │ │ │ tri1 = mobject1.get_triangulation() │
│ 1303 │ │ │ │ tri2 = mobject2.get_triangulation() │
│ ❱ 1304 │ │ │ │ if len(tri1) != len(tri1) or not np.all(tri1 == tri2): │
│ 1305 │ │ │ │ │ self.refresh_triangulation() │
│ 1306 │ │ return self │
│ 1307 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: operands could not be broadcast together with shapes (18,) (15,)
```
## System specifications
System Details
- OS WIN10
- RAM: 8GB
- Python version (`python/py/python3 --version`): python3.9.13 (conda)
- Installed modules (provide output from `pip list`):
```
Package Version
----------------------------- --------------------
alabaster 0.7.12
anaconda-client 1.11.0
anaconda-navigator 2.3.1
anaconda-project 0.11.1
anyio 3.5.0
appdirs 1.4.4
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.2
astroid 2.11.7
astropy 5.1
atomicwrites 1.4.0
attrs 21.4.0
Automat 20.2.0
autopep8 1.6.0
Babel 2.9.1
backcall 0.2.0
backports.functools-lru-cache 1.6.4
backports.tempfile 1.0
backports.weakref 1.0.post1
bcrypt 3.2.0
beautifulsoup4 4.11.1
binaryornot 0.4.4
bitarray 2.5.1
bkcharts 0.2
black 22.6.0
bleach 4.1.0
blinker 1.6.2
bokeh 2.4.3
boto3 1.24.28
botocore 1.27.28
Bottleneck 1.3.5
brotlipy 0.7.0
certifi 2021.5.30
cffi 1.15.1
chardet 4.0.0
charset-normalizer 2.0.4
click 8.1.4
click-default-group 1.2.2
cloudpickle 2.0.0
cloup 0.13.1
clyent 1.2.2
colorama 0.4.4
colorcet 3.0.0
colour 0.1.5
commonmark 0.9.1
comtypes 1.1.10
conda 22.9.0
conda-build 3.22.0
conda-content-trust 0.1.3
conda-pack 0.6.0
conda-package-handling 2.1.0
conda_package_streaming 0.8.0
conda-repo-cli 1.0.41
conda-token 0.4.0
conda-verify 3.4.2
constantly 15.1.0
contourpy 1.1.0
cookiecutter 1.7.3
cryptography 37.0.1
cssselect 1.1.0
cycler 0.11.0
Cython 0.29.32
cytoolz 0.11.0
daal4py 2021.6.0
dask 2022.7.0
datashader 0.14.1
datashape 0.5.4
debugpy 1.5.1
decorator 5.0.9
defusedxml 0.7.1
diff-match-patch 20200713
dill 0.3.4
distributed 2022.7.0
docutils 0.18.1
elabapy 1.0.0
entrypoints 0.4
et-xmlfile 1.1.0
fastjsonschema 2.16.2
ffmpeg 1.4
ffmpeg-python 0.2.0
filelock 3.6.0
flake8 4.0.1
Flask 2.3.2
fonttools 4.25.0
fsspec 2022.7.1
future 0.18.2
gensim 4.1.2
glcontext 2.3.4
glob2 0.7
greenlet 1.1.1
h5py 3.7.0
HeapDict 1.0.1
holoviews 1.15.0
hvplot 0.8.0
hyperlink 21.0.0
idna 3.2
imagecodecs 2021.8.26
imageio 2.19.3
imagesize 1.4.1
importlib-metadata 4.11.3
importlib-resources 6.0.1
incremental 21.3.0
inflection 0.5.1
iniconfig 1.1.1
intake 0.6.5
intervaltree 3.1.0
ipykernel 6.15.2
ipython 7.31.1
ipython-genutils 0.2.0
ipywidgets 7.6.5
isort 5.9.3
isosurfaces 0.1.0
itemadapter 0.3.0
itemloaders 1.0.4
itsdangerous 2.1.2
jdcal 1.4.1
jedi 0.18.1
jellyfish 0.9.0
Jinja2 3.1.2
jinja2-time 0.2.0
jmespath 0.10.0
joblib 1.1.0
json5 0.9.6
jsonschema 4.16.0
jupyter 1.0.0
jupyter_client 7.3.4
jupyter-console 6.4.3
jupyter_core 4.11.1
jupyter-server 1.18.1
jupyterlab 3.4.4
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
jupyterlab-widgets 1.0.0
kdl 0.2.21
kdl-py 1.1.0
keyring 23.4.0
kiwisolver 1.4.2
lazy-object-proxy 1.6.0
libarchive-c 2.9
llvmlite 0.38.0
locket 1.0.0
lxml 4.9.3
lz4 3.1.3
manim 0.17.3
manim-editor 0.3.8
ManimPango 0.4.3
mapbox-earcut 1.0.1
Markdown 3.3.4
markdown-it-py 3.0.0
MarkupSafe 2.1.3
matplotlib 3.7.2
matplotlib-inline 0.1.6
mccabe 0.6.1
mdurl 0.1.2
menuinst 1.4.19
metrolopy 0.6.3
mistune 0.8.4
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mock 4.0.3
moderngl 5.6.4
moderngl-window 2.4.0
mpmath 1.2.1
msgpack 1.0.3
multipledispatch 0.6.0
munkres 1.1.4
mypy-extensions 0.4.3
navigator-updater 0.3.0
nbclassic 0.3.5
nbclient 0.5.13
nbconvert 6.4.4
nbformat 5.5.0
nest-asyncio 1.5.5
networkx 2.6.2
nltk 3.7
nose 1.3.7
notebook 6.4.12
numba 0.55.1
numexpr 2.8.3
numpy 1.25.2
numpydoc 1.4.0
olefile 0.46
opencv-python 4.8.0.74
openpyxl 3.0.10
packaging 21.3
pandas 1.4.4
pandocfilters 1.5.0
panel 0.13.1
param 1.12.0
paramiko 2.8.1
parsel 1.6.0
parso 0.8.3
partd 1.2.0
pathlib 1.0.1
pathspec 0.9.0
patsy 0.5.2
pep8 1.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.5.0
pip 22.2.2
pkginfo 1.8.2
platformdirs 2.5.2
plotly 5.9.0
pluggy 1.0.0
poyo 0.5.0
prometheus-client 0.14.1
prompt-toolkit 3.0.20
Protego 0.1.16
psutil 5.9.0
ptyprocess 0.7.0
py 1.11.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.10.4
pybind11-global 2.10.4
pycairo 1.24.0
pycodestyle 2.8.0
pycosat 0.6.3
pycparser 2.21
pyct 0.4.8
pycurl 7.45.1
pydantic 1.10.11
PyDispatcher 2.0.5
pydocstyle 6.1.1
pydub 0.25.1
pyerfa 2.0.0
pyflakes 2.4.0
pyglet 1.5.20
Pygments 2.10.0
PyHamcrest 2.0.2
PyJWT 2.4.0
pylint 2.14.5
pyls-spyder 0.4.0
PyNaCl 1.5.0
pyodbc 4.0.34
pyOpenSSL 22.0.0
pyparsing 3.0.9
pyrr 0.10.3
pyrsistent 0.18.0
PySide6 6.5.1.1
PySide6-Addons 6.5.1.1
PySide6-Essentials 6.5.1.1
PySocks 1.7.1
pytest 7.1.2
python-dateutil 2.8.2
python-lsp-black 1.0.0
python-lsp-jsonrpc 1.0.0
python-lsp-server 1.3.3
python-pptx 0.6.21
python-slugify 5.0.2
python-snappy 0.6.0
pytinytex 0.3.3
pytz 2022.1
pyviz-comms 2.0.2
PyWavelets 1.3.0
pywin32 302
pywin32-ctypes 0.2.0
pywinpty 2.0.2
PyYAML 6.0
pyzmq 23.2.0
QDarkStyle 3.0.2
qstylizer 0.1.10
QtAwesome 1.0.3
qtconsole 5.2.2
QtPy 2.2.0
queuelib 1.5.0
regex 2022.7.9
requests 2.26.0
requests-file 1.5.1
rich 10.9.0
rope 0.22.0
Rtree 0.9.7
ruamel-yaml-conda 0.15.100
s3transfer 0.6.0
scikit-image 0.19.2
scikit-learn 1.0.2
scikit-learn-intelex 2021.20221004.171935
scipy 1.11.2
Scrapy 2.6.2
screeninfo 0.8.1
seaborn 0.11.2
Send2Trash 1.8.0
service-identity 18.1.0
setuptools 63.4.1
shiboken6 6.5.1.1
sip 4.19.13
six 1.16.0
skia-pathops 0.7.4
smart-open 5.2.1
sniffio 1.2.0
snowballstemmer 2.2.0
sortedcollections 2.1.0
sortedcontainers 2.4.0
soupsieve 2.3.1
Sphinx 5.0.2
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
spyder 5.2.2
spyder-kernels 2.2.1
SQLAlchemy 1.4.39
srt 3.5.3
statsmodels 0.13.2
svgelements 1.9.5
sympy 1.10.1
tables 3.6.1
tabulate 0.8.10
TBB 0.2
tblib 1.7.0
tenacity 8.0.1
terminado 0.13.1
testpath 0.6.0
text-unidecode 1.3
textdistance 4.2.1
threadpoolctl 2.2.0
three-merge 0.1.1
tifffile 2021.7.2
tinycss 0.4
tldextract 3.2.0
toml 0.10.2
tomli 2.0.1
tomlkit 0.11.1
toolz 0.11.2
tornado 6.1
tqdm 4.66.1
traitlets 5.1.1
Twisted 22.2.0
twisted-iocpsupport 1.0.2
typing_extensions 4.3.0
ujson 5.4.0
Unidecode 1.2.0
urllib3 1.26.6
w3lib 1.21.0
waitress 2.1.2
watchdog 2.3.1
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 0.58.0
Werkzeug 2.3.6
wheel 0.37.1
widgetsnbextension 3.5.2
win-inet-pton 1.1.0
win-unicode-console 0.5
wincertstore 0.2
wrapt 1.14.1
xarray 0.20.1
xlrd 2.0.1
XlsxWriter 3.0.3
xlwings 0.27.15
yapf 0.31.0
zict 2.1.0
zipp 3.8.0
zope.interface 5.4.0
zstandard 0.19.0
```
LaTeX details
+ LaTeX distribution (e.g. TeX Live 2020): pdfTeX
+ Installed LaTeX packages:
FFMPEG
Output of `ffmpeg -version`:
```
ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100
libswresample 4. 10.100 / 4. 10.100
libpostproc 57. 1.100 / 57. 1.100
```
## Additional comments
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the scene with `manim -qm -p --renderer=opengl MultipleVectors.py WhatIsHappening`. Start at the traceback entries in `scene/scene.py`, `renderer/opengl_renderer.py`, `animation/transform.py`, and the reported failure during `animation.begin()`. Done means both sequential `Transform` calls render successfully with the OpenGL renderer, while the existing non-OpenGL behavior remains working.
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
- 28/100