Sorry, that should read....
#=======================
import pymel.core as pm
def getSkinCluster( node=None ):
if not node:
node = pm.ls(sl=1)[0]
return node.listHistory(type="skinCluster")[0]
def getSkinWeightsData( node=None ):
skin = getSkinCluster( node )
weightData = {}
for vertID in skin.attr("weightList"):
for plug in vertID.attr("weights"):
weightData[ plug.shortName() ] = plug.get()
return weightData
def getSkinDeformersList( node=None ):
skin = getSkinCluster( node )
return [ dfm.inputs() for dfm in skin.attr("matrix") ]
def setSkinWeightsData( weights, node=None ):
skin = getSkinCluster( node )
for key in weights:
skin.setAttr( key, weights[key] )
weightData = getSkinWeightsData()
setSkinWeightsData( weights=weightData )
#=======================
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/bbc59250-4434-4211-9395-efeb414297c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.