You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用bpy模块导入FBX文件时程序突然崩溃的问题

批量导入FBX文件时bpy模块崩溃及修复过程

我编写了一个批量处理FBX文件的脚本,调用bpy.ops.import_scene.fbx()时,73个网格中有27个无法导入,脚本会无报错直接崩溃。我使用的是编译为Python模块的Blender。

可复现问题的简化代码

import bpy

mesh_path = "my/path/here"

print("import started")
bpy.ops.import_scene.fbx(filepath=mesh_path)
print("import finished")

运行后的输出内容

WARN (bgl): C:\blender-git\blender\source\blender\python\generic\bgl.c:2656 BPyInit_bgl: 'bgl' imported without an OpenGL backend. Please update your add-ons to use the 'gpu' module. In Blender 4.0 'bgl' will be removed.
importing started
FBX version: 7300

进程在输出上述内容后无任何报错或提示直接终止。用常规Blender程序导入同一文件完全正常,且文件路径无差异。所有待处理网格均为同一个大网格的分割部分,理论上设置一致。


更新1:
发现自己编译的bpy模块使用的是Blender 3.6.0 alpha版本,而之前测试用的编辑器是3.5.0版本。编译3.6.0编辑器版本后,同样出现崩溃问题,说明该新版本存在Bug。切换到3.5.0版本后,导入成功,但出现导入的网格多边形数量为0的异常。

更新2:
手动编译的3.5.0编辑器版本导入时仅导入了顶点,查看构建日志发现有涉及网格导入器的警告。于是重新执行make import和make命令编译,之后导入恢复正常;对bpy分支执行同样操作后也恢复正常。

内容的提问来源于stack exchange,提问作者Zane Jensen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 20:02:37