mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 01:41:57 +00:00
Fix error loading external shader styles
Mentioned in logs from #5820 Turned out, `area.spaces` also contain all other spaces this area used (e.g. it used be view3d before it became a nodegraph) leading to errors. Simplifying it with `area.spaces.active`.
This commit is contained in:
@@ -323,10 +323,11 @@ class Blender(bonsai.core.tool.Blender):
|
||||
for screen in bpy.data.screens:
|
||||
for area in screen.areas:
|
||||
if area.type == "NODE_EDITOR":
|
||||
for space in area.spaces:
|
||||
if space.tree_type == "ShaderNodeTree":
|
||||
context_override = {"area": area, "space": space, "screen": screen}
|
||||
return context_override
|
||||
space = area.spaces.active
|
||||
assert isinstance(space, bpy.types.SpaceNodeEditor)
|
||||
if space.tree_type == "ShaderNodeTree":
|
||||
context_override = {"area": area, "space": space, "screen": screen}
|
||||
return context_override
|
||||
|
||||
@classmethod
|
||||
def copy_node_graph(cls, material_to: bpy.types.Material, material_from: bpy.types.Material) -> None:
|
||||
|
||||
Reference in New Issue
Block a user