Fix T93085: Incorrect geometry nodes modifier warning

It's valid for a node group connected to the modifier not to
have a geometry input, but I didn't consider that case
with the last change I made here, f3bdabbe24.

Differential Revision: https://developer.blender.org/D13231
This commit is contained in:
Hans Goudey 2021-11-16 14:51:03 -06:00
parent 25d30e6c99
commit f30e1fd2f0
Notes: blender-bot 2023-02-14 05:50:03 +01:00
Referenced by issue #93085, Remove warning message: "The first group input must be a geometry"
1 changed files with 9 additions and 6 deletions

View File

@ -1031,11 +1031,9 @@ static void check_property_socket_sync(const Object *ob, ModifierData *md)
int i;
LISTBASE_FOREACH_INDEX (const bNodeSocket *, socket, &nmd->node_group->inputs, i) {
/* The first socket is the special geometry socket for the modifier object. */
if (i == 0) {
if (socket->type == SOCK_GEOMETRY) {
continue;
}
BKE_modifier_set_error(ob, md, "The first node group input must be a geometry");
if (i == 0 && socket->type == SOCK_GEOMETRY) {
geometry_socket_count++;
continue;
}
IDProperty *property = IDP_GetPropertyFromGroup(nmd->settings.properties, socket->identifier);
@ -1056,7 +1054,12 @@ static void check_property_socket_sync(const Object *ob, ModifierData *md)
}
}
if (geometry_socket_count > 1) {
if (geometry_socket_count == 1) {
if (((bNodeSocket *)nmd->node_group->inputs.first)->type != SOCK_GEOMETRY) {
BKE_modifier_set_error(ob, md, "Node group's geometry input must be the first");
}
}
else if (geometry_socket_count > 1) {
BKE_modifier_set_error(ob, md, "Node group can only have one geometry input");
}
}