mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 21:53:40 +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 screen in bpy.data.screens:
|
||||||
for area in screen.areas:
|
for area in screen.areas:
|
||||||
if area.type == "NODE_EDITOR":
|
if area.type == "NODE_EDITOR":
|
||||||
for space in area.spaces:
|
space = area.spaces.active
|
||||||
if space.tree_type == "ShaderNodeTree":
|
assert isinstance(space, bpy.types.SpaceNodeEditor)
|
||||||
context_override = {"area": area, "space": space, "screen": screen}
|
if space.tree_type == "ShaderNodeTree":
|
||||||
return context_override
|
context_override = {"area": area, "space": space, "screen": screen}
|
||||||
|
return context_override
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def copy_node_graph(cls, material_to: bpy.types.Material, material_from: bpy.types.Material) -> None:
|
def copy_node_graph(cls, material_to: bpy.types.Material, material_from: bpy.types.Material) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user