mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
ShowCreation works with submobjects
This commit is contained in:
parent
59910f9802
commit
2e756d468a
1 changed files with 10 additions and 5 deletions
|
@ -51,11 +51,16 @@ class ShimmerIn(DelayByOrder):
|
||||||
|
|
||||||
class ShowCreation(Animation):
|
class ShowCreation(Animation):
|
||||||
def update_mobject(self, alpha):
|
def update_mobject(self, alpha):
|
||||||
new_num_points = int(alpha * self.starting_mobject.get_num_points())
|
pairs = zip(
|
||||||
for attr in self.mobject.get_array_attrs():
|
self.starting_mobject.submobject_family(),
|
||||||
full_array = getattr(self.starting_mobject, attr)
|
self.mobject.submobject_family()
|
||||||
partial_array = full_array[:new_num_points]
|
)
|
||||||
setattr(self.mobject, attr, partial_array)
|
for start, mob in pairs:
|
||||||
|
new_num_points = int(alpha * start.get_num_points())
|
||||||
|
for attr in mob.get_array_attrs():
|
||||||
|
full_array = getattr(start, attr)
|
||||||
|
partial_array = full_array[:new_num_points]
|
||||||
|
setattr(mob, attr, partial_array)
|
||||||
|
|
||||||
|
|
||||||
class Flash(Animation):
|
class Flash(Animation):
|
||||||
|
|
Loading…
Add table
Reference in a new issue