diff --git a/magic_uv/op/texture_projection.py b/magic_uv/op/texture_projection.py index cdd1e4b1b..45f02478b 100644 --- a/magic_uv/op/texture_projection.py +++ b/magic_uv/op/texture_projection.py @@ -449,7 +449,8 @@ class MUV_OT_TextureProjection_Project(bpy.types.Operator): # assign image if compat.check_version(2, 80, 0) >= 0: node_tree = obj.active_material.node_tree - output_node = node_tree.nodes["Material Output"] + output_node = next(n for n in node_tree.nodes + if n.type == "OUTPUT_MATERIAL") nodes = common.find_texture_nodes_from_material( obj.active_material) diff --git a/magic_uv/op/uv_inspection.py b/magic_uv/op/uv_inspection.py index dbd8e04d5..f72438752 100644 --- a/magic_uv/op/uv_inspection.py +++ b/magic_uv/op/uv_inspection.py @@ -447,7 +447,8 @@ class MUV_OT_UVInspection_PaintUVIsland(bpy.types.Operator): "MagicUV_PaintUVMaterial_{}".format(i)) if compat.check_version(2, 80, 0) >= 0: target_mtrl.use_nodes = True - output_node = target_mtrl.node_tree.nodes["Material Output"] + output_node = next(n for n in target_mtrl.node_tree.nodes + if n.type == "OUTPUT_MATERIAL") nodes_to_remove = [n for n in target_mtrl.node_tree.nodes if n != output_node] for n in nodes_to_remove: