diff options
-rw-r--r-- | source/blender/modifiers/intern/MOD_nodes.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 6ea47881982..7740fe891e3 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -1049,17 +1049,6 @@ static void check_property_socket_sync(const Object *ob, ModifierData *md) continue; } } - - bool has_geometry_output = false; - LISTBASE_FOREACH (const bNodeSocket *, socket, &nmd->node_group->outputs) { - if (socket->type == SOCK_GEOMETRY) { - has_geometry_output = true; - } - } - - if (!has_geometry_output) { - BKE_modifier_set_error(ob, md, "Node group must have a geometry output"); - } } static void modifyGeometry(ModifierData *md, @@ -1078,6 +1067,7 @@ static void modifyGeometry(ModifierData *md, if (tree.has_link_cycles()) { BKE_modifier_set_error(ctx->object, md, "Node group has cycles"); + geometry_set.clear(); return; } @@ -1085,17 +1075,23 @@ static void modifyGeometry(ModifierData *md, Span<const NodeRef *> input_nodes = root_tree_ref.nodes_by_type("NodeGroupInput"); Span<const NodeRef *> output_nodes = root_tree_ref.nodes_by_type("NodeGroupOutput"); if (output_nodes.size() != 1) { + BKE_modifier_set_error(ctx->object, md, "Node group must have a single output node"); + geometry_set.clear(); return; } const NodeRef &output_node = *output_nodes[0]; Span<const InputSocketRef *> group_outputs = output_node.inputs().drop_back(1); if (group_outputs.is_empty()) { + BKE_modifier_set_error(ctx->object, md, "Node group must have an output socket"); + geometry_set.clear(); return; } const InputSocketRef *first_output_socket = group_outputs[0]; if (first_output_socket->idname() != "NodeSocketGeometry") { + BKE_modifier_set_error(ctx->object, md, "Node group's first output must be a geometry"); + geometry_set.clear(); return; } |