mirror of
https://github.com/3b1b/manim.git
synced 2025-07-31 05:52:34 +08:00
freeze_background for scenes
This commit is contained in:
@ -41,7 +41,7 @@ class Camera(object):
|
||||
self.space_shape = (space_height, space_width)
|
||||
|
||||
def init_background(self):
|
||||
if self.background:
|
||||
if self.background is not None:
|
||||
self.pixel_shape = self.background.shape[:2]
|
||||
else:
|
||||
background_rgb = color_to_int_rgb(self.background_color)
|
||||
|
@ -60,6 +60,11 @@ class Scene(object):
|
||||
else:
|
||||
self.camera.reset()
|
||||
self.camera.capture_mobjects(mobjects, **kwargs)
|
||||
|
||||
def freeze_background(self):
|
||||
self.update_frame()
|
||||
self.set_camera(Camera(self.get_frame()))
|
||||
self.clear()
|
||||
###
|
||||
|
||||
def add(self, *mobjects):
|
||||
|
Reference in New Issue
Block a user