Mel Script - Joint Cluster Data [API]





When you apply rigid skinning to a geometry object, a series of joint cluster deformers are created within the Dependency Graph. If you look at the diagram above, the original surface shape is passed through a series of joint clusters, the output of each one feeding into the input of the next.

In effect what is happening here is that the joint clusters are summing up the effect of all joints upon the original surface shape. The final surface shape is then accessible as pSphereShape1.





Finding All Joint Clusters in a Scene

All joint clusters are of the type jointCluster.



		// get a list of all clusters in the scene
		$clusters = `ls -type "jointCluster"`;

		// loop through each cluster
		for( $cluster in $clusters )
			// print the name of the joint cluster node
			print( $cluster + " " );



Rigid Skinning via mel

Within mel we can use the bindSkin command to perform a rigid skin bind.




		// create some geometry to skin 
		$geom=`polyCylinder -r 1 -h 4 -sx 20 -sy 10 -sz 1 -ax 0 1 0 -tx 1 -ch 1`;
		// create first joint
		$j1 = `joint -p 0 1.6 0`;
		// create second joint
		$j2 = `joint -p 0 0 0`;
		// parent to first
		joint -e -zso -oj xyz -sao yup $j1;
		// create third joint
		$j3 = `joint -p 0 -1.6 0`;
		// parent to second
		joint -e -zso -oj xyz -sao yup $j2;

		// select joints and surface to be rigid bound
		select -r $j1 $j2 $j3 $geom;

		// rigid bind them...