【发布时间】:2022-01-24 15:04:48
【问题描述】:
更新到 Blender 3.0 后,我的一个功能似乎是立即关闭 Blender。
整个函数:
# Loops through each collection and disables every object from viewport and render.
def disableAllObjs():
for collection in bpy.data.collections:
if collection.name != "Collection":
for obj in collection.all_objects:
obj.hide_viewport = True
obj.hide_render = True
我做了一些调试,特别是这部分它坏了:
obj.hide_viewport = True
obj.hide_render = True
我不确定这么快禁用所有功能是否会使 Blender 过载,但这在 2.93 中运行良好。在循环之外使用该代码在单个对象上可以正常工作,但会在循环中中断。任何帮助表示赞赏。
【问题讨论】: