mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Fixed ShowCreation
This commit is contained in:
parent
8405428682
commit
5964d5206a
1 changed files with 8 additions and 10 deletions
|
@ -20,8 +20,8 @@ class Rotating(Animation):
|
||||||
def update_mobject(self, alpha):
|
def update_mobject(self, alpha):
|
||||||
axes = [self.axis] if self.axis is not None else self.axes
|
axes = [self.axis] if self.axis is not None else self.axes
|
||||||
families = [
|
families = [
|
||||||
self.mobject.get_full_submobject_family(),
|
self.mobject.submobject_family(),
|
||||||
self.starting_mobject.get_full_submobject_family()
|
self.starting_mobject.submobject_family()
|
||||||
]
|
]
|
||||||
for mob, start in zip(*families):
|
for mob, start in zip(*families):
|
||||||
mob.points = np.array(start.points)
|
mob.points = np.array(start.points)
|
||||||
|
@ -51,14 +51,12 @@ class ShimmerIn(DelayByOrder):
|
||||||
|
|
||||||
class ShowCreation(Animation):
|
class ShowCreation(Animation):
|
||||||
def update_mobject(self, alpha):
|
def update_mobject(self, alpha):
|
||||||
#TODO, shoudl I make this more efficient?
|
new_num_points = int(alpha * self.starting_mobject.get_num_points())
|
||||||
new_num_points = int(alpha * self.starting_mobject.points.shape[0])
|
for attr in self.mobject.get_array_attrs():
|
||||||
for attr in ["points", "rgbs"]:
|
full_array = getattr(self.starting_mobject, attr)
|
||||||
setattr(
|
partial_array = full_array[:new_num_points]
|
||||||
self.mobject,
|
setattr(self.mobject, attr, partial_array)
|
||||||
attr,
|
|
||||||
getattr(self.starting_mobject, attr)[:new_num_points, :]
|
|
||||||
)
|
|
||||||
|
|
||||||
class Flash(Animation):
|
class Flash(Animation):
|
||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue