@@ -853,7 +853,8 @@ def handle_caching_play(func):
853
853
**kwargs :
854
854
named parameters affecting what was passed in *args e.g run_time, lag_ratio etc.
855
855
"""
856
- def wrapper (self , * args , ** kwargs ):
856
+ def wrapper (self , * args , ** kwargs ):
857
+ self .revert_to_original_skipping_status ()
857
858
animations = self .compile_play_args_to_animation_list (
858
859
* args , ** kwargs
859
860
)
@@ -886,15 +887,16 @@ def handle_caching_wait(func):
886
887
named parameters affecting what was passed in *args e.g run_time, lag_ratio etc.
887
888
"""
888
889
def wrapper (self , duration = DEFAULT_WAIT_TIME , stop_condition = None ):
890
+ self .revert_to_original_skipping_status ()
889
891
if not file_writer_config ['disable_caching' ]:
890
892
hash_wait = get_hash_from_wait_call (self .__dict__ ['camera' ], duration , stop_condition , self .get_mobjects ())
891
- self .play_hashes_list .append (hash_wait )
893
+ self .play_hashes_list .append (hash_wait )
892
894
if self .file_writer .is_already_cached (hash_wait ):
893
895
logger .info (f'Wait { self .num_plays } : Using cached data (hash : { hash_wait } )' )
894
896
file_writer_config ['skip_animations' ] = True
895
897
else :
896
- hash_play = "uncached_{:05}" .format (self .num_plays )
897
- self .play_hashes_list .append (hash_play )
898
+ hash_wait = "uncached_{:05}" .format (self .num_plays )
899
+ self .play_hashes_list .append (hash_wait )
898
900
self .revert_to_original_skipping_status ()
899
901
func (self , duration , stop_condition )
900
902
return wrapper
@@ -1171,8 +1173,8 @@ def force_skipping(self):
1171
1173
Scene
1172
1174
The Scene, with skipping turned on.
1173
1175
"""
1174
- self .original_skipping_status = self . SKIP_ANIMATIONS
1175
- self . SKIP_ANIMATIONS = True
1176
+ self .original_skipping_status = file_writer_config [ 'skip_animations' ]
1177
+ file_writer_config [ 'skip_animations' ] = True
1176
1178
return self
1177
1179
1178
1180
def revert_to_original_skipping_status (self ):
@@ -1187,7 +1189,7 @@ def revert_to_original_skipping_status(self):
1187
1189
The Scene, with the original skipping status.
1188
1190
"""
1189
1191
if hasattr (self , "original_skipping_status" ):
1190
- self . SKIP_ANIMATIONS = self .original_skipping_status
1192
+ file_writer_config [ 'skip_animations' ] = self .original_skipping_status
1191
1193
return self
1192
1194
1193
1195
def add_frames (self , * frames ):
@@ -1222,7 +1224,7 @@ def add_sound(self, sound_file, time_offset=0, gain=None, **kwargs):
1222
1224
gain :
1223
1225
1224
1226
"""
1225
- if self . SKIP_ANIMATIONS :
1227
+ if file_writer_config [ 'skip_animations' ] :
1226
1228
return
1227
1229
time = self .get_time () + time_offset
1228
1230
self .file_writer .add_sound (sound_file , time , gain , ** kwargs )
0 commit comments