Created
March 25, 2014 14:58
-
-
Save fredrikaverpil/9763549 to your computer and use it in GitHub Desktop.
Open ports in Maya for Sublime Text #maya
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
# Close ports if they were already open under another configuration | |
try: | |
cmds.commandPort(name=":7001", close=True) | |
except: | |
cmds.warning('Could not close port 7001 (maybe it is not opened yet...)') | |
try: | |
cmds.commandPort(name=":7002", close=True) | |
except: | |
cmds.warning('Could not close port 7002 (maybe it is not opened yet...)') | |
# Open new ports | |
cmds.commandPort(name=":7001", sourceType="mel") | |
cmds.commandPort(name=":7002", sourceType="python") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment