jeertmans / manim-slides

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

[FEATURE] Allow for waiting until loop is complete before switching slide #436

Open mateuszdrwal opened 1 month ago

mateuszdrwal commented 1 month ago

Description

I like continuity, and I have a few slides with relatively quick loops. It would be great to have a kwarg for next_slide that makes it so that if the slide is looping, after the next slide is triggered it waits for the current loop to end before proceeding. That way the visuals never suddenly jump to a new state which can be quite jarring.

Screenshots

No response

Additional information

No response

jeertmans commented 1 month ago

Did you check the option --next-terminates-loop?

This might not be the exact thing you are looking for, but can you check?

mateuszdrwal commented 1 month ago

Yes, this seems to be the functionality I have been looking for! I didn't find it in the docs because I didn't expect it to be a command line parameter, but a property that you can apply to certain slides. Unfortunately, I am currently stuck with the web presenter as i suffer from #293 and my system python is 3.12, which pyside6 6.5 does not support. My workaround is probably going to be hacking together some GUI-supporting docker environment where I can run the QT presenter.

I'll let the issue stay open as this would be nice to have supported in the web presenter if the framework allows. Also, I think it would still be preferable to specify this behavior in code per slide since some looping slides may be longer and should always be skipped, although pressing the forward button twice is not a hard workaround.

jeertmans commented 1 month ago

Ok, well, I think this is a duplicate of #254, that I closed when implementing --next-terminates-loop. The issue is that I do not control how videos are played with RevealJS (HTML export), so the only way to support such a feature with HTML would be to hack the RevealJS code (or inject some hooks). This is totally feasible, but I don't feed I have the time nor the competence to implement this at the moment.

The reasons I implemented the --next-terminates-loop in a two-click solution was because I seemed to me the most natural and easy solution.

I will like this open in case someone has some time to help to improve either or both issues.

Regarding the issue with Python 3.12, I very easy workaround might be to install Python 3.11.

mateuszdrwal commented 1 month ago

I seem to have mistested the functionality last time, what I'm after is loop=True along with auto_next=True. This seems to work if I force both options to true in the presentation json file, but there is an old validation check from before #299 that prevents it from being specified in the slide python:

https://github.com/jeertmans/manim-slides/blob/9460f6b135ed0700c1f6cb503eb52d17312de1d3/manim_slides/config.py#L265-L278

I'm not very familiar with the codebase, do you think there is anything else that may break if this check is removed?

jeertmans commented 1 month ago

I seem to have mistested the functionality last time, what I'm after is loop=True along with auto_next=True. This seems to work if I force both options to true in the presentation json file, but there is an old validation check from before #299 that prevents it from being specified in the slide python:

https://github.com/jeertmans/manim-slides/blob/9460f6b135ed0700c1f6cb503eb52d17312de1d3/manim_slides/config.py#L265-L278

I'm not very familiar with the codebase, do you think there is anything else that may break if this check is removed?

Nice catch! Maybe you can do a PR that just removes this check?