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

时间:2016-02-22 08:52:47

标签: autodesk

我想用python throw autodesk fbx sdk导出二进制fbx文件,但是导出文件没有Material,并且导出ascii fbx,它可以正常工作。有人可以帮帮我吗? PS: 如何使用fbx转换导出ascii fbx文件到linux中的二进制文件,我在autodesk网站上搜索转换,是不支持Linux操作系统

1 个答案:

答案 0 :(得分:0)

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

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命令行转换器?