From 6ff673516693ed2a4b136c750b4091d6b5aeacea Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Tue, 8 Mar 2005 21:43:17 +0000 Subject: [PATCH] Added ability to adjust duration --- direct/src/interval/MopathInterval.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/direct/src/interval/MopathInterval.py b/direct/src/interval/MopathInterval.py index f899b968ba..37e4d5c025 100644 --- a/direct/src/interval/MopathInterval.py +++ b/direct/src/interval/MopathInterval.py @@ -13,18 +13,21 @@ class MopathInterval(LerpInterval.LerpFunctionInterval): notify = directNotify.newCategory('MopathInterval') # Class methods def __init__(self, mopath, node, fromT = 0, toT = None, - blendType = 'noBlend', name = None): + duration = None, blendType = 'noBlend', name = None): if toT == None: toT = mopath.getMaxT() + + if duration == None: + duration = abs(toT - fromT) # Generate unique name if necessary if (name == None): name = 'Mopath-%d' % MopathInterval.mopathNum - MopathInterval.mopathNum += 1 + MopathInterval.mopathNum += 1 LerpInterval.LerpFunctionInterval.__init__( self, self.__doMopath, fromData = fromT, toData = toT, - duration = abs(toT - fromT), blendType = blendType, + duration = duration, blendType = blendType, name = name) self.mopath = mopath