Last active
June 24, 2019 07:54
-
-
Save SlyCodePanda/60b7761ad1d43ba4b588b3a0904fa511 to your computer and use it in GitHub Desktop.
Handy snippets for quick maya python scripts.
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
# Get the shape node that is hidden in the transform. | |
selected_items = cmds.ls(selection=True) | |
if selected_items: | |
shapes = cmds.listRelatives(selected_items[0], shapes=True) | |
if shapes: | |
print shapes[0] |
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
# Put this in a maya script editor python tab to load external scripts. | |
import sys | |
import maya.cmds as cmds | |
sys.path.append('<path>') | |
import <python file name> as <shorter name version> | |
reload(<shorter name version>) | |
<shorter name version>.run() # <- Not necessary if you don't have a 'run' function in your script. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment