-2

I am mainly using EvaluateGlobalTransform to get animation from fbx files. This method works with the humanoid.fbx in the samples\ViewScene directory and another ascii format fbx model that I made in Blender.

However, when I export the same Blender model in binary format and try to get the animation from it, the result is totally wrong. The matrices of every frames that I got by calling EvaluateGlobalTransform are mostly same. Here are some snippets of the results.(it is too much to print all of them so I wrote them in a file)

The wrong one: enter image description here

The right one: enter image description here

I am sure that all the fbx files that I use contain at least one animation stack and can be animated perfectly if you open them in FBX Review.

It is worth mentioning that the size(not storage size but spacial size) of the model I made in Blender is somehow larger in binary format than in ascii format.

Please Help Me! Thanks!

ACskyline
  • 61
  • 7
  • 1
    What are you trying to achieve? Use a binary format of FBX instead of text? – zwcloud Mar 05 '17 at 13:34
  • I want to load animation. It seems the codes work with text format FBX but do not work with binary format FBX. – ACskyline Mar 06 '17 at 04:53
  • So.. you problem is not related to Unity3D, right? – zwcloud Mar 06 '17 at 10:09
  • But there should be no difference. The problem is probably caused by the fbx exporter in Blender. You can try export the `FBXScene`, which you just loaded from a text-based FBX file, as a binary format of FBX. Then load the binary fbx file again with FBXSDK, you should get the same result. – zwcloud Mar 06 '17 at 10:10
  • Problem solved. It was a dumb one. Thank you anyway. – ACskyline Mar 28 '17 at 05:00

1 Answers1

0

It's me again. I think I have an answer to my own question. The reason why all matrices are same in binary fbx file but not same in ascii fbx file is that the two animations, which contains all the matrices, are not the same one. In binary file the default take is Idle Animation, whereas in ascii file the default take is Walking Animation. When I extracted matrices from the fbx files, I actually extracted Idle Animation from binary fbx file contrast to Walking Animation from ascii fbx file.

Therefore, I only need to find a way to change the default take from which I extract animation. I think I have solved my problem. I hope this can solve your problem too.

ACskyline
  • 61
  • 7
  • To change the default animation take, use void fbxsdk::FbxScene::SetCurrentAnimationStack (FbxAnimStack * pAnimStack) . e.g. FbxAnimStack* currAnimStack = mFBXScene->GetSrcObject(stackNum);// mFBXScene->SetCurrentAnimationStack(currAnimStack);// – ACskyline Mar 28 '17 at 06:15