def construct(self): # play the first animations... # you don't need a section in the very beginning as it gets created automatically self.next_section() # play more animations... self.next_section("this is an optional name that doesn't have to be unique") # play even more animations... self.next_section("this is a section without any animations, it will be removed")
def construct(self): self.next_section() # this section doesn't have any animations and will be removed # but no error will be thrown # feel free to tend your flock of empty sections if you so desire self.add(Circle()) self.next_section()
解决此问题的一种方法是等待一会:
1 2 3 4 5 6 7
def construct(self): self.next_section() self.add(Circle()) # now we wait 1sec and have an animation to satisfy the section self.wait() self.next_section()
def construct(self): self.next_section(skip_animations=True) # play some animations that shall be skipped... self.next_section() # play some animations that won't get skipped...
常用的命令行标志
执行命令时
1 2
manim -pql scene.py SquareToCircle
必须指定要渲染的类 Scene。这是因为一个文件可以包含多个类 Scene。如果文件包含多个类 Scene,并且要全部渲染它们,则可以使用 -a 标志。