Enabled selection only mode while other manipluation is disabled

This commit is contained in:
Gyedo Jeon 2007-12-14 00:48:09 +00:00
parent d8e6dc13a3
commit 084bda9f8e

View File

@ -40,6 +40,9 @@ class DirectManipulationControl(DirectObject):
self.optionalSkipFlags = 0
self.unmovableTagList = []
# [gjeon] to enable selection while other manipulation is disabled
self.fAllowSelectionOnly = 0
def manipulationStart(self, modifiers):
# Start out in select mode
self.mode = 'select'
@ -47,6 +50,9 @@ class DirectManipulationControl(DirectObject):
if base.direct.cameraControl.useMayaCamControls and modifiers == 4:
self.mode = 'camera'
if self.fAllowSelectionOnly:
return
# Check for a widget hit point
entry = base.direct.iRay.pickWidget()
# Did we hit a widget?
@ -162,10 +168,19 @@ class DirectManipulationControl(DirectObject):
for event in self.actionEvents:
self.accept(event[0], event[1], extraArgs = event[2:])
def disableManipulation(self):
self.fAllowSelectionOnly = 0
def disableManipulation(self, allowSelectionOnly=False):
# Ignore events
for event in self.actionEvents:
self.ignore(event[0])
# [gjeon] to enable selection while other manipulation is disabled
if allowSelectionOnly:
self.fAllowSelectionOnly = allowSelectionOnly
self.accept('DIRECT-mouse1', self.manipulationStart)
self.accept('DIRECT-mouse1Up', self.manipulationStop)
self.removeManipulateObjectTask()
taskMgr.remove('manipulateObject')
taskMgr.remove('manip-move-wait')