From ba2f68815c8d41f2039471ac1999d325c2846dbc Mon Sep 17 00:00:00 2001 From: Mike Goslin Date: Wed, 11 Apr 2001 19:15:34 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/extensions/NodePath-extensions.py | 3 ++- direct/src/interval/Interval.py | 3 +++ direct/src/interval/LerpInterval.py | 20 +++++++++++++++----- direct/src/interval/MultiTrack.py | 3 +++ direct/src/interval/Track.py | 3 +++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/direct/src/extensions/NodePath-extensions.py b/direct/src/extensions/NodePath-extensions.py index afe46072a4..d043975aba 100644 --- a/direct/src/extensions/NodePath-extensions.py +++ b/direct/src/extensions/NodePath-extensions.py @@ -283,6 +283,7 @@ if (task.lerp.isDone()): # Reset the init flag, in case the task gets re-used task.init = 1 + del task.functorFunc return(Task.done) else: return(Task.cont) @@ -506,7 +507,7 @@ else: # bad number off args raise Exception("Error: NodePath.lerpPos: bad number of args") - + def lerpPosXYZ(self, x, y, z, time, other=None, blendType="noBlend", auto=None, task=None): """lerpPosXYZ(self, float, float, float, float, string="noBlend", diff --git a/direct/src/interval/Interval.py b/direct/src/interval/Interval.py index 4d895b95b0..709281f20a 100644 --- a/direct/src/interval/Interval.py +++ b/direct/src/interval/Interval.py @@ -29,6 +29,9 @@ class Interval(DirectObject): # Set true if interval responds to setT(t): t>duration self.fOpenEnded = openEnded + def __del__(self): + print 'Interval destructing' + def getName(self): """ getName() """ diff --git a/direct/src/interval/LerpInterval.py b/direct/src/interval/LerpInterval.py index 80468fbb96..9b81a97c0f 100644 --- a/direct/src/interval/LerpInterval.py +++ b/direct/src/interval/LerpInterval.py @@ -15,6 +15,10 @@ class LerpInterval(Interval): self.blendType = self.getBlend(blendType) # Initialize superclass Interval.__init__(self, name, duration) + + def __del__(self): + print 'LerpInterval destructing' + def updateFunc(self, t, event = IVAL_NONE): """ updateFunc(t, event) """ @@ -25,6 +29,7 @@ class LerpInterval(Interval): # Evaluate the lerp if its been created if self.lerp: self.lerp.setT(t) + def getBlend(self, blendType): """__getBlend(self, string) Return the C++ blend class corresponding to blendType string @@ -50,7 +55,7 @@ class LerpPosInterval(LerpInterval): other=None, blendType='noBlend', name=None): """ __init__(node, duration, pos, startPos, other, blendType, name) """ - def functorFunc(self=self, node=node, pos=pos, startPos=startPos, + def functorFunc(node=node, pos=pos, startPos=startPos, other=other): import PosLerpFunctor assert(not node.isEmpty()) @@ -66,6 +71,7 @@ class LerpPosInterval(LerpInterval): functor = PosLerpFunctor.PosLerpFunctor( node, startPos, pos) return functor + # Generate unique name if necessary if (name == None): name = 'LerpPosInterval-%d' % LerpPosInterval.lerpPosNum @@ -81,7 +87,7 @@ class LerpHprInterval(LerpInterval): other=None, blendType='noBlend', name=None): """ __init__(node, duration, hpr, startHpr, other, blendType, name) """ - def functorFunc(self=self, node=node, hpr=hpr, startHpr=startHpr, + def functorFunc(node=node, hpr=hpr, startHpr=startHpr, other=other): import HprLerpFunctor @@ -98,6 +104,7 @@ class LerpHprInterval(LerpInterval): functor = HprLerpFunctor.HprLerpFunctor( node, startHpr, hpr) return functor + # Generate unique name if necessary if (name == None): name = 'LerpHprInterval-%d' % LerpHprInterval.lerpHprNum @@ -114,7 +121,7 @@ class LerpScaleInterval(LerpInterval): other=None, blendType='noBlend', name=None): """ __init__(node, duration, scale, startScale, other, blendType, name) """ - def functorFunc(self=self, node=node, scale=scale, + def functorFunc(node=node, scale=scale, startScale=startScale, other=other): import ScaleLerpFunctor @@ -149,7 +156,7 @@ class LerpPosHprInterval(LerpInterval): """ __init__(node, duration, pos, hpr, startPos, startHpr, other, blendType, name) """ - def functorFunc(self=self, node=node, pos=pos, hpr=hpr, + def functorFunc(node=node, pos=pos, hpr=hpr, startPos=startPos, startHpr=startHpr, other=other): import PosHprLerpFunctor @@ -180,6 +187,9 @@ class LerpPosHprInterval(LerpInterval): # Initialize superclass LerpInterval.__init__(self, name, duration, functorFunc, blendType) + def __del__(self): + print 'LerpPosHprInterval destructing' + class LerpPosHprScaleInterval(LerpInterval): # Interval counter lerpPosHprScaleNum = 1 @@ -191,7 +201,7 @@ class LerpPosHprScaleInterval(LerpInterval): startPos, startHpr, startScale, other, blendType, name) """ - def functorFunc(self=self, node=node, pos=pos, hpr=hpr, scale=scale, + def functorFunc(node=node, pos=pos, hpr=hpr, scale=scale, startPos=startPos, startHpr=startHpr, startScale=startScale, other=other): import PosHprScaleLerpFunctor diff --git a/direct/src/interval/MultiTrack.py b/direct/src/interval/MultiTrack.py index 8b99c788f4..478e694a6a 100644 --- a/direct/src/interval/MultiTrack.py +++ b/direct/src/interval/MultiTrack.py @@ -19,6 +19,9 @@ class MultiTrack(Interval): duration = self.__computeDuration() # Initialize superclass Interval.__init__(self, name, duration) + + def __del__(self): + print 'MultiTrack destructing' # Access track at given index def __getitem__(self, item): diff --git a/direct/src/interval/Track.py b/direct/src/interval/Track.py index 217aa45115..1fc44d8070 100644 --- a/direct/src/interval/Track.py +++ b/direct/src/interval/Track.py @@ -32,6 +32,9 @@ class Track(Interval): # Initialize superclass Interval.__init__(self, name, duration) + def __del__(self): + print 'Track destructing' + # Access interval at given index def __getitem__(self, item): return self.ilist[item]