将场景中的每个对象导出到另一个文件
我想问你,如何使用 python 脚本将所有对象导出到场景以在搅拌机中分离文件?我想将它导出到 fbx,得到这样的东西: 目标文件 汽车Car.fbx 船船.fbx 等等..
每个对象都会有他的文件。 我尝试使用“export_fbx.py”,将源代码粘贴到搅拌机中的编辑器,并在粘贴的代码下面编写一些内容,例如:
for ob in bpy.data.objects:
save(bpy.ops.mesh,ob,'C:\\images\\'+ ob.name + '.fbx')
但这不起作用:/ 我需要这样的东西,因为场景中有 45 个对象,我必须将彼此导出到 fbx,才能将其导入到 XNA 中。
I want to ask you, how can I export all objects to scene to seperate files in blender using python scripts ? I want to export it to fbx, to have something like this:
Object File
Car Car.fbx
Boat Boat.fbx
etc..
Each object will be have his of file.
I'm tring to use 'export_fbx.py', I paste source to editor in blender, and write something below pasted code like:
for ob in bpy.data.objects:
save(bpy.ops.mesh,ob,'C:\\images\\'+ ob.name + '.fbx')
But this doesn't work :/
I need something like this, beacouse I have 45 objects in scene, and I have to export each other to fbx, to import it in XNA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 http://www.blender .org/documentation/blender_python_api_2_61_0/bpy.ops.export_scene.html#bpy.ops.export_scene.fbx
循环遍历场景中的所有对象,单独选择每个对象并使用 use_selection 参数集调用 bpy.ops.export_scene.fbx
as per http://www.blender.org/documentation/blender_python_api_2_61_0/bpy.ops.export_scene.html#bpy.ops.export_scene.fbx
loop over all objects in the scene selecting each individually and calling bpy.ops.export_scene.fbx with the use_selection parameter set