jeertmans / manim-slides

Tool for live presentations using manim
https://manim-slides.eertmans.be
MIT License
419 stars 46 forks source link

[FEATURE] Combine two classes into one #385

Closed semikernel closed 4 months ago

semikernel commented 4 months ago

Description

I am wondering that if there is a way to combine two classes into one. I have two classes: MovingCameraSlide and MovingCameraSlide3D, I want to render each other one by one firstly and then combine them together. I think this is important when we develop a relatively huge project, and develop different kinds of scenes separately. Thx a lot!!

Screenshots

No response

Additional information

No response

jeertmans commented 4 months ago

Hello @semikernel!

On the Manim side, unfortunately, you cannot easily concatenate two scenes.

E.g., manim render example.py BasicExample ThreeDExample will generate two separate videos, one for each scene. You could create a super class in Python that construct each function after the other, but you will have some issues when mixing different kinds of scene, see how and why here: https://github.com/ManimCommunity/manim/pull/2957.

However, Manim Slides totally allows playing multiple scenes in a sequence: manim-slides present BasicExample ThreeDExample will work as expected.

If you convert your slide to HTML, PowerPoint, or else, then manim-slides convert BasicExample ThreeDExample ... will convert into one file.

One downside of this approach is that you need to type the name of the scenes in the order you want to play them, every time.

Did I help you?

semikernel commented 4 months ago

Hello @semikernel!

On the Manim side, unfortunately, you cannot easily concatenate two scenes.

E.g., manim render example.py BasicExample ThreeDExample will generate two separate videos, one for each scene. You could create a super class in Python that construct each function after the other, but you will have some issues when mixing different kinds of scene, see how and why here: ManimCommunity/manim#2957.

However, Manim Slides totally allows playing multiple scenes in a sequence: manim-slides present BasicExample ThreeDExample will work as expected.

If you convert your slide to HTML, PowerPoint, or else, then manim-slides convert BasicExample ThreeDExample ... will convert into one file.

One downside of this approach is that you need to type the name of the scenes in the order you want to play them, every time.

Did I help you?

Yes that's it! It's a very useful fuction. You did a brilliant job!

jeertmans commented 4 months ago

Nice! Closing this now as this seems to be answered.