關於fbx sdk版本向下相容問題
阿新 • • 發佈:2019-01-26
下載了fbx sdk2017和2018,發現sample的ViewScene有些模型是讀不出來的,原先我還以為是auto desk弄的不是向下相容的,後來查了一下線上文件,發現是高版本是向下相容的,越高版本約好。
如fbx sdk 2016 2017 2018是這樣:
The FBX SDK can:
Import FBX files compatible with FBX file format versions 7.5, 7.4, 7.3, 7.2, 7.1, 7.0, 6.1, and 6.0.
Export FBX files compatible with FBX file format versions 7.5, 7.4, 7.3, 7.2, 7.1, 7.0, and 6.1.
而fbx sdk2011是最高支援到7.1版本
FBX SDK:
Imports FBX files compatible with FBX file format versions 7.1, 7.0, 6.1, and 6.0
Exports FBX files compatible with FBX file format version 7.1 (default), 7.0, and 6.1.
而fbx sdk 2017和2018一些讀不出來並不是版本問題,而是sdk有bug,那就是自定義記憶體管理導致的
只要註釋viewscene裡面如下程式碼即可
// Use a custom memory allocator // FbxSetMallocHandler(MyMemoryAllocator::MyMalloc); // FbxSetReallocHandler(MyMemoryAllocator::MyRealloc); // FbxSetFreeHandler(MyMemoryAllocator::MyFree); // FbxSetCallocHandler(MyMemoryAllocator::MyCalloc);