# How do I find the final pose matrix for every bone to send to the shader?

Hello any advice would really be appreciated. I know there are lots of threads on this already but I have read many of them and I am still having trouble. I want to export a simple skeletal animation to a JSON file and play it in opengl. I am having trouble finding or calculating the correct matrix for each bone to send into the vertex shader.

I know this has been asked before but I have read a lot of threads and I am still having trouble with this. How do I get the final matrix for every bone to send to the vertex shader? What data do I need from blender for this?

I have tried using just the pose bone's matrix world, its parent's matrix_local times the pose bone's matrix_basis, many things but I always get a distorted model.

I'm pretty sure my vertices' bone weights and ids are working properly. This is my vertex shader (which is working) I think I'm just sending the wrong bone transforms

• My take is pose_bone.matrix @ pose_bone.bone.matrix_local.inverted(), but I can't test it. – eric.m Aug 19 '19 at 6:57