Panda3D Manual: Sequences and Parallels
<<prev | top | next>> |
You will need to have this include statement to use Sequences and Parallels.
from direct.interval.IntervalGlobal import *
Sequences and Parallels can control when intervals are played. Sequences play intervals one after the other, effectively a “do in order” command. Parallels are a “do together,” playing all intervals at the same time. Both have simple formats, and every kind of interval may be used.
mySequence = Sequence(<Interval>,…,<Interval>, name = "Sequence Name") myParallel = Parallel(<Interval>,…,<Interval>, name = "Parallel Name")
Sequences and Parallels may also be combined for even greater control. Also, there is a wait interval that can add a delay to Sequences. While it can be defined beforehand, it does not have to be.
delay = Wait(2.5) pandaWalkSeq = Sequence(Parallel(pandaWalk,pandaWalkAnim),delay, Parallel(pandaWalkBack,pandaWalkAnim), Wait(1.0))
In the above example, a wait interval is generated. After that, a Sequence is made that uses a Parallel, the defined wait interval, another Parallel, and a wait interval generated in the Sequence. Such Sequences can get very long very quick, so it may be prudent to define the internal Parallels and Sequences before creating the master Sequence.
<<prev | top | next>> |