Created
July 21, 2016 21:57
-
-
Save AndrewtConroy/7932c68213b7a2b1a83d548c9a634c62 to your computer and use it in GitHub Desktop.
Same Skin
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
# select two objects. First, the one with a skinCluster you like. Second, an object you want to have a matching skin. | |
# Once selected, hit the button. This will make matching skingCluster influences. | |
#Once this is done, select the objects again and use maya's copy skinweights tool. | |
import maya.cmds as cmds | |
import maya.mel as mel | |
selected = cmds.ls(sl=1) | |
skinnedMesh = selected[0] | |
newMesh = selected[1] | |
skinCluster = mel.eval('findRelatedSkinCluster ' + skinnedMesh) | |
skinnedJoints = cmds.skinCluster(skinCluster,query=True,inf=True) | |
cmds.select(skinnedJoints, newMesh) | |
cmds.skinCluster() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment