Advertisement

How make Skinning Animation Using Fbx Sdk in Python or C++

Started by January 06, 2023 02:00 PM
2 comments, last by Pybarguen 1 year, 9 months ago

Hi people.

in this moment I'm trying to animate a simple model In OpenGl Using Fbx SDK I can get the Spaces Points of the model and the initial global transformation for see the model correctly in Opengl this is the model in blender.

When I import the model in Opengl Using Shader Program with bones and weights looks like.

Load the model is no the problem, the model has 4 bones each bone has 1 Weight and I get the initial matrix of each bone using

fbxCluster = Skin.GetCluster(j)
lMatrix = FbxAMatrix()
lMatrix = fbxCluster.GetTransformMatrix(lMatrix)

When I load this four matrices in the shader program I can see the model like the previus picture. When I'm going to animated the model I used the inverse of the BindPose, I get the Inverse Bind Pose Using

lMatrix = FbxAMatrix()
lMatrix = fbxCluster.GetTransformMatrix(lMatrix)

linkMatrix = FbxAMatrix()
linkMatrix = fbxCluster.GetTransformLinkMatrix(linkMatrix)
BindPose = linkMatrix.Inverse() * lMatrix

Ahm I get the current Matrix of each bone Using

TransforMatrix = b.EvaluateGlobalTransform(CurrenTime, FbxNode.eSourcePivot, False, False)

Ahm the final matrix is

CurrentMatrix = BindPose * TransforMatrix

Ahmm this is the result see the animation is Fbx autodesk Viewer and see in my program.

https://drive.google.com/file/d/1kTVN6VTibSfUZHz3m9xVEZUNf_5JFeh4/view?usp=sharing

here in my OpenGl program.

https://drive.google.com/file/d/1kvreHMBswU43w3vi1ZLJT9gmdrppaCAf/view?usp=sharing

You can see the bones are rotated in Global Space, ahm Works Wrong, I have been trying to do this since 2 months ago, I don't know what to do please help

This is not a Game Design question. Moved to General/Gameplay Programming, since we do not have an Animation forum.

-- Tom Sloper -- sloperama.com

Advertisement

Thank you so much

This topic is closed to new replies.

Advertisement