@@ -84,7 +84,7 @@ def mouseFlyStart(self):
8484 self .spawnMouseRotateTask ()
8585
8686 def mouseFlyStop (self ):
87- taskMgr .removeTasksNamed ('manipulateCamera' )
87+ taskMgr .remove ('manipulateCamera' )
8888 stopT = globalClock .getFrameTime ()
8989 deltaT = stopT - self .startT
9090 stopF = globalClock .getFrameCount ()
@@ -111,39 +111,39 @@ def mouseFlyStop(self):
111111
112112 def spawnXZTranslateOrHPanYZoom (self ):
113113 # Kill any existing tasks
114- taskMgr .removeTasksNamed ('manipulateCamera' )
114+ taskMgr .remove ('manipulateCamera' )
115115 # Spawn the new task
116116 t = Task .Task (self .XZTranslateOrHPanYZoomTask )
117117 # For HPanYZoom
118118 t .zoomSF = Vec3 (self .coaMarker .getPos (direct .camera )).length ()
119- taskMgr .spawnTaskNamed (t , 'manipulateCamera' )
119+ taskMgr .add (t , 'manipulateCamera' )
120120
121121 def spawnXZTranslateOrHPPan (self ):
122122 # Kill any existing tasks
123- taskMgr .removeTasksNamed ('manipulateCamera' )
123+ taskMgr .remove ('manipulateCamera' )
124124 # Spawn new task
125- taskMgr .spawnMethodNamed (self .XZTranslateOrHPPanTask ,
126- 'manipulateCamera' )
125+ taskMgr .add (self .XZTranslateOrHPPanTask ,
126+ 'manipulateCamera' )
127127
128128 def spawnXZTranslate (self ):
129129 # Kill any existing tasks
130- taskMgr .removeTasksNamed ('manipulateCamera' )
130+ taskMgr .remove ('manipulateCamera' )
131131 # Spawn new task
132- taskMgr .spawnMethodNamed (self .XZTranslateTask , 'manipulateCamera' )
132+ taskMgr .add (self .XZTranslateTask , 'manipulateCamera' )
133133
134134 def spawnHPanYZoom (self ):
135135 # Kill any existing tasks
136- taskMgr .removeTasksNamed ('manipulateCamera' )
136+ taskMgr .remove ('manipulateCamera' )
137137 # Spawn new task
138138 t = Task .Task (self .HPanYZoomTask )
139139 t .zoomSF = Vec3 (self .coaMarker .getPos (direct .camera )).length ()
140- taskMgr .spawnTaskNamed (t , 'manipulateCamera' )
140+ taskMgr .add (t , 'manipulateCamera' )
141141
142142 def spawnHPPan (self ):
143143 # Kill any existing tasks
144- taskMgr .removeTasksNamed ('manipulateCamera' )
144+ taskMgr .remove ('manipulateCamera' )
145145 # Spawn new task
146- taskMgr .spawnMethodNamed (self .HPPanTask , 'manipulateCamera' )
146+ taskMgr .add (self .HPPanTask , 'manipulateCamera' )
147147
148148 def XZTranslateOrHPanYZoomTask (self , state ):
149149 if direct .fShift :
@@ -205,7 +205,7 @@ def HPPanTask(self, state):
205205
206206 def spawnMouseRotateTask (self ):
207207 # Kill any existing tasks
208- taskMgr .removeTasksNamed ('manipulateCamera' )
208+ taskMgr .remove ('manipulateCamera' )
209209 # Set at markers position in render coordinates
210210 self .camManipRef .setPos (self .coaMarkerPos )
211211 self .camManipRef .setHpr (direct .camera , ZERO_POINT )
@@ -214,7 +214,7 @@ def spawnMouseRotateTask(self):
214214 t .constrainedDir = 'y'
215215 else :
216216 t .constrainedDir = 'x'
217- taskMgr .spawnTaskNamed (t , 'manipulateCamera' )
217+ taskMgr .add (t , 'manipulateCamera' )
218218
219219 def mouseRotateTask (self , state ):
220220 # If moving outside of center, ignore motion perpendicular to edge
@@ -245,15 +245,15 @@ def mouseRotateTask(self, state):
245245
246246 def spawnMouseRollTask (self ):
247247 # Kill any existing tasks
248- taskMgr .removeTasksNamed ('manipulateCamera' )
248+ taskMgr .remove ('manipulateCamera' )
249249 # Set at markers position in render coordinates
250250 self .camManipRef .setPos (self .coaMarkerPos )
251251 self .camManipRef .setHpr (direct .camera , ZERO_POINT )
252252 t = Task .Task (self .mouseRollTask )
253253 t .coaCenter = getScreenXY (self .coaMarker )
254254 t .lastAngle = getCrankAngle (t .coaCenter )
255255 t .wrtMat = direct .camera .getMat ( self .camManipRef )
256- taskMgr .spawnTaskNamed (t , 'manipulateCamera' )
256+ taskMgr .add (t , 'manipulateCamera' )
257257
258258 def mouseRollTask (self , state ):
259259 wrtMat = state .wrtMat
@@ -383,7 +383,7 @@ def homeCam(self):
383383 self .updateCoaMarkerSize ()
384384
385385 def uprightCam (self ):
386- taskMgr .removeTasksNamed ('manipulateCamera' )
386+ taskMgr .remove ('manipulateCamera' )
387387 # Record undo point
388388 direct .pushUndo ([direct .camera ])
389389 # Pitch camera till upright
@@ -395,7 +395,7 @@ def uprightCam(self):
395395 task = 'manipulateCamera' )
396396
397397 def orbitUprightCam (self ):
398- taskMgr .removeTasksNamed ('manipulateCamera' )
398+ taskMgr .remove ('manipulateCamera' )
399399 # Record undo point
400400 direct .pushUndo ([direct .camera ])
401401 # Transform camera z axis to render space
@@ -439,7 +439,7 @@ def centerCamNow(self):
439439 self .centerCamIn (0. )
440440
441441 def centerCamIn (self , t ):
442- taskMgr .removeTasksNamed ('manipulateCamera' )
442+ taskMgr .remove ('manipulateCamera' )
443443 # Record undo point
444444 direct .pushUndo ([direct .camera ])
445445 # Determine marker location
@@ -456,7 +456,7 @@ def centerCamIn(self, t):
456456 t .uponDeath = self .updateCoaMarkerSizeOnDeath
457457
458458 def zoomCam (self , zoomFactor , t ):
459- taskMgr .removeTasksNamed ('manipulateCamera' )
459+ taskMgr .remove ('manipulateCamera' )
460460 # Record undo point
461461 direct .pushUndo ([direct .camera ])
462462 # Find a point zoom factor times the current separation
@@ -474,7 +474,7 @@ def zoomCam(self, zoomFactor, t):
474474
475475 def spawnMoveToView (self , view ):
476476 # Kill any existing tasks
477- taskMgr .removeTasksNamed ('manipulateCamera' )
477+ taskMgr .remove ('manipulateCamera' )
478478 # Record undo point
479479 direct .pushUndo ([direct .camera ])
480480 # Calc hprOffset
@@ -525,7 +525,7 @@ def spawnMoveToView(self, view):
525525
526526 def swingCamAboutWidget (self , degrees , t ):
527527 # Remove existing camera manipulation task
528- taskMgr .removeTasksNamed ('manipulateCamera' )
528+ taskMgr .remove ('manipulateCamera' )
529529
530530 # Record undo point
531531 direct .pushUndo ([direct .camera ])
@@ -553,7 +553,7 @@ def reparentCam(self, state):
553553 def fitOnWidget (self , nodePath = 'None Given' ):
554554 # Fit the node on the screen
555555 # stop any ongoing tasks
556- taskMgr .removeTasksNamed ('manipulateCamera' )
556+ taskMgr .remove ('manipulateCamera' )
557557 # How big is the node?
558558 nodeScale = direct .widget .scalingNode .getScale (render )
559559 maxScale = max (nodeScale [0 ],nodeScale [1 ],nodeScale [2 ])
@@ -601,16 +601,16 @@ def moveToFit(self):
601601 # Push state onto undo stack
602602 direct .pushUndo (direct .selected )
603603 # Remove the task to keep the widget attached to the object
604- taskMgr .removeTasksNamed ('followSelectedNodePath' )
604+ taskMgr .remove ('followSelectedNodePath' )
605605 # Spawn a task to keep the selected objects with the widget
606- taskMgr .spawnMethodNamed (self .stickToWidgetTask , 'stickToWidget' )
606+ taskMgr .add (self .stickToWidgetTask , 'stickToWidget' )
607607 # Spawn a task to move the widget
608608 t = direct .widget .lerpPos (Point3 (centerVec ),
609609 CAM_MOVE_DURATION ,
610610 other = direct .camera ,
611611 blendType = 'easeInOut' ,
612612 task = 'moveToFitTask' )
613- t .uponDeath = lambda state : taskMgr .removeTasksNamed ('stickToWidget' )
613+ t .uponDeath = lambda state : taskMgr .remove ('stickToWidget' )
614614
615615 def stickToWidgetTask (self , state ):
616616 # Move the objects with the widget
@@ -636,5 +636,5 @@ def disableMouseFly(self):
636636 base .enableMouse ()
637637
638638 def removeManipulateCameraTask (self ):
639- taskMgr .removeTasksNamed ('manipulateCamera' )
639+ taskMgr .remove ('manipulateCamera' )
640640
0 commit comments