How to reverse linear blend skinning?

Inside Maya, I have a point in 3D that was deformed using Linear Blend skinning.

I also have access to the joints in their current pose and in their bind pose as well as the weight values.

I would like to inverse the linear blend skinning to get the original position of that point.

I am using this website (MyCustomSkinCluster.cpp) as reference on the Linear blend skinning formula, it works one way but when I try to reverse it to get the original position it doesn’t give the correct position.

What would be the correct way to reverse it?

I am currently just changing

mat = preBindMatrix * mat;

to

mat = preBindMatrix.inverse() * mat.inverse();

To inverse the matrices. I can’t seem to wrap my head around what’s the logic to inverse matrix operations.

Thank you for your help.

First, let’s make things simpler. Don’t worry about the joint positions and bind pre matrix separately. Only mess with their product. They aren’t acting on the mesh independently. So instead of taking the inverse of each of those matrices separately, take the inverse of that product.
This is really just an algebra problem in disguise.

point * (prebind * joint) = newpt
point * (prebind * joint) * (prebind * joint)^-1 = newpt * (prebind * joint)^-1
point = newpt * (prebind * joint)^-1

Basically: I think this is what you’re looking for. At least for this step

mat = (preBindMatrix * mat).inverse();
1 Like