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

Add a 'wrap' mode to Animation and AnimationWidget #13

Open
alisterburt opened this issue Jan 11, 2021 · 2 comments
Open

Add a 'wrap' mode to Animation and AnimationWidget #13

alisterburt opened this issue Jan 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@alisterburt
Copy link
Collaborator

What do we think about a 'wrap' mode for animations, you define the 'forward' pass and the rendered animation also contains the reverse for a nice loop.

I was thinking a bool attribute of the Animation class, exposed by a checkbox in the AnimationWidget.

That bool being set to True would modify a copy of the keyframe dict within Animation.animate to provide the reverse direction.

This approach is naive and would involve rerendering every frame but I don't know how I would reuse frames with the current state generator

@sofroniewn
Copy link
Collaborator

Ah to make "continuous movies"? I'd probably think about an enum. You might also just want a "loop" where you add the first frame on to the end of the list so that it ends and starts in the same place without doing the forward and reverse, though I can see how both are desirable.

For going in "reverse" I'd try to avoid copying the whole keyframe dict, but maybe you can just traverse it backwards with appropriate flags/ settings inside _state_generator which could now take a reverse=False bool input and if true you could do a 1-fraction in the appropriate place. Inside _frame_generator you could then call _state_generator twice, or add in that extra frame from the beginning depending on the "mode"

@alisterburt
Copy link
Collaborator Author

alisterburt commented Jan 13, 2021 via email

@psobolewskiPhD psobolewskiPhD added the enhancement New feature or request label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants