Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need to extract keys instead of each keyframes.

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
548 Views, 6 Replies

Need to extract keys instead of each keyframes.

I have an animation which is 1 second long. But whenever i ask fbx for the key count it tells me it is 60 keys. It seems like it is even returning the interpolated keys. I do not want the interpolated keys since i can compute them myself in my code. All i want to get from the fbx is the number of keys not the number of keyframes. Is there any way to do that.
6 REPLIES 6
Message 2 of 7
jiayang.xu
in reply to: Anonymous

Sure, you can always get key count by KeyGetCount() function of FbxAnimCurveNode or KFbxAnimCurveKFCurve as your need.

Which function are you using to query the key count?
And please check how many animation curves for that 1 second?
Are there animation keys on different keyframe for different animation curves?
Message 3 of 7
Anonymous
in reply to: Anonymous

I am using the KFbxAnimCurve KeyGetCount. It always returns 60 frames for each second. One of the animation that i am using right now is the Humanoid sample which comes with the sdk. The second animation in the Humanoid file is 9 seconds long and it tells me it has 540 frames. So based on that information it seems like the sdk is returning every single interpolated keys and non interpolated keys. So is there any way to extract the non interpolated keys only.
Message 4 of 7
Anonymous
in reply to: Anonymous

I am using the KFbxAnimCurve KeyGetCount. It always returns 60 frames for each second. One of the animation that i am using right now is the Humanoid sample which comes with the sdk. The second animation in the Humanoid file is 9 seconds long and it tells me it has 540 frames. So based on that information it seems like the sdk is returning every single interpolated keys and non interpolated keys. So is there any way to extract the non interpolated keys only.


Do you know the difference between "key", "frame", and "frame rate"?
Maybe you're confused.
Message 5 of 7
Anonymous
in reply to: Anonymous

No, i am not confused. What i am saying is this. In max for example if you had a key at 0 then add another key let's say at 60 for example. and we say we want to play the animation at 60 frames per person. The amount of time it would it take to get to the key at 60 would be one 1 second if we are playing the animation at 60 frames per second which is correct. But in a situation like that, even though it is taking that long to play there is only two keys not 60. So the thing is that fbx is returning 60 keys instead of 2 because it is computed the in between keys as well. I do not want the in between keys all i want is the two keys the one at 0 and the one at 60. So is there any way to check and make sure that an key is actually not an interpolated key.
Message 6 of 7
jiayang.xu
in reply to: Anonymous

Hello BornToCode,
The KFbxAnimCurve::KeyGetCount does exactly what you want, it only return count of keys, not frame counts of certain period of time.
I double checked Humanoid.fbx and it turns out to be accidently have keys on each frame. In this case, the key count coincidentally is the same as frame count. That's why you think what KeyGetCount returns is the frame count, not the key count.

I attached a very simple FBX file with a sphere with animation and only have 2 keys, you can easily check with KFbxAnimCurve::KeyGetCount and see it will return 2.

Please double check your other FBX files to see if they are in the same case as Humanoid to have keys on each frame. You can use FBX converter to convert them to ascii file to check the key count directly, or you can import your file to Maya or Motionbuilder to check how many keys there indeed.

keycounttest.zip

Message 7 of 7
Anonymous
in reply to: jiayang.xu

Now that makes sense now.
Thanks Jiayang for clearing that up for me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report