mirror of
https://github.com/3b1b/manim.git
synced 2025-07-30 21:44:19 +08:00
Pre-matrix rewrite of chapter 11
This commit is contained in:
@ -68,7 +68,7 @@ class Write(ShowCreation):
|
||||
if "run_time" not in kwargs:
|
||||
self.establish_run_time(mobject)
|
||||
if "lag_factor" not in kwargs:
|
||||
self.lag_factor = max(self.run_time - 1, 1)
|
||||
self.lag_factor = max(self.run_time - 1, 2)
|
||||
ShowCreation.__init__(self, mobject, **kwargs)
|
||||
|
||||
def establish_run_time(self, mobject):
|
||||
|
1149
eola/chapter11.py
1149
eola/chapter11.py
File diff suppressed because it is too large
Load Diff
@ -83,7 +83,7 @@ class Matrix(VMobject):
|
||||
return np.array([
|
||||
map(TexMobject, row)
|
||||
for row in matrix
|
||||
])
|
||||
]).reshape(matrix.shape)
|
||||
|
||||
def organize_mob_matrix(self, matrix):
|
||||
for i, row in enumerate(matrix):
|
||||
|
@ -497,6 +497,9 @@ class Mobject(object):
|
||||
def __iter__(self):
|
||||
return iter(self.split())
|
||||
|
||||
def __len__(self):
|
||||
return len(self.split())
|
||||
|
||||
def split(self):
|
||||
result = [self] if len(self.points) > 0 else []
|
||||
return result + self.submobjects
|
||||
|
@ -364,7 +364,7 @@ class TeacherStudentsScene(Scene):
|
||||
**bubble_kwargs):
|
||||
if all(map(lambda s : isinstance(s, str), content)):
|
||||
content = TextMobject(*content)
|
||||
elif len(content) == 1 and isinstance(content[0], TexMobject):
|
||||
elif len(content) == 1 and isinstance(content[0], Mobject):
|
||||
content = content[0]
|
||||
else:
|
||||
raise Exception("Invalid content type")
|
||||
@ -379,7 +379,7 @@ class TeacherStudentsScene(Scene):
|
||||
pi_creature_target_mode = "pondering"
|
||||
|
||||
for p in self.get_everyone():
|
||||
if p.bubble and p is not pi_creature:
|
||||
if (p.bubble is not None) and (p is not pi_creature):
|
||||
added_anims += [
|
||||
FadeOut(p.bubble),
|
||||
FadeOut(p.bubble.content)
|
||||
|
Reference in New Issue
Block a user