accessing stereoPanel viewport

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to make a python script to hide everything in the stereo viewport by pression a hotkey. It works fine with a regular viewport but i just can't get it to work on a stereo. Can anyone help me out?
#-----------------------------------------------------------------
import maya.cmds as cmds
currentPanel = cmds.getPanel(wf=1)
print "Selected Panel is: " + currentPanel
if currentPanel == "StereoPanel":
state = cmds.modelEditor( currentPanel, query = True, nurbsCurves = True)
# ------ this is where i get errors, can't set the state variable
if state == True:
cmds.StereoPanelEditor( currentPanel, e=1, allObjects = False )
else:
state = cmds.modelEditor( currentPanel, query = True, nurbsCurves = True )
if state == True:
cmds.modelEditor( currentPanel, e=1, allObjects = False )
#cmds.modelEditor( currentPanel, e=1, nurbsCurves = False )
#cmds.modelEditor( currentPanel, e=1, locators = False )
cmds.modelEditor( currentPanel, e=1, polymeshes = True )
#cmds.modelEditor( currentPanel, e=1, handles = False )
#cmds.modelEditor( currentPanel, e=1, joints = False )
cmds.modelEditor( currentPanel, e=1, pluginShapes = True )
else:
cmds.modelEditor( currentPanel, e=1, allObjects = True )
cmds.modelEditor( currentPanel, e=1, nurbsCurves = True )
cmds.modelEditor( currentPanel, e=1, locators = True )
cmds.modelEditor( currentPanel, e=1, polymeshes = True )
cmds.modelEditor( currentPanel, e=1, handles = True )
cmds.modelEditor( currentPanel, e=1, joints = True )
cmds.modelEditor( currentPanel, e=1, pluginShapes = True )
#-----------------------------------------------------------------