mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Add show_progress and skip options to checkpoint_paste
This commit is contained in:
parent
af471161ea
commit
3e4b6a7fb0
1 changed files with 10 additions and 1 deletions
|
@ -206,7 +206,7 @@ class Scene(object):
|
|||
# As long as the copied selection starts with a comment,
|
||||
# this will revert to the state of the scene at the first
|
||||
# point of running.
|
||||
def checkpoint_paste(quiet=True):
|
||||
def checkpoint_paste(quiet=True, show_progress=True, skip=False):
|
||||
pasted = pyperclip.paste()
|
||||
line0 = pasted.lstrip().split("\n")[0]
|
||||
if line0.startswith("#"):
|
||||
|
@ -215,8 +215,17 @@ class Scene(object):
|
|||
else:
|
||||
self.revert_to_checkpoint(line0)
|
||||
self.update_frame(dt=0)
|
||||
|
||||
prev_show_progress = self.show_animation_progress
|
||||
prev_skipping = self.skip_animations
|
||||
self.show_animation_progress = show_progress
|
||||
self.skip_animations = skip
|
||||
|
||||
shell.run_line_magic("paste", "-q" if quiet else "")
|
||||
|
||||
self.show_animation_progress = prev_show_progress
|
||||
self.skip_animations = prev_skipping
|
||||
|
||||
local_ns['checkpoint_paste'] = checkpoint_paste
|
||||
|
||||
# Enables gui interactions during the embed
|
||||
|
|
Loading…
Add table
Reference in a new issue