@@ -168,48 +168,8 @@ def get_attrs(self, *keys):
168
168
"""
169
169
return [getattr (self , key ) for key in keys ]
170
170
171
- def update_frame ( # TODO Description in Docstring
172
- self ,
173
- mobjects = None ,
174
- background = None ,
175
- include_submobjects = True ,
176
- ignore_skipping = True ,
177
- ** kwargs ,
178
- ):
179
- """Update the frame.
180
-
181
- Parameters
182
- ----------
183
- mobjects: list, optional
184
- list of mobjects
185
-
186
- background: np.ndarray, optional
187
- Pixel Array for Background.
188
-
189
- include_submobjects: bool, optional
190
-
191
- ignore_skipping : bool, optional
192
-
193
- **kwargs
194
-
195
- """
196
- if file_writer_config ["skip_animations" ] and not ignore_skipping :
197
- return
198
- if mobjects is None :
199
- mobjects = list_update (
200
- self .mobjects ,
201
- self .foreground_mobjects ,
202
- )
203
- if background is not None :
204
- self .camera .set_frame_to_background (background )
205
- else :
206
- self .camera .reset ()
207
-
208
- kwargs ["include_submobjects" ] = include_submobjects
209
- self .camera .capture_mobjects (mobjects , ** kwargs )
210
-
211
171
def freeze_background (self ):
212
- self .update_frame ()
172
+ self .renderer . update_frame ()
213
173
self .camera = Camera (self .renderer .get_frame ())
214
174
self .clear ()
215
175
@@ -811,7 +771,7 @@ def progress_through_animations(self):
811
771
"""
812
772
for t in self .get_animation_time_progression (self .animations ):
813
773
self .update_animation_to_time (t )
814
- self .update_frame (self .moving_mobjects , self .static_image )
774
+ self .renderer . update_frame (self .moving_mobjects , self .static_image )
815
775
self .add_frame (self .renderer .get_frame ())
816
776
817
777
def update_animation_to_time (self , t ):
@@ -919,7 +879,7 @@ def play_internal(self, *args, **kwargs):
919
879
# Paint all non-moving objects onto the screen, so they don't
920
880
# have to be rendered every frame
921
881
self .moving_mobjects = self .get_moving_mobjects (* self .animations )
922
- self .update_frame (excluded_mobjects = self .moving_mobjects )
882
+ self .renderer . update_frame (excluded_mobjects = self .moving_mobjects )
923
883
self .static_image = self .renderer .get_frame ()
924
884
self .last_t = 0
925
885
self .run_time = self .get_run_time (self .animations )
@@ -941,7 +901,7 @@ def wait_internal(self, duration=DEFAULT_WAIT_TIME, stop_condition=None):
941
901
# the same way Scene.play does
942
902
for t in time_progression :
943
903
self .update_animation_to_time (t )
944
- self .update_frame ()
904
+ self .renderer . update_frame ()
945
905
self .add_frame (self .renderer .get_frame ())
946
906
if stop_condition is not None and stop_condition ():
947
907
time_progression .close ()
@@ -950,7 +910,7 @@ def wait_internal(self, duration=DEFAULT_WAIT_TIME, stop_condition=None):
950
910
# Do nothing
951
911
return self
952
912
else :
953
- self .update_frame ()
913
+ self .renderer . update_frame ()
954
914
dt = 1 / self .camera .frame_rate
955
915
self .add_frame (self .renderer .get_frame (), num_frames = int (duration / dt ))
956
916
return self
@@ -1116,7 +1076,7 @@ def show_frame(self):
1116
1076
Opens the current frame in the Default Image Viewer
1117
1077
of your system.
1118
1078
"""
1119
- self .update_frame (ignore_skipping = True )
1079
+ self .renderer . update_frame (ignore_skipping = True )
1120
1080
self .camera .get_image ().show ()
1121
1081
1122
1082
0 commit comments