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

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

Open
mateuszdrwal opened this issue May 21, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed html-convert Related to converting to HTML slides present Related to the main "present" feature

Comments

@mateuszdrwal
Copy link
Contributor

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

@mateuszdrwal mateuszdrwal added the enhancement New feature or request label May 21, 2024
@jeertmans
Copy link
Owner

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

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

@mateuszdrwal
Copy link
Contributor Author

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
Copy link
Owner

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.

@jeertmans jeertmans added duplicate This issue or pull request already exists help wanted Extra attention is needed html-convert Related to converting to HTML slides present Related to the main "present" feature labels May 22, 2024
@mateuszdrwal
Copy link
Contributor Author

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:

@model_validator(mode="after")
@classmethod
def loop_and_auto_next_disallowed(
cls, pre_slide_config: "PreSlideConfig"
) -> "PreSlideConfig":
if pre_slide_config.loop and pre_slide_config.auto_next:
raise ValueError(
"You cannot have both `loop=True` and `auto_next=True`, "
"because a looping slide has no ending. "
"This may be supported in the future if "
"https://github.com/jeertmans/manim-slides/pull/299 gets merged."
)
return pre_slide_config

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

@jeertmans
Copy link
Owner

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:

@model_validator(mode="after")
@classmethod
def loop_and_auto_next_disallowed(
cls, pre_slide_config: "PreSlideConfig"
) -> "PreSlideConfig":
if pre_slide_config.loop and pre_slide_config.auto_next:
raise ValueError(
"You cannot have both `loop=True` and `auto_next=True`, "
"because a looping slide has no ending. "
"This may be supported in the future if "
"https://github.com/jeertmans/manim-slides/pull/299 gets merged."
)
return pre_slide_config

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request help wanted Extra attention is needed html-convert Related to converting to HTML slides present Related to the main "present" feature
Projects
None yet
Development

No branches or pull requests

2 participants