mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
add ParallelEndTogether
This commit is contained in:
parent
ffbdb15d47
commit
ea208dfdbf
@ -141,12 +141,26 @@ class MetaInterval(CMetaInterval):
|
||||
|
||||
def addParallel(self, list, name, relTime, relTo, duration):
|
||||
# Adds the given list of intervals to the MetaInterval to be
|
||||
# played simultaneously.
|
||||
# played simultaneously; all will start at the same time.
|
||||
self.pushLevel(name, relTime, relTo)
|
||||
for ival in list:
|
||||
self.addInterval(ival, 0.0, TRACK_START)
|
||||
self.popLevel(duration)
|
||||
|
||||
def addParallelEndTogether(self, list, name, relTime, relTo, duration):
|
||||
# Adds the given list of intervals to the MetaInterval to be
|
||||
# played simultaneously; all will end at the same time, but
|
||||
# the longest interval will be started first to achieve this.
|
||||
|
||||
maxDuration = 0
|
||||
for ival in list:
|
||||
maxDuration = max(maxDuration, ival.getDuration())
|
||||
|
||||
self.pushLevel(name, relTime, relTo)
|
||||
for ival in list:
|
||||
self.addInterval(ival, maxDuration - ival.getDuration(), TRACK_START)
|
||||
self.popLevel(duration)
|
||||
|
||||
def addTrack(self, list, name, relTime, relTo, duration):
|
||||
# Adds a "track list". This is a list of tuples of the form:
|
||||
#
|
||||
@ -422,6 +436,11 @@ class Parallel(MetaInterval):
|
||||
meta.addParallel(self.ivals, self.getName(),
|
||||
relTime, relTo, self.phonyDuration)
|
||||
|
||||
class ParallelEndTogether(MetaInterval):
|
||||
def applyIvals(self, meta, relTime, relTo):
|
||||
meta.addParallelEndTogether(self.ivals, self.getName(),
|
||||
relTime, relTo, self.phonyDuration)
|
||||
|
||||
class Track(MetaInterval):
|
||||
def applyIvals(self, meta, relTime, relTo):
|
||||
meta.addTrack(self.ivals, self.getName(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user