mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 01:44:06 -04:00
*** empty log message ***
This commit is contained in:
parent
563ba074d8
commit
c01b8826dd
@ -71,27 +71,17 @@ class DirectJoybox(PandaObject):
|
||||
# Accept button events
|
||||
self.acceptSwitchModeEvent()
|
||||
self.acceptUprightCameraEvent()
|
||||
# If moving widget update wrt info
|
||||
if self.nodePath.id() == direct.widget.id():
|
||||
# Kill follow task
|
||||
taskMgr.removeTasksNamed('followSelectedNodePath')
|
||||
# Record relationship between selected nodes and widget
|
||||
direct.selected.getWrtAll()
|
||||
# Update task
|
||||
taskMgr.spawnMethodNamed(self.updateTask, self.name + '-updateTask')
|
||||
|
||||
def disable(self):
|
||||
taskMgr.removeTasksNamed(self.name + '-updateTask')
|
||||
if self.nodePath.id() == direct.widget.id():
|
||||
# Restart followSelectedNodePath task
|
||||
direct.manipulationControl.spawnFollowSelectedNodePathTask()
|
||||
# Ignore button events
|
||||
self.ignoreSwitchModeEvent()
|
||||
self.ignoreUprightCameraEvent()
|
||||
|
||||
def destroy(self):
|
||||
self.disable()
|
||||
self.ignore('selectedNodePath')
|
||||
self.ignore('deselectNodePath')
|
||||
self.tempCS.removeNode()
|
||||
|
||||
def addButtonEvents(self):
|
||||
@ -105,26 +95,6 @@ class DirectJoybox(PandaObject):
|
||||
|
||||
def setNodePath(self, nodePath):
|
||||
self.nodePath = nodePath
|
||||
if self.nodePath.id() == direct.widget.id():
|
||||
# Kill follow task
|
||||
taskMgr.removeTasksNamed('followSelectedNodePath')
|
||||
# Record relationship between selected nodes and widget
|
||||
direct.selected.getWrtAll()
|
||||
# Watch for newly selected objects
|
||||
self.accept('selectedNodePath', self.selectionHook)
|
||||
# Watch for deselections
|
||||
self.accept('deselectNodePath', self.selectionHook)
|
||||
else:
|
||||
self.ignore('selectedNodePath')
|
||||
self.ignore('deselectNodePath')
|
||||
|
||||
def selectionHook(self, dnp):
|
||||
if direct.selected.getSelectedAsList():
|
||||
print 'enable'
|
||||
self.enable()
|
||||
else:
|
||||
print 'disable'
|
||||
self.disable()
|
||||
|
||||
def getNodePath(self):
|
||||
return self.nodePath
|
||||
@ -146,16 +116,6 @@ class DirectJoybox(PandaObject):
|
||||
def updateTask(self, state):
|
||||
self.updateVals()
|
||||
self.updateFunc()
|
||||
if self.nodePath.id() == direct.widget.id():
|
||||
if direct.manipulationControl.fSetCoa:
|
||||
# Update coa based on current widget position
|
||||
direct.selected.last.mCoa2Dnp.assign(
|
||||
direct.widget.getMat(direct.selected.last))
|
||||
# Update wrt info
|
||||
direct.selected.getWrtAll()
|
||||
else:
|
||||
# Move the objects with the widget
|
||||
direct.selected.moveWrtWidgetAll()
|
||||
return Task.cont
|
||||
|
||||
def updateVals(self):
|
||||
|
@ -71,7 +71,10 @@ class ForceGroup(DirectObject):
|
||||
# Utility functions
|
||||
def __getitem__(self, index):
|
||||
"""__getItem__(self, index)"""
|
||||
if (index < 0) | (index > self.node.getNumForces()):
|
||||
numForces = self.node.getNumForces()
|
||||
if numForces == 0:
|
||||
raise IndexError
|
||||
if ((index < 0) | (index >= self.node.getNumForces())):
|
||||
raise IndexError
|
||||
return self.node.getForce(index)
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
from PandaObject import *
|
||||
from Tkinter import *
|
||||
from AppShell import *
|
||||
from DirectGeometry import relHpr
|
||||
from DirectGeometry import *
|
||||
import Pmw
|
||||
import Dial
|
||||
import Floater
|
||||
@ -14,9 +14,6 @@ TODO:
|
||||
Task to monitor pose
|
||||
"""
|
||||
|
||||
ZERO_VEC = Vec3(0)
|
||||
UNIT_VEC = Vec3(1)
|
||||
|
||||
class Placer(AppShell):
|
||||
# Override class variables here
|
||||
appname = 'Placer Panel'
|
||||
|
Loading…
x
Reference in New Issue
Block a user