Dust off the Cluster

For a long time I didn’t know what to do with the cluster deformer in Maya. Which is ironic, given one of the first rigging “tricks” I learned was how to make a cluster follow a rig.

But, let’s back up. What is a cluster? To paraphrase the official documentation:

The cluster deforms points by some percentage of a transform.

In other words, a cluster behaves the same as a single joint within a skinCluster, including the ability to paint weights. This makes clusters ideal for additive controls or in-shot tweaks.

Select a mesh and create a cluster. By default it will be created with its pivot at the center of the mesh’s bounding box. Thanks, Maya! But I wanted it over there.

Select the cluster handle transform and zero out it’s local pivot. Group it. Now move the group to where you want the cluster to be. This will move the mesh, too.

Be not afraid; we can fix this.

Most deformers have some concept of their “bind” state, one in which the output geometry is the same as the input geometry. For a cluster, this has to do with the .bindPreMatrix attribute. The official documentation refers to it as the “compensation” matrix, but you can think of it as a guerdon1 instead. The cluster’s influence is calculated relative to this matrix.

If you connect .parentInverseMatrix of the cluster handle to the cluster’s .bindPreMatrix attribute, the cluster’s will only deform the geometry relative to the cluster handle’s local transform. This means that you can make the cluster handle’s parent follow the rig without double transforming.

Finally, if you don’t like the cluster handle shape node, you can turn any transform into a cluster using the cluster command, like so:

cmds.cluster(‘myMesh’, weightedNode=[‘aTransform’, ‘aTransform’])

And do the same connections as described above, and shown below. In this diagram, clusterParent is the parent transform to clusterHandle.

cluster_bindPreMatrix

1 It’s a Shakespeare reference. Google it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s