Script for converting skin morph morphs into morpher morphs for exporting into Game engine


I have been trying to develop a script that would convert an additive morph that is applied on top of the skin modifiers into a morpher friendly version which could be used under the skin modifier. I want this so that i can extract my corrective morphs from skin morph and apply them inside of Unreal engine, which only supports standard morphs, not additive ones.

Now my basic idea of making this happen was that i need to recreate the skinning algorithm in maxscript, which i managed to do, and then apply it backwards in the the deformed (corrective morphed) version of the model.

The skinning part of my script works, i store the relative positions of the vertices in the bind pose, then at a different frame where the bones are in a different transformation i read their transforms, multiply the relative transforms of the verts with the bone transforms and average all of the bones affecting that vertex based on their weights and get the final averaged positions for the vertices.

This so far works like a charm, and i get the exact same result as with the skin modifier applied.

My problem now is that in order for this conversion to work, i have to take the final additive morph, and transform the vertices backwards that is apply the transforms backwards so that i cancel out the skinning information and get the pure morph.

So basically i need to figure out the bind pose based on the deformed mesh. How would you go about doing this?

Also please don't suggest that i bind the model in the deformed pose and apply the transformation because that is not the correct way, as it then takes the relative positions of the vertices in the deformed state and makes them the bind pose. Which then when transformed back to the rest pose don't end up where they need to be.

Any idea how to make this happen?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Griffs Game Dev's picture

Solved, I think...

I think I made something that does what you want it to. Take a look at this morph target builder script:

ZalitZ's picture

How is your corrective shape

How is your corrective shape created ?
If you do it with an EditPoly modifier on top of your Skin, you just have to turn off the skin then collapse all modifiers to get a shape that you can use later in a morpher. You can then wire connect your morpher value with your bones rotation.
I personnaly work with Zbrush layers and GoZ to create corrective shapes.

Jimenillofu's picture

That doesnt work for me,

That doesnt work for me, after putting that corrective shape in the morpher, the skinned model doesnt match with the corrective shape in the position you did it for.

This is what i want:
This is the script it uses:
and this other one for 3ds max which says that does the same thing, but it actually doesnt. or i think it doesnt... i have the same wrong results as when i do it manually:

Jimenillofu's picture

Did you finally got it

Did you finally got it working? I have been searching for a solution and i havent found anything.
I tried mamnually applying the transform backwards from the modified pose and as you already said it didnt work.

Sn_a_ke's picture
morph point to the vertex a well-calculated from the offset

restoremorphpos=offset[i]* inverse boneanim[n].transform* bonebind[n].transform* weight[i][n]

but at the moment I can't calculate the geometry of the position of the offset vertices.

chroman's picture

After messing around with


chroman's picture

That doesn't seem to do the

That doesn't seem to do the trick, as it still doesn't calculate the right position at the bind pose, for the morph to work when applied through morpher below the skin.

kphammond9's picture

also really interested in this

Something like this would be hugely useful for me, too. Bumping and adding another interested voice. :-)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.