mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Added support undo selection in new LE
This commit is contained in:
parent
1438fa0078
commit
c3b70b120d
@ -141,8 +141,10 @@ class DirectSession(DirectObject):
|
|||||||
|
|
||||||
self.actionEvents = [
|
self.actionEvents = [
|
||||||
['select', self.select],
|
['select', self.select],
|
||||||
|
['DIRECT-select', self.selectCB],
|
||||||
['deselect', self.deselect],
|
['deselect', self.deselect],
|
||||||
['deselectAll', self.deselectAll],
|
['deselectAll', self.deselectAll],
|
||||||
|
['DIRECT-preDeselectAll', self.deselectAllCB],
|
||||||
['highlightAll', self.selected.highlightAll],
|
['highlightAll', self.selected.highlightAll],
|
||||||
['preRemoveNodePath', self.deselect],
|
['preRemoveNodePath', self.deselect],
|
||||||
# Scene graph explorer functions
|
# Scene graph explorer functions
|
||||||
@ -649,9 +651,13 @@ class DirectSession(DirectObject):
|
|||||||
sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV))
|
sf = 0.075 * nodeCamDist * math.tan(deg2Rad(direct.drList.getCurrentDr().fovV))
|
||||||
self.widget.setDirectScalingFactor(sf)
|
self.widget.setDirectScalingFactor(sf)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def select(self, nodePath, fMultiSelect = 0,
|
def select(self, nodePath, fMultiSelect = 0,
|
||||||
fSelectTag = 1, fResetAncestry = 1, fLEPane = 0):
|
fSelectTag = 1, fResetAncestry = 1, fLEPane=0, fUndo=1):
|
||||||
|
messenger.send('DIRECT-select', [nodePath, fMultiSelect, fSelectTag, fResetAncestry, fLEPane, fUndo])
|
||||||
|
|
||||||
|
def selectCB(self, nodePath, fMultiSelect = 0,
|
||||||
|
fSelectTag = 1, fResetAncestry = 1, fLEPane = 0, fUndo=1):
|
||||||
dnp = self.selected.select(nodePath, fMultiSelect, fSelectTag)
|
dnp = self.selected.select(nodePath, fMultiSelect, fSelectTag)
|
||||||
if dnp:
|
if dnp:
|
||||||
messenger.send('DIRECT_preSelectNodePath', [dnp])
|
messenger.send('DIRECT_preSelectNodePath', [dnp])
|
||||||
@ -725,6 +731,9 @@ class DirectSession(DirectObject):
|
|||||||
messenger.send('DIRECT_deselectedNodePath', [dnp])
|
messenger.send('DIRECT_deselectedNodePath', [dnp])
|
||||||
|
|
||||||
def deselectAll(self):
|
def deselectAll(self):
|
||||||
|
messenger.send('DIRECT-preDeselectAll')
|
||||||
|
|
||||||
|
def deselectAllCB(self):
|
||||||
self.selected.deselectAll()
|
self.selected.deselectAll()
|
||||||
# Hide the manipulation widget
|
# Hide the manipulation widget
|
||||||
if self.manipulationControl.fMultiView:
|
if self.manipulationControl.fMultiView:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user