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.
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;
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;
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;) 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.