Autodesk 如何使用python导出fbx sdk二进制fbx文件

Autodesk 如何使用python导出fbx sdk二进制fbx文件,autodesk,Autodesk,我想用autodesk fbx sdk导出二进制fbx文件,但是导出文件没有材质,并且导出ascii fbx,它可以很好地工作。有人能帮我吗? 附言: 如何在linux中使用fbx convert将ascii fbx文件导出为二进制文件,我在autodesk网站中搜索convert,它不支持linux操作系统如果要导出材质,需要添加 pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) pSdkManager.GetIOS

我想用autodesk fbx sdk导出二进制fbx文件,但是导出文件没有材质,并且导出ascii fbx,它可以很好地工作。有人能帮我吗? 附言:
如何在linux中使用fbx convert将ascii fbx文件导出为二进制文件,我在autodesk网站中搜索convert,它不支持linux操作系统如果要导出材质,需要添加

pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) # or False if you want ASCII
在二进制和ascii之间进行选择

pFileFormat =pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat()
if not pEmbedMedia:
    lFormatCount =pSdkManager.GetIOPluginRegistry().GetWriterFormatCount()
    for lFormatIndex in range(lFormatCount):
        if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex):
            lDesc =pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex)
            if "ascii" in lDesc:
                pFileFormat =lFormatIndex
                break
并在Exporter.Initialize()调用中使用pFileFormat


FbxConverter从未为Linux发布过,因此没有选项。既然你有了Python绑定,而且SDK可以做与应用程序相同的事情,为什么不做一个简单的Python命令行转换器呢?

如果你想导出材料,你需要添加

pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True)
pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) # or False if you want ASCII
在二进制和ascii之间进行选择

pFileFormat =pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat()
if not pEmbedMedia:
    lFormatCount =pSdkManager.GetIOPluginRegistry().GetWriterFormatCount()
    for lFormatIndex in range(lFormatCount):
        if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex):
            lDesc =pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex)
            if "ascii" in lDesc:
                pFileFormat =lFormatIndex
                break
并在Exporter.Initialize()调用中使用pFileFormat


FbxConverter从未为Linux发布过,因此没有选项。既然你得到了Python绑定,而且SDK可以做与应用程序相同的事情,为什么不做一个简单的Python命令行转换器呢?

@jing ya,有用吗?@jing ya,有用吗?