Accessing Rigid Skinning Information [MEL]




Whenever you create a rigidly skinned mesh within maya, you will end up adding in a number of MFn::kJointCluster nodes into the scene. In essence a joint cluster, simply maintains a list of vertices from a number of shapes that are directly influenced by that joints transformation. ie, rather than parenting an entire geometry object to a specific bone, we are parenting groups of vertices under individual bones.





Finding all Joint Clusters in the Scene

When retrieving mesh data, you will need to use an MItDependencyNodes in order to loop through a list of clusters.






// create an iterator to go through all meshes
MItDepedencyNodes it(MFn::kJointCluster);


// attach the function set to the object

// print joint cluster name
<<"Cluster "<< <<endl;



// get next mesh;



Finding the influence joint

Finding the influence joint for the joint cluster is simply a case of checking for any connections to the matrix attribute of the joint cluster node.

This function therefore checks for any connections to the attribute and returns the influencing transform.






bool OutputClusterTransform(MObject& jointcluster)

// attach a function set to the cluster
MFnDependencyNode fnNode(jointCluster);

// get a plug to the matrix attribute

MPlug plug = fnNode.findPlug("matrix");

MPlugArray conns;

// if the attribute is connected to a transform

if (plug.connectedTo(conns,true,false)) {


MFnDependencyNode fnTransform(conns[0].node());

cout << "\tbone "
<< fnTransform.

return true;

return false;




Accessing the influenced Geometry


Each joint cluster may influence more than one geometry object. Each object will then have a variable number of it's control points influenced by the actual influencing joint for this cluster.



















bool OutputInfluencedGeometry(MFnWeightGeometryFilter& jc)


// need the set fn to get the cluster members
MFnSet setFn(jc.deformerSet());

MSelectionList Shapes;

// get all the shapes in the cluster
setFn.getMembers(Shapes, true);

for (int i = 0; i < Shapes.length(); ++i)


MDagPath skinpath;
MObject components;
MFloatArray weights;

// get a path to the i'th shape affected

// get the weights and vertex indices for
// the points that are influenced.

// Usually you can ignore the weight values
// since they all tend to be 1

// attach a function set to the shape so that
// we can access it's name.


cout << "\tShape "
<< "\n\tNumPoints "
<< weights.length()

// output the vertex indices by iterating
// through the geometry components

MItGeometry it(skinpath,components);
for ( ; !it.isDone();

  cout << "\t\t" << it.index() << "\n";







What Next?

Transform Data

Animation Data

Animation Curves

Smooth Skinning (Skin Clusters)

Blend Shape Deformers


Rob Bateman [2004]