【发布时间】:2016-06-03 15:01:23
【问题描述】:
我想用python throw autodesk fbx sdk导出二进制fbx文件,但是导出文件没有Material,并且导出ascii fbx,它可以很好地工作。有人可以帮我吗? ps: 如何在linux中使用fbx convert export ascii fbx file to binary file,我在autodesk网站上搜索convert,是不支持Linux操作系统的
【问题讨论】:
标签: autodesk
我想用python throw autodesk fbx sdk导出二进制fbx文件,但是导出文件没有Material,并且导出ascii fbx,它可以很好地工作。有人可以帮我吗? ps: 如何在linux中使用fbx convert export ascii fbx file to binary file,我在autodesk网站上搜索convert,是不支持Linux操作系统的
【问题讨论】:
标签: autodesk
如果要导出素材,需要添加
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 命令行转换器呢?
【讨论】: