mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Allow for AnimationGroup to specify that parts belong to a VGroup
This commit is contained in:
parent
3738f0a48e
commit
ef09d6fce2
1 changed files with 3 additions and 2 deletions
|
@ -29,6 +29,7 @@ class AnimationGroup(Animation):
|
||||||
run_time: float = -1, # If negative, default to sum of inputed animation runtimes
|
run_time: float = -1, # If negative, default to sum of inputed animation runtimes
|
||||||
lag_ratio: float = 0.0,
|
lag_ratio: float = 0.0,
|
||||||
group: Mobject | None = None,
|
group: Mobject | None = None,
|
||||||
|
group_type: type = Group,
|
||||||
**kwargs
|
**kwargs
|
||||||
):
|
):
|
||||||
self.animations = [prepare_animation(anim) for anim in animations]
|
self.animations = [prepare_animation(anim) for anim in animations]
|
||||||
|
@ -38,7 +39,7 @@ class AnimationGroup(Animation):
|
||||||
self.lag_ratio = lag_ratio
|
self.lag_ratio = lag_ratio
|
||||||
self.group = group
|
self.group = group
|
||||||
if self.group is None:
|
if self.group is None:
|
||||||
self.group = Group(*remove_list_redundancies(
|
self.group = group_type(*remove_list_redundancies(
|
||||||
[anim.mobject for anim in self.animations]
|
[anim.mobject for anim in self.animations]
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -49,7 +50,7 @@ class AnimationGroup(Animation):
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
def get_all_mobjects(self) -> Group:
|
def get_all_mobjects(self) -> Mobject:
|
||||||
return self.group
|
return self.group
|
||||||
|
|
||||||
def begin(self) -> None:
|
def begin(self) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue