PDA

View Full Version : Robuust corrective BlendShapes using Tweak node


ljilekor
05-27-2011, 09:39 AM
Hi everyone,

It might sound like a difficult one and it probably is. 'Tweak' Nodes are not very well known but seem to handle very powerfull stuff. (eg calculate the inverse deformations throughout the chain in opposite direction for every type of deformer)

I'm looking for a sollution to intuitively create corrective blendshapes. Because the tweak node seems to calculate and store the relevant offsets relative to its position in the deformation chain, it seems like a perfect way to extract the blendshape from the 'Tweak' node. The only problem is that the axis seem to be all messed up while dragging the vertices after eg. a skincluster.

Explain:

When a mesh is mesh is deformed by any deformer or a series of deformers (blendshape/skincluster/bend/twist/3rd Party ), Maya automatically adds a 'Tweak' node at the start of the deforming chain.
If you apply 'MANUAL' changes to the vertices of the deformed objects, the offsets stored into the 'Tweak' node. THE cool thing is that those offsets are automatically calculated relative to the position of the 'Tweak' node in the deformation chain.
This saves a TD the tedious task of having to calculate the inverse deformations throughout the chain in opposite direction for every type of deformer (blendshape/skincluster/bend/twist/3rdParty...).

But 'Tweak' nodes only seem to update during MANUAL changes !!!

MANUALY DRAGGING VERTICES -> RELEVANT OFFSETS ARE STORED IN THE TWEAK NODE
So if I manually drag a vertex from the deformed mesh(eg by a skincluster), the offset is calculated and stored into the tweak node. Moving the vertices feels strange because the axis are rotated (due to the skincluster)
In the script editor, the code generated by this action would be something like : move -r 1 2 3 mesh.vtx[456];

To prevent this strange behaviour of the vertices while modeling, one could make a duplicate of the deformed mesh to model without the strange constraints and then have a little mel script to snap the vertices of the deformed mesh to the ones of the corrected modeled mesh afterwards.
This, of course, Assuming the tweak node would also calculate the offsets...

DRAGGING VERTICES USING CODE -> RELEVANT OFFSETS ARE NOT STORED IN THE TWEAK NODE
In the script editor, the code generated by ther previous action was be something like : move -r 1 2 3 mesh.vtx[456];
If we undo the move action (to resets tweak nodes offsets) and execute the 'SAME' mel code through the script editor (move -r 1 2 3 mesh.vtx[456];) the offsets are NOT stored into the tweak node but applied onto the meshShape after the skincluster deformer.




So, is there a way to position vertices using mel code (move / polyTransfer / ...) AND having the tweak node calculate the offsets relative to it's position in the deformation chain?
Is there some kind of workaround that forces the tweak node to evaluate?





Thanks in advance.

Laz
05-31-2011, 03:11 AM
Someone has already done this.

http://www.b-ling.com/

The plug-in is out of date, I was looking at replicating it with a scripted plug-in, but if you want to, then you can save me the time :D

You can just use the MEL script but it can get very slow.

CGTalk Moderation
05-31-2011, 03:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.