Fbx File Format Identifier

Posted 金庆

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fbx File Format Identifier相关的知识,希望对你有一定的参考价值。

Fbx File Format Identifier

(金庆的专栏 2021.5)

Print the list of FBX file format identifiers.

FBX SDK FbxExporter can set the file format identifier which is an int parameter.
The commnet says: User does not need to specify it by default.
If not specified, plugin will detect the file format according to file suffix automatically.

FBX SDK 2020 automatically set it to the latest binary format, which can not be parsed by “Autodesk FBX Converter 2013”.
We need to specify the format identifier for FBX Converter 2013.
But there is no specification of this parameter.
We use the following code to display all the valid format identifiers and their descriptions.

#include <fbxsdk.h>
#include <cassert>

int main()
{
    FbxManager* myManager = FbxManager::Create();
    assert(myManager);

    Fbxiosettings* ios = FbxIOSettings::Create(myManager, IOSROOT);
    myManager->SetIOSettings(ios);

    int lFormatCount = myManager->GetIOPluginRegistry()->GetWriterFormatCount();
    for (int lFormatIndex = 0; lFormatIndex < lFormatCount; lFormatIndex++)
    {
        FbxString lDesc = myManager->GetIOPluginRegistry()->GetWriterFormatDescription(lFormatIndex);
        printf("Format index %d: %s\\n", lFormatIndex, (const char*)lDesc);
    }
    return 0;
}

Output:

Format index 0: FBX binary (*.fbx)
Format index 1: FBX ascii (*.fbx)
Format index 2: FBX encrypted (*.fbx)
Format index 3: FBX 6.0 binary (*.fbx)
Format index 4: FBX 6.0 ascii (*.fbx)
Format index 5: FBX 6.0 encrypted (*.fbx)
Format index 6: AutoCAD DXF (*.dxf)
Format index 7: Alias OBJ (*.obj)
Format index 8: Collada DAE (*.dae)
Format index 9: Biovision BVH (*.bvh)
Format index 10: Motion Analysis HTR (*.htr)
Format index 11: Motion Analysis TRC (*.trc)
Format index 12: Acclaim ASF (*.asf)
Format index 13: Acclaim AMC (*.amc)
Format index 14: Vicon C3D (*.c3d)
Format index 15: Adaptive Optics AOA (*.aoa)
Format index 16: Superfluo MCD (*.mcd)

FBX Converter 2013 will error “File is corrupted” for files exported as *.fbx file format: -1, 0, 2, 5.
Ascii format (1, 4) and FBX 6.0 binary (3) are OK.

以上是关于Fbx File Format Identifier的主要内容,如果未能解决你的问题,请参考以下文章

Maya:如何使用 python 导入 fbx?

osg qt fbx

javascript 无法识别 .fbx 文件类型

如何加载数据库Fbx文件,不是assetbundle

解决Zend加密的PHP页面出现Fatal error: Incompatible file format: The encoded file has format major ID 1, where

dnSpy PE format ( Portable Executable File Format)