【问题标题】:how to fbx sdk export binary fbx file with python如何使用python fbx sdk导出二进制fbx文件
【发布时间】: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


    【解决方案1】:

    如果要导出素材,需要添加

    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,有帮助吗?
    猜你喜欢
    • 2015-07-02
    • 2015-12-01
    • 2017-03-01
    • 2016-03-11
    • 2013-11-07
    • 2017-12-17
    • 1970-01-01
    • 2018-03-13
    • 2020-10-30
    相关资源
    最近更新 更多