Maya Segment Scale/Node Evaluation Oddity?

We have a rigging toolset that’s fairly in-line with industry standards nowadays. You layout a template skeleton, then convert it to the final skeleton, and then can create a rig that drives your skeleton. It also has functionality to detach the skeleton from the control rig, and re-attach it. Basically these functions just delete the point and orient constraints, and break the scale connection between the control rig and skeleton. All super straightforward stuff.

We’re noticing strangeness when detaching and then reattaching. Prior to the detach all segment scales are setup properly and any scaling functions as expected. When we reattach our scaling does not operate as before the detach, and the appearance is almost as if Maya is ignoring the segment scales despite the fact that all we did was just re-hook up some constraints and input connections. An important note to make is at this stage we have some geometry that’s skinned to the joints that we’ve been toggling constraints and connections on.

Now here’s where things get really strange…if I turn off mesh display in my Maya viewport and perform the same scaling that appears to no longer be working, it starts behaving as expected. For example, I have a hand mesh skinned to some finger joints. Before a detach, scale the wrist, and the entire hand scales up uniformly because of properly setup segment scales. Detach constraints, then reattach constraints, try to scale the wrist with the hand geometry showing in the viewport, and the fingers don’t maintain their segment scales. HOWEVER, turn off the hand geometry and scale the wrist and the fingers go back to adhering to the segment scales. If I scale up the hand with the geo off, the scaling works, then if I turn the geo back on and scale the hand down, the scaling doesn’t work.

I’ve tried duplicating the skinned geo, copying weights over and seeing how that mesh evaluates and it evaluates with the same errors. If I just detach the rig, I can scale the wrist joint and the mesh scales up appropriately, and the hand rig also scales appropriately. Once I attach the two though, which simply just sets up point and orient constraints and scale direct connects, nothing evaluates properly…but only if I’m also displaying meshes.

It’s almost as if some draw functionality or node evaluation gets corrupted in Maya or something during the execution of our code. Has anyone ever seen or experienced anything that sounds remotely similar to this? This is Maya 2014 SP 2.

Just to hammer the point home…

Scaling up the wrist with geo displayed in the viewport, fingers aren’t scaling appropriately with the wrist:

Simply turning off geo display, then scaling up the wrist, fingers are scaling appropriately:

Here’s an overlay just to prove there’s a difference in joint position from the scale, simply by toggling mesh display:

Have you tried toggling segmentScaleCompensate on the skeleton?

Yes, I have. Toggling the segment scales doesn’t change the result of the skeleton.

I’ve tracked down the issue, but still confused as to where the bug is coming from. We’re using PyMel in our code. When we reattach the skeleton joint to the rig joint we point and orient skeleton to rig, and then direct connect scales. What’s odd is that executing these connections causes bad performance in the rig joint, even though all the connections being set up go INTO skeleton FROM rig. The code we were doing was:

rigJoint.scaleX >> skeletonJoint.scaleX
rigJoint.scaleY >> skeletonJoint.scaleY
rigJoint.scaleZ >> skeletonJoint.scaleZ

If I comment this out, I won’t have scale feeding into my skeleton joint, but I won’t see odd scale evaluations on my rig joint. To further confuse matters, if I switch my code to:

rigJoint.scale >> skeletonJoint.scale

I then get the scale on the skeletonJoint as I need, and I also don’t see scale performance issues on my rigJoint…???

Does anyone know of any bugs in PyMel related to using >> to setup connections that cause Maya to evaluate things improperly? My hypergraph connections are identical in either of the cases above, except for the difference of having three input connections instead of one.