Last active
June 10, 2025 09:49
-
-
Save chris-lesage/8c77edabf4f8ab81ea21f0c20703884e to your computer and use it in GitHub Desktop.
Revisions
-
chris-lesage revised this gist
Jan 20, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ oldSel = pm.selected() for eachGeo in pm.selected(): skinInputs = eachGeo.listHistory(interestLevel=1, type='skinCluster') # filters out a bug where if a geo has an FFD lattice which is skinned, # it finds the lattice skinCluster instead of your geometry. correctSkins = [ -
chris-lesage created this gist
Jul 1, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ import pymel.core as pm ### SNIPPET Reset Skin Cluster ### # This script can be used to reset geometry to its neutral rest pose # after joints have been moved. Use it when making adjustments to your rig/skeleton. # USAGE: 1. Select the geo 2. Run this script. # Limitation: # Sometimes depending on your history, Maya may give an error and fail to reset the geo. # Sometimes running it twice solves this... ¯\_( ツ )_/¯ # For more advanced cases, like resetting a single joint, see Cole O'Brien's script here: # https://gist.github.com/obriencole11/cfb1545a61bbbaff23498f5f9042d0e3 oldSel = pm.selected() for eachGeo in pm.selected(): skinInputs = eachGeo.getShape().listHistory(interestLevel=1, type='skinCluster') # filters out a bug where if a geo has an FFD lattice which is skinned, # it finds the lattice skinCluster instead of your geometry. correctSkins = [ skin for skin in skinInputs if eachGeo.name() in [sk.getTransform().name() for sk in skin.getGeometry()] ] for oSkin in correctSkins: skinJointList = pm.listConnections(oSkin.matrix, t='joint') bindPose = pm.listConnections(skinJointList[0].name(), d=True, s=False, t='dagPose') if bindPose: if not (pm.referenceQuery(bindPose[0], inr=True)): pm.delete(bindPose[0]) sourceGeo = pm.skinCluster(oSkin, q=True, g=True)[0] pm.skinCluster(oSkin, e=True, ubk=True) pm.skinCluster(skinJointList, sourceGeo, ibp=True, tsb=True) pm.select(oldSel)