Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with OpenGL rendering for Transform of SVGMobjects #4182

Open
gsong-math opened this issue Mar 4, 2025 · 1 comment
Open

Issue with OpenGL rendering for Transform of SVGMobjects #4182

gsong-math opened this issue Mar 4, 2025 · 1 comment

Comments

@gsong-math
Copy link

Description of bug / unexpected behavior

For two SVGMobjects svg1 and svg2, self.play(Transform(svg1, svg2)) will give
TypeError: object of type 'NoneType' has no len()

Expected behavior

How to reproduce the issue

Code for reproducing the problem
svg1 = SVGMObject('test1.svg')
svg2 = SVGMObject('test2.svg')
self.play(Create(svg1), Create(svg2))
self.play(Transform(svg1, svg2))

Additional media files

Images/GIFs

Logs

Terminal output
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR

transform.p │
│ y:202 in begin │
│ │
│ 199 │ │ # Note, this potentially changes the structure │
│ 200 │ │ # of both mobject and target_mobject │
│ 201 │ │ if config.renderer == RendererType.OPENGL: │
│ ❱ 202 │ │ │ self.mobject.align_data_and_family(self.target_copy) │
│ 203 │ │ else: │
│ 204 │ │ │ self.mobject.align_data(self.target_copy) │
│ 205 │ │ super().begin() │
│ │
site-packages/manim/mobject/opengl/opengl │
│ _mobject.py:2469 in align_data_and_family │
│ │
│ 2466 │ │
│ 2467 │ def align_data_and_family(self, mobject: OpenGLMobject) -> Self: │
│ 2468 │ │ self.align_family(mobject) │
│ ❱ 2469 │ │ self.align_data(mobject) │
│ 2470 │ │ return self │
│ 2471 │ │
│ 2472 │ def align_data(self, mobject: OpenGLMobject) -> Self: │
│ │
│/site-packages/manim/mobject/opengl/opengl │
│ _mobject.py:2484 in align_data │
│ │
│ 2481 │ │ │ │ │ continue │
│ 2482 │ │ │ │ arr1 = mob1.data[key] │
│ 2483 │ │ │ │ arr2 = mob2.data[key] │
│ ❱ 2484 │ │ │ │ if len(arr2) > len(arr1): │
│ 2485 │ │ │ │ │ mob1.data[key] = resize_preserving_order(arr1, len(arr2)) │
│ 2486 │ │ │ │ elif len(arr1) > len(arr2): │
│ 2487 │ │ │ │ │ mob2.data[key] = resize_preserving_order(arr2, len(arr1)) │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: object of type 'NoneType' has no len()

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
PASTE HERE
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

@gsong-math
Copy link
Author

manim -pql main.py Main --renderer=opengl will cause the problem, while manim -pql main.py Main works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant