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

[BUG] --GL rendering: unexpected keyword argument 'skip_animations' #395

Closed
semikernel opened this issue Apr 2, 2024 · 9 comments
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists manimgl Exclusive to ManimGL

Comments

@semikernel
Copy link

Description

I can't use manimgl to render the manim scene slides. After I input:

 manim-slides render --GL  test_gl.py

The terminal outputs:

ManimGL v1.6.1
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/semikernel/Tiktok/manim/manimlib/__main__.py", line 29, in <module>
    main()
  File "/home/semikernel/Tiktok/manim/manimlib/__main__.py", line 22, in main
    scenes = manimlib.extract_scene.main(config)
  File "/home/semikernel/Tiktok/manim/manimlib/extract_scene.py", line 134, in main
    scenes = get_scenes_to_render(all_scene_classes, scene_config, config)
  File "/home/semikernel/Tiktok/manim/manimlib/extract_scene.py", line 107, in get_scenes_to_render
    return [
  File "/home/semikernel/Tiktok/manim/manimlib/extract_scene.py", line 108, in <listcomp>
    scene_from_class(scene_class, scene_config, config)
  File "/home/semikernel/Tiktok/manim/manimlib/extract_scene.py", line 86, in scene_from_class
    return scene_class(**scene_config)
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/manimlib.py", line 19, in __init__
    super().__init__(*args, **kwargs)
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/base.py", line 40, in __init__
    super().__init__(*args, **kwargs)
  File "/home/semikernel/Tiktok/manim/manimlib/scene/scene.py", line 122, in __init__
    self.file_writer = SceneFileWriter(self, **self.file_writer_config)
TypeError: SceneFileWriter.__init__() got an unexpected keyword argument 'skip_animations'

It can't do anything else.

Version

manim-slides, version 5.1.3

Platform

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy

Screenshots

No response

Additional information

No response

@semikernel semikernel added the bug Something isn't working label Apr 2, 2024
@semikernel
Copy link
Author

I have seen #315 #314, but it doesn't help me.

@jeertmans
Copy link
Owner

Hello, so I see you refer to #314: can you confirm you did not install manimgl from the GitHub repository?

@semikernel
Copy link
Author

Hello, so I see you refer to #314: can you confirm you did not install manimgl from the GitHub repository?

I use these lines to install manimgl:

git clone https://github.com/3b1b/manim.git
cd manim
conda create -n manim python=3.8
conda activate manim
pip install -e .

@jeertmans
Copy link
Owner

Ok, so you indeed installed ManimGL from the repository, which is not supported as explained in #314. The main reason is that the master branch (the default one) contains unreleased breaking changes.

Please change the installation setup with:

git clone https://github.com/3b1b/manim.git
git checkout v1.6.1
cd manim
conda create -n manim python=3.8
conda activate manim
pip install -e .

@jeertmans jeertmans added duplicate This issue or pull request already exists manimgl Exclusive to ManimGL labels Apr 2, 2024
@jeertmans jeertmans changed the title Skip Animation Bug using --GL when rendering [BUG] --GL rendering: unexpected keyword argument 'skip_animations' Apr 4, 2024
@jeertmans
Copy link
Owner

Any update on this @semikernel?

@jeertmans jeertmans added the waiting author Waiting author response label Apr 11, 2024
@semikernel
Copy link
Author

Any update on this @semikernel?

Hi,there! I changed the installation repository to

git clone https://github.com/3b1b/manim.git

However, it doesn't work for me.
The terminal prompt still has the same error.

The detailed is here.I created a new conda environment called mslides_gl_e

manim-slides render report411gl.py --GL
ManimGL v1.6.1
[16:41:34] INFO     Using the default configuration file, which    config.py:362
                    you can modify in                                           
                    `/home/semikernel/Tiktok/Slides_gl_E/manim/man              
                    imlib/default_config.yml`                                   
           INFO     If you want to create a local configuration    config.py:363
                    file, you can create a file named                           
                    `custom_config.yml`, or run `manimgl --config`              
1: P16
2: P8i

That module has multiple scenes, which ones would you like to render?
Scene Name or Number: 2
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/__main__.py", line 29, in <module>
    main()
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/__main__.py", line 22, in main
    scenes = manimlib.extract_scene.main(config)
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/extract_scene.py", line 134, in main
    scenes = get_scenes_to_render(all_scene_classes, scene_config, config)
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/extract_scene.py", line 107, in get_scenes_to_render
    return [
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/extract_scene.py", line 108, in <listcomp>
    scene_from_class(scene_class, scene_config, config)
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/extract_scene.py", line 86, in scene_from_class
    return scene_class(**scene_config)
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/manimlib.py", line 19, in __init__
    super().__init__(*args, **kwargs)
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/base.py", line 38, in __init__
    super().__init__(*args, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_E/manim/manimlib/scene/scene.py", line 125, in __init__
    self.file_writer = SceneFileWriter(self, **self.file_writer_config)
TypeError: SceneFileWriter.__init__() got an unexpected keyword argument 'skip_animations'

The P8i is a manim scene I created.

@jeertmans
Copy link
Owner

Hello @semikernel, did you run git checkout v1.6.1 before installing with pip?

@semikernel
Copy link
Author

Hello @semikernel, did you run git checkout v1.6.1 before installing with pip?

Thank you for your hint, now it don't show 'skip animation' warning. I used to ignore that step just because I don't know that I should use git checkout in the manim directory. However, now it has another weird waring:

ValueError: operands could not be broadcast together with shapes (3,3) (0,3)

My Code is TestGL.py, it's a copy of the manim-slides documentation.

from manimlib import *
from manim_slides import Slide, ThreeDSlide

class ThreeDExample(ThreeDSlide):
    def construct(self):
        axes = ThreeDAxes()
        circle = Circle(radius=3, color=BLUE)
        dot = Dot(color=RED)

        self.add(axes)

        frame = self.camera.frame
        frame.set_euler_angles(
            theta=30 * DEGREES,
            phi=75 * DEGREES,
        )

        self.play(GrowFromCenter(circle))

        def updater(m, dt):
            return m.increment_theta((75 * DEGREES / 4) * dt)

        frame.add_updater(updater)

        self.next_slide()

        self.next_slide(loop=True)
        self.play(MoveAlongPath(dot, circle), run_time=4, rate_func=linear)
        self.next_slide()

        frame.remove_updater(updater)
        self.play(frame.animate.set_theta(30 * DEGREES))
        self.play(dot.animate.move_to(ORIGIN))
        self.next_slide()

        self.play(dot.animate.move_to(RIGHT * 3))
        self.next_slide()

        self.next_slide(loop=True)
        self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
        self.next_slide()

        self.play(dot.animate.move_to(ORIGIN))

The terminal then outputs:

ManimGL v1.6.1
[11:08:45] INFO     Using the default configuration file, which you can modify in `/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/default_config.yml`                                             config.py:265
           INFO     If you want to create a local configuration file, you can create a file named `custom_config.yml`, or run `manimgl --config`                                                      config.py:266
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/__main__.py", line 29, in <module>
    main()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/__main__.py", line 25, in main
    scene.run()
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/manimlib.py", line 64, in run
    super().run(*args, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/scene/scene.py", line 91, in run
    self.construct()
  File "/home/semikernel/Tiktok/Slides_gl_e/TestGL.py", line 6, in construct
    axes = ThreeDAxes()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 464, in __init__
    Axes.__init__(self, x_range, y_range, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 383, in __init__
    self.x_axis = self.create_axis(
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 405, in create_axis
    axis = NumberLine(range_terms, **new_config)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/number_line.py", line 60, in __init__
    super().__init__(self.x_min * RIGHT, self.x_max * RIGHT, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 450, in __init__
    super().__init__(**kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 85, in __init__
    super().__init__(**kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/mobject.py", line 89, in __init__
    self.init_points()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 453, in init_points
    self.set_points_by_ends(self.start, self.end, self.buff, self.path_arc)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 487, in set_points_by_ends
    self.set_points_as_corners([start, end])
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 496, in set_points_as_corners
    self.set_anchors_and_handles(*[
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 365, in set_anchors_and_handles
    self.set_points(new_points)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 968, in wrapper
    if not np.all(self.get_points() == old_points):
ValueError: operands could not be broadcast together with shapes (3,3) (0,3) 

Could you please give me some hints about what should I do know? Thx a lot!
Screenshot from 2024-05-18 11-20-01

@jeertmans
Copy link
Owner

Hello @semikernel, did you run git checkout v1.6.1 before installing with pip?

Thank you for your hint, now it don't show 'skip animation' warning. I used to ignore that step just because I don't know that I should use git checkout in the manim directory. However, now it has another weird waring:

ValueError: operands could not be broadcast together with shapes (3,3) (0,3)

My Code is TestGL.py, it's a copy of the manim-slides documentation.

from manimlib import *
from manim_slides import Slide, ThreeDSlide

class ThreeDExample(ThreeDSlide):
    def construct(self):
        axes = ThreeDAxes()
        circle = Circle(radius=3, color=BLUE)
        dot = Dot(color=RED)

        self.add(axes)

        frame = self.camera.frame
        frame.set_euler_angles(
            theta=30 * DEGREES,
            phi=75 * DEGREES,
        )

        self.play(GrowFromCenter(circle))

        def updater(m, dt):
            return m.increment_theta((75 * DEGREES / 4) * dt)

        frame.add_updater(updater)

        self.next_slide()

        self.next_slide(loop=True)
        self.play(MoveAlongPath(dot, circle), run_time=4, rate_func=linear)
        self.next_slide()

        frame.remove_updater(updater)
        self.play(frame.animate.set_theta(30 * DEGREES))
        self.play(dot.animate.move_to(ORIGIN))
        self.next_slide()

        self.play(dot.animate.move_to(RIGHT * 3))
        self.next_slide()

        self.next_slide(loop=True)
        self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
        self.next_slide()

        self.play(dot.animate.move_to(ORIGIN))

The terminal then outputs:

ManimGL v1.6.1
[11:08:45] INFO     Using the default configuration file, which you can modify in `/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/default_config.yml`                                             config.py:265
           INFO     If you want to create a local configuration file, you can create a file named `custom_config.yml`, or run `manimgl --config`                                                      config.py:266
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/__main__.py", line 29, in <module>
    main()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/__main__.py", line 25, in main
    scene.run()
  File "/home/semikernel/.local/lib/python3.10/site-packages/manim_slides/slide/manimlib.py", line 64, in run
    super().run(*args, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/scene/scene.py", line 91, in run
    self.construct()
  File "/home/semikernel/Tiktok/Slides_gl_e/TestGL.py", line 6, in construct
    axes = ThreeDAxes()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 464, in __init__
    Axes.__init__(self, x_range, y_range, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 383, in __init__
    self.x_axis = self.create_axis(
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/coordinate_systems.py", line 405, in create_axis
    axis = NumberLine(range_terms, **new_config)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/number_line.py", line 60, in __init__
    super().__init__(self.x_min * RIGHT, self.x_max * RIGHT, **kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 450, in __init__
    super().__init__(**kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 85, in __init__
    super().__init__(**kwargs)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/mobject.py", line 89, in __init__
    self.init_points()
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 453, in init_points
    self.set_points_by_ends(self.start, self.end, self.buff, self.path_arc)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/geometry.py", line 487, in set_points_by_ends
    self.set_points_as_corners([start, end])
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 496, in set_points_as_corners
    self.set_anchors_and_handles(*[
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 365, in set_anchors_and_handles
    self.set_points(new_points)
  File "/home/semikernel/Tiktok/Slides_gl_e/manim/manimlib/mobject/types/vectorized_mobject.py", line 968, in wrapper
    if not np.all(self.get_points() == old_points):
ValueError: operands could not be broadcast together with shapes (3,3) (0,3) 

Could you please give me some hints about what should I do know? Thx a lot! Screenshot from 2024-05-18 11-20-01

Nice, I will close this issue then as this is solved.

For you second issue, this is because you need to downgrade NumPy, see 3b1b/manim#2053 (comment).

@jeertmans jeertmans removed the waiting author Waiting author response label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists manimgl Exclusive to ManimGL
Projects
None yet
Development

No branches or pull requests

2 participants