mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 02:35:22 +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)
|
self.space_shape = (space_height, space_width)
|
||||||
|
|
||||||
def init_background(self):
|
def init_background(self):
|
||||||
if self.background:
|
if self.background is not None:
|
||||||
self.pixel_shape = self.background.shape[:2]
|
self.pixel_shape = self.background.shape[:2]
|
||||||
else:
|
else:
|
||||||
background_rgb = color_to_int_rgb(self.background_color)
|
background_rgb = color_to_int_rgb(self.background_color)
|
||||||
|
@ -60,6 +60,11 @@ class Scene(object):
|
|||||||
else:
|
else:
|
||||||
self.camera.reset()
|
self.camera.reset()
|
||||||
self.camera.capture_mobjects(mobjects, **kwargs)
|
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):
|
def add(self, *mobjects):
|
||||||
|
Reference in New Issue
Block a user