@@ -15,21 +15,21 @@ def handle_caching_play(func):
15
15
The play like function that has to be written to the video file stream. Take the same parameters as `scene.play`.
16
16
"""
17
17
18
- def wrapper (self , * args , ** kwargs ):
18
+ def wrapper (self , scene , * args , ** kwargs ):
19
19
self .revert_to_original_skipping_status ()
20
20
self .update_skipping_status ()
21
- animations = self . scene .compile_play_args_to_animation_list (* args , ** kwargs )
22
- self . scene .add_mobjects_from_animations (animations )
21
+ animations = scene .compile_play_args_to_animation_list (* args , ** kwargs )
22
+ scene .add_mobjects_from_animations (animations )
23
23
if file_writer_config ["skip_animations" ]:
24
24
logger .debug (f"Skipping animation { self .num_plays } " )
25
- func (self , * args , ** kwargs )
25
+ func (self , scene , * args , ** kwargs )
26
26
# If the animation is skipped, we mark its hash as None.
27
27
# When sceneFileWriter will start combining partial movie files, it won't take into account None hashes.
28
28
self .animations_hashes .append (None )
29
29
self .file_writer .add_partial_movie_file (None )
30
30
return
31
31
if not file_writer_config ["disable_caching" ]:
32
- mobjects_on_scene = self . scene .get_mobjects ()
32
+ mobjects_on_scene = scene .get_mobjects ()
33
33
hash_play = get_hash_from_play_call (
34
34
self , self .camera , animations , mobjects_on_scene
35
35
)
@@ -47,7 +47,7 @@ def wrapper(self, *args, **kwargs):
47
47
"List of the first few animation hashes of the scene: %(h)s" ,
48
48
{"h" : str (self .animations_hashes [:5 ])},
49
49
)
50
- func (self , * args , ** kwargs )
50
+ func (self , scene , * args , ** kwargs )
51
51
52
52
return wrapper
53
53
@@ -64,20 +64,20 @@ def handle_caching_wait(func):
64
64
The wait like function that has to be written to the video file stream. Take the same parameters as `scene.wait`.
65
65
"""
66
66
67
- def wrapper (self , duration = DEFAULT_WAIT_TIME , stop_condition = None ):
67
+ def wrapper (self , scene , duration = DEFAULT_WAIT_TIME , stop_condition = None ):
68
68
self .revert_to_original_skipping_status ()
69
69
self .update_skipping_status ()
70
70
if file_writer_config ["skip_animations" ]:
71
71
logger .debug (f"Skipping wait { self .num_plays } " )
72
- func (self , duration , stop_condition )
72
+ func (self , scene , duration , stop_condition )
73
73
# If the animation is skipped, we mark its hash as None.
74
74
# When sceneFileWriter will start combining partial movie files, it won't take into account None hashes.
75
75
self .animations_hashes .append (None )
76
76
self .file_writer .add_partial_movie_file (None )
77
77
return
78
78
if not file_writer_config ["disable_caching" ]:
79
79
hash_wait = get_hash_from_wait_call (
80
- self , self .camera , duration , stop_condition , self . scene .get_mobjects ()
80
+ self , self .camera , duration , stop_condition , scene .get_mobjects ()
81
81
)
82
82
if self .file_writer .is_already_cached (hash_wait ):
83
83
logger .info (
@@ -92,6 +92,6 @@ def wrapper(self, duration=DEFAULT_WAIT_TIME, stop_condition=None):
92
92
"Animations hashes list of the scene : (concatened to 5) %(h)s" ,
93
93
{"h" : str (self .animations_hashes [:5 ])},
94
94
)
95
- func (self , duration , stop_condition )
95
+ func (self , scene , duration , stop_condition )
96
96
97
97
return wrapper
0 commit comments