Corrective BlendShapes on a Wrap deformer

Many tools offer a way to reverse a skincluster in order to apply corrective blendshape (only a few do it well).
But no tool exists to succesfully reverse a wrap deformer (or other deformers based on some rotation (bend/twist/ etc …)).

To put the question in q more general way:
Is there a ‘robust’ way to reverse any deformer throughout the deformer chain.(pointorder/vertexcount remain unchanged)?

Theoretic Example:
Deformer chain: ShapeOrig → bendDeform → Wrap → ResultShape

I need to add a blendShape Node in front of the bendDeform to apply corrective blendshapes. I want to ‘model’ my corrective shapes in the deformed pose.

Deformer chain: ShapeOrig → ‘correctiveBlendshapeNode’ → bendDeform → Wrap → ResultShape

Jojaa told me it was possible to store the tweaked deltas ‘directly’ into a ‘non connected’ blendshapeNode. I tried and I tried but without success, so I figure that I’m missing something… The method would provide a robust way to model corrective poses for any type of deformer (not just the skinCluster) and therefore be a major blessing for many many users (struggling to create their correctives on the T pose)

Thanks a lot in advance for helping out on this persistent problem.

Who’s da man!

Joe’s da man !

lBrush is fine but not production ready (PSD in particular).

PSD leaves too much to ‘the machine’ when it comes to blending in the correctives at the right time. This means you need at least 4-5 shapes to simply rotate a forearm (0-150 degs). Adding a shape sometimes overwrites all the others (so you better keep track of the angles on which the shapes were made…)

By hand I only need 2 shapes and deformations look nicer .

In short : In LBrush (PSD in particular) too much is left to ‘the machine’. The mathematicly correct shape is not always a beautiful one (read useful one).
Only humans can ‘SEE’ if the deformation ‘LOOKS NICE’ but a user has no acces to the actual blending itself…

I haven’t found a way yet to extract the blendshapes from PSD (in the right tangent space). If they could be extracted… the user could take care of the blending himself (using blendshapes and driven keys).

The search for the ultimate corrective blendshape tool goes on…

Well I knd of explained to you how to do this allready. The biggest problem is tough not the making of blends thats trivially easy, not even hooking them in place ta the history is any problem whatsoever. But rather the problem is how to tie them up with the wrap deformer so what is the driver is the problem. ANway IF you know how to drive the corrective blendshape yourself then thats a another matter alltogether.

So i can easily demonstrate how to do the loading of the correction to the blend. But alas i have still no maya up and running at work because of a IT upgrade that fizzled, and now basically everybody is on vacation which means NOTHING will happen in 7 weeks or so. But on the bonus side i just got my own machine up and running after renovations in my own home.*

SO maybe i need to SHOW you how to make it instead of trying to explain things.

A tangent space warp deformer is REALLY easy to do (its about teh easiest thing ever you can even use a particle system for making it), after all its just a new coordinate system per vertex only since the blendshape deformer is just w1w1TargetVector + w2w2TargetVector+…wNwNTargetVector. Now the real trick is to make it fast, and since the internal blendshape node is REALLY optimized ist really hartd to make it as fast (and optimized) as the built in blendshape.

The same applies for nonlinear blendshapes, which incidenttaly maya knows how to do with the defualt blendshape node, its just that youd have to calculate the intermediary results with a blendshape doefrmation but its all the same. The other just hides the computation.

PS: You can allways pay others to do the jobs for you. Now the real question is how far your willing to. Because some stuff is REALLy easy to do and since in essence maya llready has all teh tools you need for this its a bit, meh.

OK i analyzed your problem more in depth, and came to the conclusion that the nonlinear spaces can not be handled as easily as linear ones. In fact the problem move in space X inside space Y where Y is unknown can not elementary me solved. Nevertheless they can in my preliminary test be solved in most practical circumstances be solved by a simple iteration. heres some pseudocode

  1. get the nodes in between your corrector and shape.
  2. for each node take up their envelope value store for later use.
  3. take local derivate of space y in space x for each point, by moving the point at the earlier hostory first
  4. make a linear move to what you guessed is the coordinate in the X space see if it matches Y.
  5. IF sufficently close to target return go to 3 or return.
  6. else, decrement all envelopes by 1/? try again as the curveature of the space is too complicated (but within sufficently small envelopes the space si still linear enough so if you do adaptive search is should work out fine).
  7. do process 3. 4 5. ? times if any step fails subdivide that subsection again.
  8. on return restore envelopes, and write values to the blendshape

This is a O(n*m) or O(n) since n>>m algorithm on the whole the number of substeps is independent of complexity of the object, tough possibly a slow O(n). And it does work quite in my preliminary quick tests but making he production code of this is a bit of work.

Thx Jojaa for looking deeper into this.

The key to the sollution is indeed not to reversecalculate what a deformer node does but to derive what a deformer node does through testing with a 1/x increment on the envelope.
Though less elegant, it’s is more likely to work for any deformer (also third party deformer nodes) whether it’s linear (blendShape, FFD, …) or non-linear (skinclusters, twist, bend, …) and even with linear nodes made non linear (eg a skinned FFD deforming the object)

The driver isn’t really the issue (a user can drive the resulting shape with anything he chooses). The problem lies in calculating the right delta’s at the chosen position in the deformer chain.

Deriving might be a slower (more calculus intensive) method, but you are sure you’ll come to a result.
Since we need something that looks good much rather than something mathematically correct, the tool will probably fulfill the task. Accuracy depends on the steps (increment 1/x) and would only take some more time, so it’s fine for me.

I agree that maya contains every node you need to solve 97% of the issues, but wouldn’t it be nice if AD came up with a nice and elegant sollution for the corrective blendshape problem (cfr sticking a transform on a mesh with ‘pointOnPoly’ vs ‘Rivet’)
A node that you can plug anywhere into your deformer chain that calculates deltas at that moment in the chain (between Original(intermediate) / Deformed and Corrected shapes) could be such a ‘more elegant’ sollution (a bit like XSI).
The result shape is then of course plugged into a blendshape at the place where the tool calculated the delta’s…

Unfortunatly, I won’t have the time to look further into it in the coming weeks (lot’s of work and no holiday for me). I hope you’ll keep me updated.

Thanks again

Yes well according to signal theory the issue of where it would be would only work if the space is somewhat predictable, in other words the frequency of the space is not too high for the step count. Anyway i don’t really see it as a good candidate for a node per see, as its way too interactively slow to do this*. You have to understand that autodesk, do not know more about what the node does than we do. Which is why you find the tweak to be so unworkable, that simply the best they can do.

In practice reversing would be a ideal solution. Unfortunately for us we don’t necessarily know what the reverse is for functions like wrap deformer is (but we know it for ffd and bend!), at least very easily without requiring all nodes to be redesigned. Worse we do not even know that a single sane reverse does exist. Now just like the tangent space deformer, which is a good solution in some cases, even this method does have a downside. Even tough the move in new found local is straight, it might move trough a very weird space making it look unnatural to say the least. But For reasons of practicality the deformers you use are not usually very noisy so a solution might be derived.

Anyway this method CAN get lost!

  • now this IS a databaking issue and is a good candate for a command altough in general i  frown uppon the idea (you just need to store/modify existing corrective shapes, not work on the corrective shapes in real time its enough for you that the correction can be trasfeered to the right place.)

PS: i have the exact same problem as you do as far as vacations go.

I may be wrong because I havent tested… but,

If the problem is finding the right tangent space in which a vtx is transformed for every deformer.
For each vertex, generate a matrix containing the transforms with envelope 0 and 1. The deformation could be reduced to the difference between those matrices per vertex.

Positions are easy. We can calculate the difference between relative positions with envelopes 0 and 1

As for orientation we could generate the rotation matrix by ‘not-really-calculating’ left / up / forward vectors of a vertex. Sparing the details:
Simply move each vertex in its ‘relative’ space with the move command and query the resulting positions (left=move 1,0,0  / up = move 0,1,0 / Fwd= move 0,0,1). Normalize the vectors and plug them in the up/fwd/left sections of the matrix…

The process could be lengthy but as you said. We don’t need realtime here.

Just a thought. Could be nothing of course…

No its not a tangent space problem. Imagine you have a curved space

__
/
/ Y
x

Now to get form x to y you can not just move directly form x towards y because you dont move towards y. You need to walk down the path of the curved space and seek y in many steps and hpe tht you will eventually converge to y. Now if you move a bit along x y and z you get the local direction dreivate of the curved spaceand can take a eduacated guess. You will miss but atleast you have a chance to come closer so that the second try has a better chance and so on.

PS im not sure why the envelopes help my algorithm… Like i tought it was a good idea and it kindof works but i nolonger know why it does, because it wasnt the reason i did it before.