def capture_mobjects(self, mobjects, **kwargs): self.update_sub_cameras() for imfc in self.image_mobjects_from_cameras: to_add = list(mobjects) if not self.allow_cameras_to_capture_their_own_display: to_add = list_difference_update(to_add, imfc.get_family()) imfc.camera.capture_mobjects(to_add, **kwargs) MovingCamera.capture_mobjects(self, mobjects, **kwargs)
def capture_mobjects(self, mobjects, **kwargs): self.update_sub_cameras() for imfc in self.image_mobjects_from_cameras: to_add = list(mobjects) if not self.allow_cameras_to_capture_their_own_display: to_add = list_difference_update( to_add, imfc.get_family() ) imfc.camera.capture_mobjects(to_add, **kwargs) MovingCamera.capture_mobjects(self, mobjects, **kwargs)
def setup(self): """ This method is used internally by Manim to setup the scene for proper use. """ MovingCameraScene.setup(self) # Initialize camera and display zoomed_camera = MovingCamera(**self.zoomed_camera_config) zoomed_display = ImageMobjectFromCamera( zoomed_camera, **self.zoomed_camera_image_mobject_config ) zoomed_display.add_display_frame() for mob in zoomed_camera.frame, zoomed_display: mob.stretch_to_fit_height(self.zoomed_display_height) mob.stretch_to_fit_width(self.zoomed_display_width) zoomed_camera.frame.scale(self.zoom_factor) # Position camera and display zoomed_camera.frame.move_to(self.zoomed_camera_frame_starting_position) if self.zoomed_display_center is not None: zoomed_display.move_to(self.zoomed_display_center) else: zoomed_display.to_corner( self.zoomed_display_corner, buff=self.zoomed_display_corner_buff ) self.zoomed_camera = zoomed_camera self.zoomed_display = zoomed_display
def add_zoomed_camera(self): zoomed_camera = MovingCamera(**self.zoomed_camera_config) zoomed_camera.frame.move_to(self.zoomed_camera_frame_starting_position) zoomed_camera.frame.stretch_to_fit_height(self.zoomed_display_height) zoomed_camera.frame.stretch_to_fit_width(self.zoomed_display_width) zoomed_camera.frame.scale(self.zoom_factor) return zoomed_camera
def __init__(self, *image_mobjects_from_cameras, **kwargs): self.image_mobjects_from_cameras = [] for imfc in image_mobjects_from_cameras: self.add_image_mobject_from_camera(imfc) MovingCamera.__init__(self, **kwargs)
def reset(self): for imfc in self.image_mobjects_from_cameras: imfc.camera.reset() MovingCamera.reset(self) return self