blender - 如何在 Blender 中将对象的每个断裂导出到单独的 .obj 文件中?
问题描述
我有一个被分成很多块的物体。我想将此对象的每一部分导出到一个.obj
文件中。
解决方案
我通过在 Blender 中创建一个 python 脚本自己解决了这个问题。
import bpy
import os
# show current path
print(">>>>",os.getcwd())
# find all objects whose name starting with "Group"
frag_objs = [obj for obj in bpy.data.objects if obj.name.startswith("Group")]
# Export all objects seperatly
bpy.ops.object.select_all(action='DESELECT')
for obj in frag_objs:
frg = bpy.context.scene.objects[obj.name]
frg.select=True
bpy.ops.export_scene.obj(filepath="group/"+obj.name+".obj",use_selection=True)
frg.select=False
推荐阅读
- sql-server - 在 SQL Server 中显示按聚合条件过滤的月份
- swift - My UserDefaults values are always one-behind (Concurrency/Parallelism) in Swift
- python - 将 1 添加到列表的最后一个值
- html - 如何在 Google 的 Material Design 中更改顶部应用栏的填充颜色?
- java - 使用 LLVM 运行 javacpp 预设时出现 UnsatisfiedLinkError
- python - 如何自动重命名从 pytube 下载的文件?
- wordpress - Wordpress - 意外的令牌错误...预期的 LBRACE 和预期的 IDENT 错误
- docker - 在构建期间将主机文件复制到 docker 容器
- javascript - 如何实现普通 JS 路由器来监听地址栏中输入的路径名更改,如反应?
- swift - 类型 'UIViewController' 没有成员 updateTimer