def __init__(self, **kwargs): Container.__init__(self, **kwargs) self.camera = self.camera_class(**self.camera_config) self.file_writer = SceneFileWriter( self, **self.file_writer_config, ) self.mobjects = [] # TODO, remove need for foreground mobjects self.foreground_mobjects = [] self.num_plays = 0 self.time = 0 self.original_skipping_status = self.skip_animations if self.random_seed is not None: random.seed(self.random_seed) np.random.seed(self.random_seed) self.setup() try: self.construct() except EndSceneEarlyException: pass self.tear_down() self.file_writer.finish() self.print_end_message()
def __init__(self, **kwargs): digest_config(self, kwargs) if self.preview: from manimlib.window import Window self.window = Window(scene=self, **self.window_config) self.camera_config["ctx"] = self.window.ctx self.camera_config["frame_rate"] = 30 # Where's that 30 from? else: self.window = None self.camera: Camera = self.camera_class(**self.camera_config) self.file_writer = SceneFileWriter(self, **self.file_writer_config) self.mobjects: list[Mobject] = [self.camera.frame] self.num_plays: int = 0 self.time: float = 0 self.skip_time: float = 0 self.original_skipping_status: bool = self.skip_animations if self.start_at_animation_number is not None: self.skip_animations = True # Items associated with interaction self.mouse_point = Point() self.mouse_drag_point = Point() self.hold_on_wait = self.presenter_mode # Much nicer to work with deterministic scenes if self.random_seed is not None: random.seed(self.random_seed) np.random.seed(self.random_seed)
def __init__(self, **kwargs): digest_config(self, kwargs) if self.preview: from manimlib.window import Window self.window = Window(scene=self, **self.window_config) self.camera_config["ctx"] = self.window.ctx else: self.window = None self.camera = self.camera_class(**self.camera_config) self.file_writer = SceneFileWriter(self, **self.file_writer_config) self.mobjects = [] self.num_plays = 0 self.time = 0 self.skip_time = 0 self.original_skipping_status = self.skip_animations # Items associated with interaction self.mouse_point = Point() self.mouse_drag_point = Point() # Much nicer to work with deterministic scenes if self.random_seed is not None: random.seed(self.random_seed) np.random.seed(self.random_seed)
def __init__(self, **kwargs): Container.__init__(self, **kwargs) if self.preview: self.window = Window(self, **self.window_config) self.camera_config["ctx"] = self.window.ctx self.virtual_animation_start_time = 0 self.real_animation_start_time = time.time() else: self.window = None self.camera = self.camera_class(**self.camera_config) self.file_writer = SceneFileWriter(self, **self.file_writer_config) self.mobjects = [] self.num_plays = 0 self.time = 0 self.skip_time = 0 self.original_skipping_status = self.skip_animations self.time_of_last_frame = time.time() # Items associated with interaction self.mouse_point = Point() self.mouse_drag_point = Point() self.zoom_on_scroll = False self.quit_interaction = False # Much nice to work with deterministic scenes if self.random_seed is not None: random.seed(self.random_seed) np.random.seed(self.random_seed)
def __init__(self, **kwargs): digest_config(self, kwargs) if self.preview: from manimlib.window import Window self.window = Window(scene=self, **self.window_config) self.camera_config["ctx"] = self.window.ctx self.camera_config["fps"] = 30 # Where's that 30 from? self.undo_stack = [] self.redo_stack = [] else: self.window = None self.camera: Camera = self.camera_class(**self.camera_config) self.file_writer = SceneFileWriter(self, **self.file_writer_config) self.mobjects: list[Mobject] = [self.camera.frame] self.id_to_mobject_map: dict[int, Mobject] = dict() self.num_plays: int = 0 self.time: float = 0 self.skip_time: float = 0 self.original_skipping_status: bool = self.skip_animations self.checkpoint_states: dict[str, list[tuple[Mobject, Mobject]]] = dict() if self.start_at_animation_number is not None: self.skip_animations = True if self.file_writer.has_progress_display: self.show_animation_progress = False # Items associated with interaction self.mouse_point = Point() self.mouse_drag_point = Point() self.hold_on_wait = self.presenter_mode self.inside_embed = False self.quit_interaction = False # Much nicer to work with deterministic scenes if self.random_seed is not None: random.seed(self.random_seed) np.random.seed(self.random_seed)
def __init__(self, **kwargs): #V.scene=self self.be("scene") digest_config(self, kwargs) # self.init_vars() self.init_frame(frame_width=WindowScene.CONFIG['scene_shape'][0], frame_height=WindowScene.CONFIG['scene_shape'][1], frame_center=WindowScene.CONFIG['scene_center']) super().__init__(**kwargs) self.camera_config['frame_width'] = self.frame_width self.camera_config['frame_height'] = self.frame_height self.camera_config['frame_center'] = self.frame_center self.init_camera_frame(**self.camera_config) self.file_writer = SceneFileWriter( self, **self.file_writer_config, ) self.mobjects = [] # TODO, remove need for foreground mobjects self.foreground_mobjects = [] self.num_plays = 0 self.time = 0 self.original_skipping_status = self.skip_animations if self.random_seed is not None: rrandom.seed(self.random_seed) random.seed(self.random_seed) self.setup() try: # if self.camera.scene_frame: # self.play(self.camera.scene_frame.animate.shift([1,1,0]),run_time=3) self.construct() except EndSceneEarlyException: pass self.tear_down() self.file_writer.finish() self.print_end_message()