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

When renderer is openGL, Point has no attribute 'color' #4175

Open
fogsong233 opened this issue Feb 22, 2025 · 0 comments
Open

When renderer is openGL, Point has no attribute 'color' #4175

fogsong233 opened this issue Feb 22, 2025 · 0 comments

Comments

@fogsong233
Copy link
Contributor

Description of bug / unexpected behavior

 self.add(Point(location=[-1, 0, 0], color=WHITE))

I wrote this code and it did well before i switch the renderer to the OpenGL, but after i change i got an exeception:

Traceback (most recent call last):
  File "E:\project_new\manim\linear-transform\main.py", line 29, in <module>
    main()
  File "E:\project_new\manim\linear-transform\main.py", line 25, in main
    PointMovingOnShapes().render()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\scene\scene.py", line 237, in render
    self.construct()
  File "E:\project_new\manim\linear-transform\main.py", line 7, in construct
    self.add(Point(location=[-1, 0, 0], color=WHITE))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 412, in __init__
    super().__init__(color=color, **kwargs)
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 72, in __init__
    super().__init__(**kwargs)
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\opengl\opengl_mobject.py", line 186, in __init__
    self.init_points()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 416, in init_points
    self.generate_points()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 420, in generate_points
    self.add_points(np.array([self.location]))
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 99, in add_points
    color = ManimColor(color) if color else self.color
                                            ^^^^^^^^^^
AttributeError: 'Point' object has no attribute 'color'

Expected behavior

How to reproduce the issue

Code for reproducing the problem
self.add(Point(location=[-1, 0, 0], color=WHITE))

Additional media files

Images/GIFs

Logs

Terminal output
Traceback (most recent call last):
  File "E:\project_new\manim\linear-transform\main.py", line 29, in <module>
    main()
  File "E:\project_new\manim\linear-transform\main.py", line 25, in main
    PointMovingOnShapes().render()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\scene\scene.py", line 237, in render
    self.construct()
  File "E:\project_new\manim\linear-transform\main.py", line 7, in construct
    self.add(Point(location=[-1, 0, 0], color=WHITE))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 412, in __init__
    super().__init__(color=color, **kwargs)
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 72, in __init__
    super().__init__(**kwargs)
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\opengl\opengl_mobject.py", line 186, in __init__
    self.init_points()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 416, in init_points
    self.generate_points()
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 420, in generate_points
    self.add_points(np.array([self.location]))
  File "E:\project_new\manim\linear-transform\.venv\Lib\site-packages\manim\mobject\types\point_cloud_mobject.py", line 99, in add_points
    color = ManimColor(color) if color else self.color
                                            ^^^^^^^^^^
AttributeError: 'Point' object has no attribute 'color'

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):
Windows 11
python 3.12.4
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

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