3b1b / manim

Animation engine for explanatory math videos
MIT License
60.28k stars 5.7k forks source link

No attribute "get_coord" error #1732

Closed ZoomGC closed 2 years ago

ZoomGC commented 2 years ago

While using manimgl, it seems the attribute "get_coord" isn't working or there is some other issue with it

Code and Error

Code: manimgl wordle.py Then I select scene 32

Error:

  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python310\Scripts\manimgl.exe\__main__.py", line 7, in <module>
  File "C:\Program Files\Python310\lib\site-packages\manimlib\__main__.py", line 25, in main
    scene.run()
  File "C:\Program Files\Python310\lib\site-packages\manimlib\scene\scene.py", line 76, in run
    self.setup()
  File "C:\python stuff\3b1b Git\videos\_2022\wordle.py", line 1402, in setup
    super().setup()
  File "C:\python stuff\3b1b Git\videos\_2022\wordle.py", line 774, in setup
    self.add_guess_value_grid_title()
  File "C:\python stuff\3b1b Git\videos\_2022\wordle.py", line 801, in add_guess_value_grid_title
    underline.match_y(first.get_bottom() + 0.025 * DOWN)
  File "C:\Program Files\Python310\lib\site-packages\manimlib\mobject\mobject.py", line 1195, in match_y
    return self.match_coord(mobject, 1, direction)
  File "C:\Program Files\Python310\lib\site-packages\manimlib\mobject\mobject.py", line 1186, in match_coord
    mobject.get_coord(dim, direction),
AttributeError: 'numpy.ndarray' object has no attribute 'get_coord'

Environment

OS System: Windows 10 manim version: master python version: 3.10

TonyCrane commented 2 years ago

The version Grant is using in his new video is the video-work branch of this repo, which has not yet been merged into the master branch. Note that in the commit https://github.com/3b1b/manim/commit/29a4d3e82ba94c007c996b2d1d0f923941452698 in the video-work branch, Grant improved match_coord to receive a mobject or point. So if you want to fix this, either switch your manimgl to the source in the video-work branch, or make the same changes as https://github.com/3b1b/manim/commit/29a4d3e82ba94c007c996b2d1d0f923941452698 in your local source code.