diff --git a/.gitignore b/.gitignore index 743924f1..961fd7cb 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,7 @@ special_animations.py prettiness_hall_of_fame.py files/ ben_playground.py - ben_cairo_test.py - -.idea/manim.iml - *.xml +*.iml + diff --git a/animation/transform.py b/animation/transform.py index 799b776f..30d7c7d2 100644 --- a/animation/transform.py +++ b/animation/transform.py @@ -22,8 +22,9 @@ class Transform(Animation): #Copy target_mobject so as to not mess with caller self.original_target_mobject = target_mobject target_mobject = target_mobject.copy() - digest_config(self, kwargs, locals()) mobject.align_data(target_mobject) + self.target_mobject = target_mobject + digest_config(self, kwargs) self.init_path_func() Animation.__init__(self, mobject, **kwargs) @@ -40,7 +41,7 @@ class Transform(Animation): def init_path_func(self): if self.path_func is not None: return - if self.path_arc == 0: + elif self.path_arc == 0: self.path_func = straight_path else: self.path_func = path_along_arc( diff --git a/helpers.py b/helpers.py index a01ced7a..8e1af238 100644 --- a/helpers.py +++ b/helpers.py @@ -670,3 +670,10 @@ class DictAsObject(object): # Just to have a less heavyweight name for this extremely common operation def fdiv(a, b): return np.true_divide(a,b) + +# For debugging purposes + +def print_mobject_family(mob, n_tabs = 0): + print "\t"*n_tabs, mob, id(mob) + for submob in mob.submobjects: + print_mobject_family(submob, n_tabs + 1) diff --git a/mobject/mobject.py b/mobject/mobject.py index d1e77b32..cf01b713 100644 --- a/mobject/mobject.py +++ b/mobject/mobject.py @@ -771,10 +771,10 @@ class Mobject(Container): self.null_point_align(mobject) self_count = len(self.submobjects) mob_count = len(mobject.submobjects) - diff = abs(self_count-mob_count) - if self_count < mob_count: - self.add_n_more_submobjects(diff) - elif mob_count < self_count: + diff = self_count-mob_count + if diff < 0: + self.add_n_more_submobjects(-diff) + elif diff > 0: mobject.add_n_more_submobjects(diff) return self diff --git a/mobject/vectorized_mobject.py b/mobject/vectorized_mobject.py index 5377eb44..fbf055b0 100644 --- a/mobject/vectorized_mobject.py +++ b/mobject/vectorized_mobject.py @@ -42,7 +42,8 @@ class VMobject(Mobject): stroke_width = None, fill_color = None, fill_opacity = None, - family = True): + family = True + ): if stroke_color is not None: self.stroke_rgb = color_to_rgb(stroke_color) if fill_color is not None: diff --git a/topics/geometry.py b/topics/geometry.py index 2312e74b..8e3f910b 100644 --- a/topics/geometry.py +++ b/topics/geometry.py @@ -356,7 +356,7 @@ class Line(VMobject): def insert_n_anchor_points(self, n): if not self.path_arc: n_anchors = self.get_num_anchor_points() - new_num_points = 3*(n_anchors + n)+1 + new_num_points = 3*(n_anchors + n)-2 self.points = np.array([ self.point_from_proportion(alpha) for alpha in np.linspace(0, 1, new_num_points)