Skip to content

Instantly share code, notes, and snippets.

@mstevenson
Forked from fredrikaverpil/maya_sublime.py
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstevenson/e2c854ced5007f899bff to your computer and use it in GitHub Desktop.
Save mstevenson/e2c854ced5007f899bff to your computer and use it in GitHub Desktop.
Send selected code snippets to Maya via commandPort
// Close ports if they were already open under another configuration
if (catch(`commandPort -name ":7001" -close True`)) {
warning "Could not close port 7001 (maybe it is not opened yet...)";
}
if (catch(`commandPort -name ":7002" -close True`)) {
warning "Could not close port 7002 (maybe it is not opened yet...)";
}
// Open new ports
commandPort -name ":7001" -sourceType "mel";
commandPort -name ":7002" -sourceType "python";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment