mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Added ability to adjust duration
This commit is contained in:
parent
3788d6feb8
commit
6ff6735166
@ -13,18 +13,21 @@ class MopathInterval(LerpInterval.LerpFunctionInterval):
|
|||||||
notify = directNotify.newCategory('MopathInterval')
|
notify = directNotify.newCategory('MopathInterval')
|
||||||
# Class methods
|
# Class methods
|
||||||
def __init__(self, mopath, node, fromT = 0, toT = None,
|
def __init__(self, mopath, node, fromT = 0, toT = None,
|
||||||
blendType = 'noBlend', name = None):
|
duration = None, blendType = 'noBlend', name = None):
|
||||||
if toT == None:
|
if toT == None:
|
||||||
toT = mopath.getMaxT()
|
toT = mopath.getMaxT()
|
||||||
|
|
||||||
|
if duration == None:
|
||||||
|
duration = abs(toT - fromT)
|
||||||
|
|
||||||
# Generate unique name if necessary
|
# Generate unique name if necessary
|
||||||
if (name == None):
|
if (name == None):
|
||||||
name = 'Mopath-%d' % MopathInterval.mopathNum
|
name = 'Mopath-%d' % MopathInterval.mopathNum
|
||||||
MopathInterval.mopathNum += 1
|
MopathInterval.mopathNum += 1
|
||||||
|
|
||||||
LerpInterval.LerpFunctionInterval.__init__(
|
LerpInterval.LerpFunctionInterval.__init__(
|
||||||
self, self.__doMopath, fromData = fromT, toData = toT,
|
self, self.__doMopath, fromData = fromT, toData = toT,
|
||||||
duration = abs(toT - fromT), blendType = blendType,
|
duration = duration, blendType = blendType,
|
||||||
name = name)
|
name = name)
|
||||||
|
|
||||||
self.mopath = mopath
|
self.mopath = mopath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user