mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 13:34:19 +08:00
Conglomeration of changes for eoc7
This commit is contained in:
@ -122,9 +122,18 @@ class Animation(object):
|
||||
self.update(1)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def sync_animation_run_times_and_rate_funcs(*animations, **kwargs):
|
||||
for animation in animations:
|
||||
animation.update_config(**kwargs)
|
||||
max_run_time = max([a.run_time for a in animations])
|
||||
for animation in animations:
|
||||
if animation.run_time != max_run_time:
|
||||
new_rate_func = squish_rate_func(
|
||||
animation.get_rate_func(),
|
||||
0, float(animation.run_time)/max_run_time
|
||||
)
|
||||
animation.set_rate_func(new_rate_func)
|
||||
animation.set_run_time(max_run_time)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user