Render option for last-n animations #2814
mscuthbert
started this conversation in
Suggestions and Proposals
Replies: 2 comments
-
The implementation of this feature (specifically |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you taken a look at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description of proposed feature
In rendering manim videos, I often want to render just the last few animations. I'll use the flag
-n 35
and then when I've added a few more animations, I'll update to-n 40
, etc.It would be helpful to have a flag like
-n -5
or--last_n_frames 5
which would only render the last few frames of the video; saving time when debugging with early returns, etc.How can the new feature be used?
as described above -- to save time when developing, especially in CairoRenderer where interactive debug isn't available.
Additional comments
I'm still a manim novice -- finishing my first longish video (medieval music animations!) so I've only just gotten a grasp of how the Scene and renderers interact with each other, but my sense is that the difficulty of this feature is that when
render()
is called andconstruct()
is run, the system has no idea how manyplay()
calls will be run, so counting backwards isn't easy.Two implementation paths come to mind, both involving running the scene twice.
-n start-end
appropriately and run again.NullRenderer
whose.play()
function does nothing exceptupdate_skipping_status
. Creating aBaseRenderer
that Cairo and OpenGL (and NullRenderer) both inherit from would probably save some code-dup anyhow.The problem with both of these approaches is if the
construct()
call changes properties onself
while running and does not reset them they will be incorrect the second run:This could be a documented limitation of this method or doing something like creating a deepcopy of the Scene object before running construct() could work. It still would have issues though if there were side effects like reading/writing state from disk, but that is quite rare.
If the community supported this, I'd be willing to implement it myself.
Beta Was this translation helpful? Give feedback.
All reactions