poseDeformer for maya 2014

david | animation,dj mod,plugins | Sunday, April 14th, 2013

I added the 2014-x64 (windows) version of Michael Comet's poseDeformer to the downloads page.

I recently discovered a potential problem when using the poseDeformer in maya 2013 and 2014. The problem occurs due to changes brought about by the introduction of the node editor in maya. I've modified the poseDeformer code to work around the problem, but for any one who is interested, I'll describe it in more detail below.

You can display a node in the node editor, show its attributes and make connections between attributes. An array attribute, for example something like worldMatrix, is displayed with an index, because it is part of an array. So typically you might see something like worldMatrix[0]. The thing is that before the node editor was introduced, worldMatrix[0] did not really exist until you made a connection to it. But this would have made if difficult to make a connection in the node editor. If an attribute index doesn't exist yet, how can you connect something to it, right? So what the maya dev's did was create an unconnected array index when you load any node with array attributes into the node editor. That way you will have something to connect to or from. If you make a connection to worldMatrix[0], then they add worldMatrix[1], and so on.

So why is that a problem?

Well for a start it makes things inconsistent. If you never load nodeX into the attribute editor and never connect anything to worldMatrix then worldMatrix[0] will not exist. If you do load nodeX, then you will now have worldMatrix[0] even though it is not being used.

The real problem is that many old mel scripts and plugins rely on an assumption that if an index exists in the array attribute, then it is being used. And this assumption breaks in maya 2013 and 2014.

The poseDeformer is one such plugin. It uses an attribute called poseXFormWorldMatrix to connect the influence joints into the pose. It is the child of a compound array attribute called poseXform. When the poseDeformer calculates the weight of a pose it uses joints connected to this array. To simplify (and speed up) the weight calculation for poses that have more than one joint association, only a single joint is used. And for reasons that probably only Michael Comet could explain, the joint used is the one with the highest index (ie the joint connected last). The poseReader makes the assumption that there is a joint connected to existing poseXForm indexes, and uses the one with the highest index to calculate the pose weight. So if you happened to display the poseDeformer node in the node editor (eg when you graphed the mesh history) then a new, but unconnected poseXForm index is created and the plugin now thinks you have more joints than you actually do. It then uses an invalid matrix, and begins to deform incorrectly.

I fixed the problem by simply changing the plugin to use the first connected joint instead of the last, so it was an easy fix. The hard part was figuring out why it was breaking in the first place.

1 Comment »

  1. I've been looking for a version of poseDeformer for Maya 2013 64-bit on Linux, as I haven't had any luck compiling it myself yet. Do you know if there is a compiled version anywhere, or if somebody would be able to compile one? Thanks!

    Comment by darrenh — May 10, 2013 @ 6:34 am

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck