I spent a moment this morning to see if something can be done about baking arbitrary deformations to animated joints + skinCluster using SOuP nodes.The results were pretty good and i figured i should post them here.

The red and blue overlapping objects shown below are the skinClustered representation and the original deforming meshes.

Here is a little script that takes care of everything.Select one or multiple mesh objects and run it.Set the number of samples higher if the results are not satisfactory.Depends on the object shape and type of deformations, the voxelBinding flag helps a lot or does not, so run a test with and without it to see what works best.

Hi,i'am new to SOuP and to this forum, so first i want to thank you for making these tools available and to share you time and knowledge here.

I'am on maya 2015 and i can't get the same result as shown on the picture for the taurus. The joints are all created on the same area of the mesh instead of being "scattered" so the skinned mesh doesn't fit the deformation/animation at all and only a portion of the joints seems to have influence on verts. Even with increasing the joints numbers, switching voxelBinding flag doesn't make a difference. Do you have an idea about what's wrong here ?

Is it possible to make this setup work with a selection of existing joints? I'm sure you see where i'am going, this kind of setup would be so great for game engine pipeline as shown by Hans Godard and Webber Huang.Both of their works seems to rely a lot on the paper about Smooth Skinning Decomposition with Rigid Bones (SSDR), i don't have the math/science background to "evaluate" the difference between this method and what you bring as a solution with SOuP, but how do you compare the two?

recently in VR we needed to move some deforming geo to Unreal and because unreal does not have the nice alembic support CryEngine has, so i had to do the clumsy thing. With this said - i know very well where you are coming from :)

Can you download the latest SOuP version (just released it) and give it a try. This tool is built into it already with GUI and stuff.

I cannot promise, but will try to take a look soon at your other request about measuring "deltas" and "translating" that to skinWeights.

From the top of my head:for each joint move the joint measure and store array of "deltas" for all points (as a scalar array of distances, but not the vectors) write the non-zero values as skinCluster weights for the joint in the loop

Then we run normalize skin weights and that should be it.As a rule of thumb i don't read papers so i may be wrong on this one, but it should be easy to verify my assumption. :)

Thanks for considering my request, you'll make a lot of happy people i'm sure ;)

About the work of Hans Godard and Webber Huong based on the SSDR paper, it seems that their algorithm performs several iteration of calculation until they hit a certain error threshold indicated by the user, you can also indicate the Maximum Influence needed, this parameter is quite important depending of the game engine you are using.

What's your thought on VR ? Some major studios have been making the jump lately (ILM Experience Lab etc).

To be honest i find the whole idea of baking arbitrary deformations to skinCluster and set of joints a bit clunky. It just does not scale. If you know what i mean. The proper solution is to use Alembic caches in the game engines. CryEngine provides it out of the box and we are helping ourselves in Unreal.With that said, i am a bit hesitant to spend more time on the idea. Maybe later. :)

I will restrain myself from commenting on VR. Only time will tell if the stars will line up for this one.It looks promising right now.

Now, about baking of rig deformations to existing fk skeleton + skinCluster(s).Check the code below. It seems to be holding pretty well here.

your code wasn't working for me out of the box, and i'am not that used to the api but i've manage to have something working by making some changes. I'm not using MPlug() but getting the shape and working from there.I've made my test on the mush file exemple, and the result are 'ok' but not perfect, some part like the elbow or the second joint of the spine are still funky but overall it's seems to be on the good path.You were certainly using MPlug and the worldmesh attribute for a good reason and my changes may have left something out of the solution.

Alembic is without a doubt a plus for games engines, i like how they used it in Ryse to bake "destruction" etc. But for things like facial setup, LODS, the way a solution like SSDR offers like baking blendshape to joints seems to be holding things up pretty well as joints are way cheaper in memory than alembic no ?

The result maya file is too big for being attached, sorry.For those who will test the code, don't freak out ;) it takes around 15 seconds to perform the task.(on the mush file exemple).

edit : there's two joints on the skeleton that have their translate attributes locked, unlock them before using the function.

it is strange that the original code was not working for you. Can you provide a Maya scene that shows the problem.

Are you guys not using blend shapes for facial animation ?I didn't notice a performance difference between blendShapes and joints+skinCluster for facial setup with 120 poses, for example.Alembic is only for rbds and soft body deformations here.

There will always be a difference when approximating multiple deformers by baking them down to a skinCluster. There is no way around it. If you have a scene where you see significant differences after baking that don't match the "original" setup please post it here and i will take a look.

in this post i've attached the result file using your original code and in the next post the one with my modified code. I used the mush.ma file provided in the exemple scene for soup archive.

When i was saying that your code wasn't working i meant that it wasn't giving a correct result, it's only the result of a smooth binding operation. I'am on maya 2015.The problem seems to be in those few lines as the neutral dict doesn't populate and the pa.lenght is 0:

Yeah, SP1 has broken setAttr performance (I can only say for sure on windows). Setting skinCluster weightList on about 1500 verts with 5 joints takes a fraction of a second in 2015 and 2016 (gold) but it takes about 90 seconds on 2016 SP1.

Insert Photos

Web address (URL)

Image URL

If your URL is correct, you'll see an image preview here. Large images may take a few minutes to appear.
Remember: Using others' images on the web without their permission may be bad manners, or worse, copyright infringement.