maya, scripts

Maya: Toggle Isolation


In Softimage I use this a lot! Hotkeyed to my NmPad3 key, I have the Isolate Selection tool. Which is great for temporarily hiding all the other stuff in your scene whilst you focus one one thing specifically.

In Maya – I’ve learned, there are some scripts available out there. In a quick attempt to learn a little Python in Maya i took a MEL script that does this and converted it to my understanding of Python in Maya.

I’ve assigned this to my NmPad3 key also.

#toggle isolation


import maya.cmds as cmds

currentPanel = cmds.getPanel(withFocus=True)
currentState = cmds.isolateSelect(currentPanel, query=True, state=True)

if currentState == False:
        cmds.isolateSelect(currentPanel, state=True)
        cmds.isolateSelect(currentPanel, addSelected=True)
else:
        cmds.isolateSelect(currentPanel, state=False)
        cmds.isolateSelect(currentPanel, removeSelected=True)

Leave a Reply

Your email address will not be published. Required fields are marked *

1 × 3 =