mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
Added Maya Cam mode
This commit is contained in:
parent
0dc83f067b
commit
50a3d5d0ac
@ -629,6 +629,9 @@ class LevelEditor(NodePath, DirectObject):
|
|||||||
self.outerBarricadeDict = {}
|
self.outerBarricadeDict = {}
|
||||||
self.innerBarricadeDict = {}
|
self.innerBarricadeDict = {}
|
||||||
|
|
||||||
|
# [gjeon] to find out currently moving camera in maya mode
|
||||||
|
self.mouseMayaCamera = False
|
||||||
|
|
||||||
# ENABLE/DISABLE
|
# ENABLE/DISABLE
|
||||||
def enable(self):
|
def enable(self):
|
||||||
""" Enable level editing and show level """
|
""" Enable level editing and show level """
|
||||||
@ -1686,6 +1689,12 @@ class LevelEditor(NodePath, DirectObject):
|
|||||||
|
|
||||||
# LEVEL-OBJECT MODIFICATION FUNCTIONS
|
# LEVEL-OBJECT MODIFICATION FUNCTIONS
|
||||||
def levelHandleMouse3(self, modifiers):
|
def levelHandleMouse3(self, modifiers):
|
||||||
|
if base.direct.cameraControl.useMayaCamControls and modifiers == 4: # alt is down, use maya controls
|
||||||
|
self.mouseMayaCamera = True
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
self.mouseMayaCamera = False
|
||||||
|
|
||||||
# Initialize dna target
|
# Initialize dna target
|
||||||
self.DNATarget = None
|
self.DNATarget = None
|
||||||
|
|
||||||
@ -1875,6 +1884,9 @@ class LevelEditor(NodePath, DirectObject):
|
|||||||
return menuMode, wallNum
|
return menuMode, wallNum
|
||||||
|
|
||||||
def levelHandleMouse3Up(self):
|
def levelHandleMouse3Up(self):
|
||||||
|
if self.mouseMayaCamera:
|
||||||
|
return
|
||||||
|
|
||||||
if self.activeMenu:
|
if self.activeMenu:
|
||||||
self.activeMenu.removePieMenuTask()
|
self.activeMenu.removePieMenuTask()
|
||||||
# Update panel color if appropriate
|
# Update panel color if appropriate
|
||||||
@ -2396,6 +2408,8 @@ class LevelEditor(NodePath, DirectObject):
|
|||||||
else:
|
else:
|
||||||
base.direct.grid.setPosHpr(selectedNode, deltaPos, deltaHpr)
|
base.direct.grid.setPosHpr(selectedNode, deltaPos, deltaHpr)
|
||||||
|
|
||||||
|
if self.mouseMayaCamera:
|
||||||
|
return
|
||||||
# Also move the camera
|
# Also move the camera
|
||||||
taskMgr.remove('autoMoveDelay')
|
taskMgr.remove('autoMoveDelay')
|
||||||
handlesToCam = base.direct.widget.getPos(base.direct.camera)
|
handlesToCam = base.direct.widget.getPos(base.direct.camera)
|
||||||
@ -5898,6 +5912,16 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
variable = self.fGrid,
|
variable = self.fGrid,
|
||||||
command = self.toggleGrid)
|
command = self.toggleGrid)
|
||||||
base.direct.gridButton.pack(side = LEFT, expand = 1, fill = X)
|
base.direct.gridButton.pack(side = LEFT, expand = 1, fill = X)
|
||||||
|
|
||||||
|
self.fMaya = IntVar()
|
||||||
|
self.fMaya.set(0)
|
||||||
|
self.mayaButton = Checkbutton(buttonFrame,
|
||||||
|
text = 'Maya Cam',
|
||||||
|
width = 6,
|
||||||
|
variable = self.fMaya,
|
||||||
|
command = self.toggleMaya)
|
||||||
|
self.mayaButton.pack(side = LEFT, expand = 1, fill = X)
|
||||||
|
|
||||||
buttonFrame.pack(fill = X)
|
buttonFrame.pack(fill = X)
|
||||||
|
|
||||||
buttonFrame4 = Frame(hull)
|
buttonFrame4 = Frame(hull)
|
||||||
@ -5971,6 +5995,11 @@ class LevelEditorPanel(Pmw.MegaToplevel):
|
|||||||
if page == 'Signs':
|
if page == 'Signs':
|
||||||
self.updateSignPage()
|
self.updateSignPage()
|
||||||
|
|
||||||
|
# [gjeon] to toggle maya cam mode
|
||||||
|
def toggleMaya(self):
|
||||||
|
base.direct.cameraControl.lockRoll = self.fMaya.get()
|
||||||
|
direct.cameraControl.useMayaCamControls = self.fMaya.get()
|
||||||
|
|
||||||
def toggleGrid(self):
|
def toggleGrid(self):
|
||||||
if self.fGrid.get():
|
if self.fGrid.get():
|
||||||
base.direct.grid.enable()
|
base.direct.grid.enable()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user