From bef07dc1129b5ee5dac8788dd80b58b71e7e8c36 Mon Sep 17 00:00:00 2001 From: nutti Date: Tue, 21 Mar 2023 17:19:00 +0900 Subject: [PATCH] Merge: Blender official patch (8fb28124ba40836941ad0fef8b53d2b450250054) --- src/magic_uv/op/texture_projection.py | 3 ++- src/magic_uv/op/uv_inspection.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/magic_uv/op/texture_projection.py b/src/magic_uv/op/texture_projection.py index e508cbc..b92e20d 100644 --- a/src/magic_uv/op/texture_projection.py +++ b/src/magic_uv/op/texture_projection.py @@ -452,7 +452,8 @@ def execute(self, context): # 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/src/magic_uv/op/uv_inspection.py b/src/magic_uv/op/uv_inspection.py index e10af90..44e91d8 100644 --- a/src/magic_uv/op/uv_inspection.py +++ b/src/magic_uv/op/uv_inspection.py @@ -455,7 +455,8 @@ def execute(self, context): "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: