首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pyassimp如何将3d模型导出到gltf2.0

pyassimp如何将3d模型导出到gltf2.0
EN

Stack Overflow用户
提问于 2017-08-30 12:56:02
回答 1查看 971关注 0票数 0

使用pyassimp将obj模型转换为gltf2.0,

代码语言:javascript
复制
pyassimp.export(scene,'444.gltf','gltf')

但是导出gltf版本是1.0

代码语言:javascript
复制
"asset": {
    "version": "1",
    "generator": "Open Asset Import Library (assimp v4.0.0)"
},

如何将gltf导出到2.0版本?谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-19 19:48:57

引用pyassimp的export函数的docstring:

代码语言:javascript
复制
>>> help(pyassimp.export)
Help on function export in module pyassimp.core:

export(scene, filename, file_type=None, processing=8)
    Export a scene. On failure throws AssimpError.

    Arguments
    ---------
    scene: scene to export.
    filename: Filename that the scene should be exported to.  
    file_type: string of file exporter to use. For example "collada".
    processing: assimp postprocessing parameters. Verbose keywords are imported
                from postprocessing, and the parameters can be combined bitwise to
                generate the final processing value. Note that the default value will
                triangulate quad faces. Example of generating other possible values:
                processing = (pyassimp.postprocess.aiProcess_Triangulate | 
                              pyassimp.postprocess.aiProcess_OptimizeMeshes)

在您的示例中,这意味着您应该使用file_type gltf2调用函数,如下所示:

代码语言:javascript
复制
pyassimp.export(scene,'444.gltf','gltf2')
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45952197

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档