Browse Source

replace old NodePath.lerp* calls with NodePath.*Interval equivalents

David Rose 14 years ago
parent
commit
1fc2e4b35d

+ 109 - 84
direct/src/directtools/DirectCameraControl.py

@@ -36,6 +36,8 @@ class DirectCameraControl(DirectObject):
         self.coaMarkerRef = base.direct.group.attachNewNode('coaMarkerRef')
         self.coaMarkerRef = base.direct.group.attachNewNode('coaMarkerRef')
         self.camManipRef = base.direct.group.attachNewNode('camManipRef')
         self.camManipRef = base.direct.group.attachNewNode('camManipRef')
         self.switchDirBelowZero = True
         self.switchDirBelowZero = True
+        self.manipulateCameraTask = None
+        self.manipulateCameraInterval = None
 
 
         t = CAM_MOVE_DURATION
         t = CAM_MOVE_DURATION
         self.actionEvents = [
         self.actionEvents = [
@@ -135,9 +137,29 @@ class DirectCameraControl(DirectObject):
             else:
             else:
                 # Start manipulation
                 # Start manipulation
                 self.spawnHPanYZoom()
                 self.spawnHPanYZoom()
+
+    def __stopManipulateCamera(self):
+        if self.manipulateCameraTask:
+            taskMgr.remove(self.manipulateCameraTask)
+            self.manipulateCameraTask = None
+            
+        if self.manipulateCameraInterval:
+            self.manipulateCameraInterval.finish()
+            self.manipulateCameraInterval = None
+
+    def __startManipulateCamera(self, func = None, task = None, ival = None):
+        self.__stopManipulateCamera()
+        if func:
+            assert(task is None)
+            task = Task.Task(func)
+        if task:
+            self.manipulateCameraTask = taskMgr.add(task, 'manipulateCamera')
+        if ival:
+            ival.start()
+            self.manipulateCameraInterval = ival
             
             
     def mouseDollyStop(self):
     def mouseDollyStop(self):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
 
 
     def mouseFlyStart(self, modifiers):
     def mouseFlyStart(self, modifiers):
         # Record undo point
         # Record undo point
@@ -180,7 +202,7 @@ class DirectCameraControl(DirectObject):
             self.altDown = 0
             self.altDown = 0
 
 
     def mouseFlyStop(self):
     def mouseFlyStop(self):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         stopT = globalClock.getFrameTime()
         stopT = globalClock.getFrameTime()
         deltaT = stopT - self.startT
         deltaT = stopT - self.startT
         stopF = globalClock.getFrameCount()
         stopF = globalClock.getFrameCount()
@@ -221,52 +243,51 @@ class DirectCameraControl(DirectObject):
 
 
     def spawnXZTranslateOrHPanYZoom(self):
     def spawnXZTranslateOrHPanYZoom(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn the new task
         # Spawn the new task
         t = Task.Task(self.XZTranslateOrHPanYZoomTask)
         t = Task.Task(self.XZTranslateOrHPanYZoomTask)
         # For HPanYZoom
         # For HPanYZoom
         t.zoomSF = Vec3(self.coaMarker.getPos(base.direct.camera)).length()
         t.zoomSF = Vec3(self.coaMarker.getPos(base.direct.camera)).length()
-        taskMgr.add(t, 'manipulateCamera')
+        self.__startManipulateCamera(task = t)
 
 
     def spawnXZTranslateOrHPPan(self):
     def spawnXZTranslateOrHPPan(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
-        taskMgr.add(self.XZTranslateOrHPPanTask,
-                    'manipulateCamera')
+        self.__startManipulateCamera(func = self.XZTranslateOrHPPanTask)
 
 
     def spawnXZTranslate(self):
     def spawnXZTranslate(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
-        taskMgr.add(self.XZTranslateTask, 'manipulateCamera')
+        self.__startManipulateCamera(func = self.XZTranslateTask)
 
 
     def spawnOrthoTranslate(self):
     def spawnOrthoTranslate(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
-        taskMgr.add(self.OrthoTranslateTask, 'manipulateCamera')
+        self.__startManipulateCamera(func = self.OrthoTranslateTask)
 
 
     def spawnHPanYZoom(self):
     def spawnHPanYZoom(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
         t = Task.Task(self.HPanYZoomTask)
         t = Task.Task(self.HPanYZoomTask)
         t.zoomSF = Vec3(self.coaMarker.getPos(base.direct.camera)).length()
         t.zoomSF = Vec3(self.coaMarker.getPos(base.direct.camera)).length()
-        taskMgr.add(t, 'manipulateCamera')
+        self.__startManipulateCamera(task = t)
 
 
     def spawnOrthoZoom(self):
     def spawnOrthoZoom(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
         t = Task.Task(self.OrthoZoomTask)
         t = Task.Task(self.OrthoZoomTask)
-        taskMgr.add(t, 'manipulateCamera')        
+        self.__startManipulateCamera(task = t)        
 
 
     def spawnHPPan(self):
     def spawnHPPan(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Spawn new task
         # Spawn new task
-        taskMgr.add(self.HPPanTask, 'manipulateCamera')
+        self.__startManipulateCamera(func = self.HPPanTask)
 
 
     def XZTranslateOrHPanYZoomTask(self, state):
     def XZTranslateOrHPanYZoomTask(self, state):
         if base.direct.fShift:
         if base.direct.fShift:
@@ -373,7 +394,7 @@ class DirectCameraControl(DirectObject):
 
 
     def spawnMouseRotateTask(self):
     def spawnMouseRotateTask(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         if self.perspCollPlane:
         if self.perspCollPlane:
             iRay = SelectionRay(base.direct.camera)
             iRay = SelectionRay(base.direct.camera)
             iRay.collider.setFromLens(base.direct.camNode, 0.0, 0.0)
             iRay.collider.setFromLens(base.direct.camNode, 0.0, 0.0)
@@ -406,7 +427,7 @@ class DirectCameraControl(DirectObject):
             t.constrainedDir = 'y'
             t.constrainedDir = 'y'
         else:
         else:
             t.constrainedDir = 'x'
             t.constrainedDir = 'x'
-        taskMgr.add(t, 'manipulateCamera')
+        self.__startManipulateCamera(task = t)
 
 
     def mouseRotateTask(self, state):
     def mouseRotateTask(self, state):
         # If the cam is orthogonal, don't rotate.
         # If the cam is orthogonal, don't rotate.
@@ -453,7 +474,7 @@ class DirectCameraControl(DirectObject):
 
 
     def spawnMouseRollTask(self):
     def spawnMouseRollTask(self):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Set at markers position in render coordinates
         # Set at markers position in render coordinates
         self.camManipRef.setPos(self.coaMarkerPos)
         self.camManipRef.setPos(self.coaMarkerPos)
         self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
         self.camManipRef.setHpr(base.direct.camera, ZERO_POINT)
@@ -462,7 +483,7 @@ class DirectCameraControl(DirectObject):
         t.lastAngle = getCrankAngle(t.coaCenter)
         t.lastAngle = getCrankAngle(t.coaCenter)
         # Store the camera/manipRef offset transform
         # Store the camera/manipRef offset transform
         t.wrt = base.direct.camera.getTransform(self.camManipRef)
         t.wrt = base.direct.camera.getTransform(self.camManipRef)
-        taskMgr.add(t, 'manipulateCamera')
+        self.__startManipulateCamera(task = t)
 
 
     def mouseRollTask(self, state):
     def mouseRollTask(self, state):
         wrt = state.wrt
         wrt = state.wrt
@@ -567,7 +588,7 @@ class DirectCameraControl(DirectObject):
         # Record marker pos in render space
         # Record marker pos in render space
         self.coaMarkerPos.assign(self.coaMarker.getPos())
         self.coaMarkerPos.assign(self.coaMarker.getPos())
 
 
-    def updateCoaMarkerSizeOnDeath(self, state):
+    def updateCoaMarkerSizeOnDeath(self):
         # Needed because tasks pass in state as first arg
         # Needed because tasks pass in state as first arg
         self.updateCoaMarkerSize()
         self.updateCoaMarkerSize()
 
 
@@ -601,19 +622,20 @@ class DirectCameraControl(DirectObject):
         self.updateCoaMarkerSize()
         self.updateCoaMarkerSize()
 
 
     def uprightCam(self):
     def uprightCam(self):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Pitch camera till upright
         # Pitch camera till upright
         currH = base.direct.camera.getH()
         currH = base.direct.camera.getH()
-        base.direct.camera.lerpHpr(currH, 0, 0,
-                              CAM_MOVE_DURATION,
-                              other = render,
-                              blendType = 'easeInOut',
-                              task = 'manipulateCamera')
+        ival = base.direct.camera.hprInterval(CAM_MOVE_DURATION,
+                                              (currH, 0, 0),
+                                              other = render,
+                                              blendType = 'easeInOut',
+                                              name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
 
 
     def orbitUprightCam(self):
     def orbitUprightCam(self):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Transform camera z axis to render space
         # Transform camera z axis to render space
@@ -642,14 +664,13 @@ class DirectCameraControl(DirectObject):
         parent = base.direct.camera.getParent()
         parent = base.direct.camera.getParent()
         base.direct.camera.wrtReparentTo(self.camManipRef)
         base.direct.camera.wrtReparentTo(self.camManipRef)
         # Rotate ref CS to final orientation
         # Rotate ref CS to final orientation
-        t = self.camManipRef.lerpHpr(rotAngle, orbitAngle, 0,
-                                     CAM_MOVE_DURATION,
-                                     other = render,
-                                     blendType = 'easeInOut',
-                                     task = 'manipulateCamera')
-        # Upon death, reparent Cam to parent
-        t.parent = parent
-        t.setUponDeath(self.reparentCam)
+        ival = self.camManipRef.hprInterval(CAM_MOVE_DURATION,
+                                            (rotAngle, orbitAngle, 0),
+                                            other = render,
+                                            blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.reparentCam, parent),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
 
 
     def centerCam(self):
     def centerCam(self):
         self.centerCamIn(1.0)
         self.centerCamIn(1.0)
@@ -658,7 +679,7 @@ class DirectCameraControl(DirectObject):
         self.centerCamIn(0.)
         self.centerCamIn(0.)
 
 
     def centerCamIn(self, t):
     def centerCamIn(self, t):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Determine marker location
         # Determine marker location
@@ -667,15 +688,17 @@ class DirectCameraControl(DirectObject):
         scaledCenterVec = Y_AXIS * dist
         scaledCenterVec = Y_AXIS * dist
         delta = markerToCam - scaledCenterVec
         delta = markerToCam - scaledCenterVec
         self.camManipRef.setPosHpr(base.direct.camera, Point3(0), Point3(0))
         self.camManipRef.setPosHpr(base.direct.camera, Point3(0), Point3(0))
-        t = base.direct.camera.lerpPos(Point3(delta),
-                                  CAM_MOVE_DURATION,
-                                  other = self.camManipRef,
-                                  blendType = 'easeInOut',
-                                  task = 'manipulateCamera')
-        t.setUponDeath(self.updateCoaMarkerSizeOnDeath)
+        ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
+                                              Point3(delta),
+                                              other = self.camManipRef,
+                                              blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
+
 
 
     def zoomCam(self, zoomFactor, t):
     def zoomCam(self, zoomFactor, t):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Find a point zoom factor times the current separation
         # Find a point zoom factor times the current separation
@@ -684,16 +707,17 @@ class DirectCameraControl(DirectObject):
         # Put a target nodePath there
         # Put a target nodePath there
         self.camManipRef.setPos(base.direct.camera, zoomPtToCam)
         self.camManipRef.setPos(base.direct.camera, zoomPtToCam)
         # Move to that point
         # Move to that point
-        t = base.direct.camera.lerpPos(ZERO_POINT,
-                                  CAM_MOVE_DURATION,
-                                  other = self.camManipRef,
-                                  blendType = 'easeInOut',
-                                  task = 'manipulateCamera')
-        t.setUponDeath(self.updateCoaMarkerSizeOnDeath)
+        ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
+                                              ZERO_POINT,
+                                              other = self.camManipRef,
+                                              blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
 
 
     def spawnMoveToView(self, view):
     def spawnMoveToView(self, view):
         # Kill any existing tasks
         # Kill any existing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
         # Calc hprOffset
         # Calc hprOffset
@@ -733,18 +757,19 @@ class DirectCameraControl(DirectObject):
                                    ZERO_VEC)
                                    ZERO_VEC)
         # Record view for next time around
         # Record view for next time around
         self.lastView = view
         self.lastView = view
-        t = base.direct.camera.lerpPosHpr(ZERO_POINT,
-                                     VBase3(0, 0, self.orthoViewRoll),
-                                     CAM_MOVE_DURATION,
-                                     other = self.camManipRef,
-                                     blendType = 'easeInOut',
-                                     task = 'manipulateCamera')
-        t.setUponDeath(self.updateCoaMarkerSizeOnDeath)
+        ival = base.direct.camera.posHprInterval(CAM_MOVE_DURATION,
+                                                 pos = ZERO_POINT,
+                                                 hpr = VBase3(0, 0, self.orthoViewRoll),
+                                                 other = self.camManipRef,
+                                                 blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.updateCoaMarkerSizeOnDeath),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
 
 
 
 
     def swingCamAboutWidget(self, degrees, t):
     def swingCamAboutWidget(self, degrees, t):
         # Remove existing camera manipulation task
         # Remove existing camera manipulation task
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
 
 
         # Record undo point
         # Record undo point
         base.direct.pushUndo([base.direct.camera])
         base.direct.pushUndo([base.direct.camera])
@@ -757,22 +782,21 @@ class DirectCameraControl(DirectObject):
         parent = base.direct.camera.getParent()
         parent = base.direct.camera.getParent()
         base.direct.camera.wrtReparentTo(self.camManipRef)
         base.direct.camera.wrtReparentTo(self.camManipRef)
 
 
-        manipTask = self.camManipRef.lerpHpr(VBase3(degrees, 0, 0),
-                                             CAM_MOVE_DURATION,
-                                             blendType = 'easeInOut',
-                                             task = 'manipulateCamera')
-        # Upon death, reparent Cam to parent
-        manipTask.parent = parent
-        manipTask.setUponDeath(self.reparentCam)
+        ival = self.camManipRef.hprInterval(CAM_MOVE_DURATION,
+                                            VBase3(degrees, 0, 0),
+                                            blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.reparentCam, parent),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
 
 
-    def reparentCam(self, state):
-        base.direct.camera.wrtReparentTo(state.parent)
+    def reparentCam(self, parent):
+        base.direct.camera.wrtReparentTo(parent)
         self.updateCoaMarkerSize()
         self.updateCoaMarkerSize()
 
 
     def fitOnWidget(self, nodePath = 'None Given'):
     def fitOnWidget(self, nodePath = 'None Given'):
         # Fit the node on the screen
         # Fit the node on the screen
         # stop any ongoing tasks
         # stop any ongoing tasks
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
         # How big is the node?
         # How big is the node?
         nodeScale = base.direct.widget.scalingNode.getScale(render)
         nodeScale = base.direct.widget.scalingNode.getScale(render)
         maxScale = max(nodeScale[0], nodeScale[1], nodeScale[2])
         maxScale = max(nodeScale[0], nodeScale[1], nodeScale[2])
@@ -799,13 +823,13 @@ class DirectCameraControl(DirectObject):
 
 
         parent = base.direct.camera.getParent()
         parent = base.direct.camera.getParent()
         base.direct.camera.wrtReparentTo(self.camManipRef)
         base.direct.camera.wrtReparentTo(self.camManipRef)
-        fitTask = base.direct.camera.lerpPos(Point3(0, 0, 0),
-                                        CAM_MOVE_DURATION,
-                                        blendType = 'easeInOut',
-                                        task = 'manipulateCamera')
-        # Upon death, reparent Cam to parent
-        fitTask.parent = parent
-        fitTask.setUponDeath(self.reparentCam)
+        ival = base.direct.camera.posInterval(CAM_MOVE_DURATION,
+                                              Point3(0, 0, 0),
+                                              blendType = 'easeInOut')
+        ival = Sequence(ival, Func(self.reparentCam, parent),
+                        name = 'manipulateCamera')
+        self.__startManipulateCamera(ival = ival)
+
 
 
     def moveToFit(self):
     def moveToFit(self):
         # How big is the active widget?
         # How big is the active widget?
@@ -827,12 +851,13 @@ class DirectCameraControl(DirectObject):
         # Spawn a task to keep the selected objects with the widget
         # Spawn a task to keep the selected objects with the widget
         taskMgr.add(self.stickToWidgetTask, 'stickToWidget')
         taskMgr.add(self.stickToWidgetTask, 'stickToWidget')
         # Spawn a task to move the widget
         # Spawn a task to move the widget
-        t = base.direct.widget.lerpPos(Point3(centerVec),
-                                  CAM_MOVE_DURATION,
-                                  other = base.direct.camera,
-                                  blendType = 'easeInOut',
-                                  task = 'moveToFitTask')
-        t.setUponDeath(lambda state: taskMgr.remove('stickToWidget'))
+        ival = base.direct.widget.posInterval(CAM_MOVE_DURATION,
+                                              Point3(centerVec),
+                                              other = base.direct.camera,
+                                              blendType = 'easeInOut')
+        ival = Sequence(ival, Func(lambda: taskMgr.remove('stickToWidget')),
+                        name = 'moveToFit')
+        ival.start()
 
 
     def stickToWidgetTask(self, state):
     def stickToWidgetTask(self, state):
         # Move the objects with the widget
         # Move the objects with the widget
@@ -866,5 +891,5 @@ class DirectCameraControl(DirectObject):
         base.enableMouse()
         base.enableMouse()
 
 
     def removeManipulateCameraTask(self):
     def removeManipulateCameraTask(self):
-        taskMgr.remove('manipulateCamera')
+        self.__stopManipulateCamera()
 
 

+ 8 - 9
direct/src/directtools/DirectManipulation.py

@@ -430,7 +430,6 @@ class DirectManipulationControl(DirectObject):
         taskMgr.remove('manip-move-wait')
         taskMgr.remove('manip-move-wait')
         taskMgr.remove('manip-watch-mouse')
         taskMgr.remove('manip-watch-mouse')
         taskMgr.remove('highlightWidgetTask')
         taskMgr.remove('highlightWidgetTask')
-        taskMgr.remove('resizeObjectHandles')
 
 
     def toggleObjectHandlesMode(self):
     def toggleObjectHandlesMode(self):
         if self.fMovable:
         if self.fMovable:
@@ -1388,24 +1387,24 @@ class ObjectHandles(NodePath, DirectObject):
         self.setScale(1)
         self.setScale(1)
 
 
     def multiplyScalingFactorBy(self, factor):
     def multiplyScalingFactorBy(self, factor):
-        taskMgr.remove('resizeObjectHandles')
         self.ohScalingFactor = self.ohScalingFactor * factor
         self.ohScalingFactor = self.ohScalingFactor * factor
         sf = self.ohScalingFactor * self.directScalingFactor
         sf = self.ohScalingFactor * self.directScalingFactor
-        self.scalingNode.lerpScale(sf, sf, sf, 0.5,
-                                   blendType = 'easeInOut',
-                                   task = 'resizeObjectHandles')
+        ival = self.scalingNode.scaleInterval(0.5, (sf, sf, sf), 
+                                              blendType = 'easeInOut',
+                                              name = 'resizeObjectHandles')
+        ival.start()
 
 
     def growToFit(self):
     def growToFit(self):
-        taskMgr.remove('resizeObjectHandles')
         # Increase handles scale until they cover 30% of the min dimension
         # Increase handles scale until they cover 30% of the min dimension
         pos = base.direct.widget.getPos(base.direct.camera)
         pos = base.direct.widget.getPos(base.direct.camera)
         minDim = min(base.direct.dr.nearWidth, base.direct.dr.nearHeight)
         minDim = min(base.direct.dr.nearWidth, base.direct.dr.nearHeight)
         sf = 0.15 * minDim * (pos[1]/base.direct.dr.near)
         sf = 0.15 * minDim * (pos[1]/base.direct.dr.near)
         self.ohScalingFactor = sf
         self.ohScalingFactor = sf
         sf = sf * self.directScalingFactor
         sf = sf * self.directScalingFactor
-        self.scalingNode.lerpScale(sf, sf, sf, 0.5,
-                                   blendType = 'easeInOut',
-                                   task = 'resizeObjectHandles')
+        ival = self.scalingNode.scaleInterval(0.5, (sf, sf, sf),
+                                              blendType = 'easeInOut',
+                                              name = 'resizeObjectHandles')
+        ival.start()
 
 
     def createObjectHandleLines(self):
     def createObjectHandleLines(self):
         # X post
         # X post

+ 11 - 12
direct/src/directtools/DirectSession.py

@@ -22,6 +22,7 @@ from direct.cluster.ClusterServer import ClusterServer
 ## from direct.tkwidgets import SceneGraphExplorer
 ## from direct.tkwidgets import SceneGraphExplorer
 from direct.gui import OnscreenText
 from direct.gui import OnscreenText
 from direct.showbase import Loader
 from direct.showbase import Loader
+from direct.interval.IntervalGlobal import *
 
 
 class DirectSession(DirectObject):
 class DirectSession(DirectObject):
 
 
@@ -400,13 +401,12 @@ class DirectSession(DirectObject):
         if self.oobeMode:
         if self.oobeMode:
             # Position a target point to lerp the oobe camera to
             # Position a target point to lerp the oobe camera to
             base.direct.cameraControl.camManipRef.iPosHpr(self.trueCamera)
             base.direct.cameraControl.camManipRef.iPosHpr(self.trueCamera)
-            t = self.oobeCamera.lerpPosHpr(
-                Point3(0), Vec3(0), 2.0,
+            ival = self.oobeCamera.posHprInterval(
+                2.0, pos = Point3(0), hpr = Vec3(0), 
                 other = base.direct.cameraControl.camManipRef,
                 other = base.direct.cameraControl.camManipRef,
-                task = 'manipulateCamera',
                 blendType = 'easeInOut')
                 blendType = 'easeInOut')
-            # When move is done, switch to oobe mode
-            t.setUponDeath(self.endOOBE)
+            ival = Sequence(ival, Func(self.endOOBE), name = 'oobeTransition')
+            ival.start()
         else:
         else:
             # Place camera marker at true camera location
             # Place camera marker at true camera location
             self.oobeVis.reparentTo(self.trueCamera)
             self.oobeVis.reparentTo(self.trueCamera)
@@ -423,21 +423,20 @@ class DirectSession(DirectObject):
             base.direct.cameraControl.camManipRef.setPos(
             base.direct.cameraControl.camManipRef.setPos(
                 self.trueCamera, Vec3(-2, -20, 5))
                 self.trueCamera, Vec3(-2, -20, 5))
             base.direct.cameraControl.camManipRef.lookAt(self.trueCamera)
             base.direct.cameraControl.camManipRef.lookAt(self.trueCamera)
-            t = self.oobeCamera.lerpPosHpr(
-                Point3(0), Vec3(0), 2.0,
+            ival = self.oobeCamera.posHprInterval(
+                2.0, pos = Point3(0), hpr = Vec3(0), 
                 other = base.direct.cameraControl.camManipRef,
                 other = base.direct.cameraControl.camManipRef,
-                task = 'manipulateCamera',
                 blendType = 'easeInOut')
                 blendType = 'easeInOut')
-            # When move is done, switch to oobe mode
-            t.setUponDeath(self.beginOOBE)
+            ival = Sequence(ival, Func(self.beginOOBE), name = 'oobeTransition')
+            ival.start()
 
 
-    def beginOOBE(self, state):
+    def beginOOBE(self):
         # Make sure we've reached our final destination
         # Make sure we've reached our final destination
         self.oobeCamera.iPosHpr(base.direct.cameraControl.camManipRef)
         self.oobeCamera.iPosHpr(base.direct.cameraControl.camManipRef)
         base.direct.camera = self.oobeCamera
         base.direct.camera = self.oobeCamera
         self.oobeMode = 1
         self.oobeMode = 1
 
 
-    def endOOBE(self, state):
+    def endOOBE(self):
         # Make sure we've reached our final destination
         # Make sure we've reached our final destination
         self.oobeCamera.iPosHpr(self.trueCamera)
         self.oobeCamera.iPosHpr(self.trueCamera)
         # Disable OOBE mode.
         # Disable OOBE mode.