Jump to content
  • Advertisement
Sign in to follow this  
maxest

FBX animation problem (EvaluateGlobalTransform)

This topic is 2531 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using FBX SDK, version 2012.1. I noticed that nodes have this nice function for evalution the final transform matrix, called EvaluateGlobalTransform. It works perfectly for static meshes. I also noticed that the first parameter of this function is KTime object. So I thought I could easily get animation frames of my node this way. Unfortunately, it does not work as expected. No matter what frame I pass in, I always get the same result*. Anyone experience a similar problem?

* the animation are in the file for sure :). I checked with ImportScene samples and it writes out on output some keyframes for the nodes.

Share this post


Link to post
Share on other sites
Advertisement
Okay guys... nevermind. I've just found out that function KTime::Set was for setting the internal timer, not the number of frame. The proper function was SetTime It's all working now.

Share this post


Link to post
Share on other sites
Yeah, I saw there was a function with Fast postfix, but I don't know if I need it. I want to have my own format anyway so I just want to extract all the necessary data from the FBX file and put in my own :).

Share this post


Link to post
Share on other sites

Yeah, I saw there was a function with Fast postfix, but I don't know if I need it.

Trust me, you need it. The non fast method allocates the most absurd amount of memory I've ever seen. If you are have a file with a few takes in (say 12), it just grinds everything to a stand still (whilst it processes a seemingly never ending set of de-allocations). Mind you, even with the fast methods, the performance of that SDK is god awful.

Share this post


Link to post
Share on other sites
Yet I still claim I don't care :). I will be using this SDK only to process each FBX file once. It's not going to be used in the "final version of a game"

Share this post


Link to post
Share on other sites
40 mins?! Okay... If it starts to take too long then I'll use that Fast functions ;). So far processing a cylinder based on 4 bones is quite fast :)

Share this post


Link to post
Share on other sites
Hey guys,

I've got one more problem. It's about pivots. I finally realized what GetGeometric*** actually does ;). So basically to position an object correctly in the scene I need to evaluate its global transform, and apply geometric translation/rotation/scaling. This way pivots set in 3ds max work just fine, with one exception... skinning. When I bind an object to a skin, and to modify the pivot ot that object, I get incorrectly skinned object in my application.

Here's how I compute it for non-skinned meshes:

transform = mtx::translate(newMesh.geometricTranslation) * newMesh.globalTransforms[frame];

(note that I don't use geometric rotation and scaling here, first I wanted to make sure that sole translation works ok)

And code for my skinned object:

transform.loadZeroes();

for (uint j = 0; j < newMesh.vertices.bonesReferences.size(); j++)
{
string& boneName = newMesh.vertices.bonesReferences[j].boneName;
float& boneWeight = newMesh.vertices.bonesReferences[j].boneWeight;

transform +=
boneWeight *
newMesh.transforms[boneName] *
newMesh.linkTransforms[boneName].getInversed() *
bones[boneName].globalTransforms[frame];
}

transform = mtx::translate(newMesh.geometricTranslation) * transform;

In this case it doesn't work (skin does some excessive rotation of vertices).

I also tried putting that geometricTranslation somewhere among the transform's (the variable) operands, but with no correct effect). Any idea what I'm doing wrong?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!