Created
September 23, 2013 09:31
-
-
Save tokejepsen/6668335 to your computer and use it in GitHub Desktop.
grandpa setup
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.mel as mel | |
import maya.cmds as cmds | |
import maya.OpenMaya as om | |
sel=cmds.ls(selection=True) | |
try: | |
#getting namespace and nodes | |
ns=sel[0].split(':')[0] | |
worldcnt=ns+':rig:world_Ctrl' | |
root=ns+':rig:skin:hip_jnt' | |
#character setup | |
charSet=cmds.character(sel) | |
cmd='setCurrentCharacters( { "%s" } );' % charSet | |
mel.eval(cmd) | |
#setting ghosting | |
cmds.select(worldcnt) | |
mel.eval('performSetOffsetObject;') | |
cmds.select(root) | |
mel.eval('performSetHierarchyRoot;') | |
#feedback | |
om.MGlobal.displayInfo('Character setup successfull!') | |
except: | |
cmds.error('Character setup failed!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment