mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
Add show_progress option to checkpoint_paste
This commit is contained in:
@ -190,7 +190,7 @@ class Scene(object):
|
|||||||
# As long as the copied selection starts with a comment,
|
# As long as the copied selection starts with a comment,
|
||||||
# this will revert to the state of the scene at the first
|
# this will revert to the state of the scene at the first
|
||||||
# point of running.
|
# point of running.
|
||||||
def checkpoint_paste(skip=False):
|
def checkpoint_paste(skip=False, show_progress=False):
|
||||||
pasted = pyperclip.paste()
|
pasted = pyperclip.paste()
|
||||||
line0 = pasted.lstrip().split("\n")[0]
|
line0 = pasted.lstrip().split("\n")[0]
|
||||||
if line0.startswith("#"):
|
if line0.startswith("#"):
|
||||||
@ -201,9 +201,14 @@ class Scene(object):
|
|||||||
if skip:
|
if skip:
|
||||||
originally_skip = self.skip_animations
|
originally_skip = self.skip_animations
|
||||||
self.skip_animations = True
|
self.skip_animations = True
|
||||||
|
if show_progress:
|
||||||
|
originally_show_animation_progress = self.show_animation_progress
|
||||||
|
self.show_animation_progress = True
|
||||||
shell.run_line_magic("paste", "")
|
shell.run_line_magic("paste", "")
|
||||||
if skip:
|
if skip:
|
||||||
self.skip_animations = originally_skip
|
self.skip_animations = originally_skip
|
||||||
|
if show_progress:
|
||||||
|
self.show_animation_progress = originally_show_animation_progress
|
||||||
|
|
||||||
local_ns['checkpoint_paste'] = checkpoint_paste
|
local_ns['checkpoint_paste'] = checkpoint_paste
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user