I exercise examples here
From SuccessionExample1 on, as long as there exists:
Succession(Animation, Mobject(),...
There will be error like below:
AttributeError: type object 'Animation' has no attribute 'mobject'
I checked the animation.py and found self.mobject = mobject, that is, the Animation class has mobject attribute, are those samples obselete? or other causes?
This is because that is the code for old versions (I use the February 3 version in my tutorials), I forgot to tell you in your previous question to render only the Update functions, not those of Successions. To use the Successions, the code format must be changed, this is the code for the recent version.
In case of SuccessionExample1:
class SuccessionExample1(Scene):
def construct(self):
number_line=NumberLine(x_min=-2,x_max=2)
text=TextMobject("Text")\
.next_to(number_line,DOWN)
dashed_line=DashedLine(
number_line.get_left(),
number_line.get_right(),
color=YELLOW,
).set_stroke(width=11)
self.add(number_line)
self.wait(0.3)
self.play(
LaggedStart(
*[ShowCreationThenDestruction(dashed_segment)
for dashed_segment in dashed_line],
run_time=5
),
AnimationGroup(
Animation(Mobject(),run_time=2.1),
Write(text),lag_ratio=1
)
)
self.wait()