mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
freeze_background for scenes
This commit is contained in:
parent
0501fa4492
commit
c19b313808
2 changed files with 6 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue