Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-11-10 19:52:07 +0300
committerHans Goudey <h.goudey@me.com>2021-11-10 19:52:18 +0300
commit20224369d964efcd587b453030248da3c66343af (patch)
tree5331f8dd06bee318862ba0d24a15284c2111a1df
parent67e5edbaa3c82b7aef1bd8061f945719401c9252 (diff)
Geometry Nodes: Clarify modifier node group errors
This commit adds modifier error messages to some of the cases where the node group is configured improperly. It also clears the geometry set when there is an error with the node group. This is consistent to what we do in nodes themselves, and feels more intuitive than passing the input geometry through the node group silently. Fixes T87142
-rw-r--r--source/blender/modifiers/intern/MOD_nodes.cc18
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;
}