Fix: Field type inference considers unavailable sockets

If a node had unused/unavailable inputs, they were still considered
when deciding whether the output is a field or not.
This commit is contained in:
Hans Goudey 2021-10-15 13:54:08 -05:00
parent 45e16a6c96
commit 4682aad432
Notes: blender-bot 2023-02-14 09:33:11 +01:00
Referenced by issue #92087, Red dashed line when evaluating "Position" node (or other fields node) when there is a Switch node down the evaluation line
1 changed files with 3 additions and 0 deletions

View File

@ -4858,6 +4858,9 @@ static void propagate_field_status_from_left_to_right(
case OutputSocketFieldType::DependentField: {
for (const InputSocketRef *input_socket :
gather_input_socket_dependencies(field_dependency, *node)) {
if (!input_socket->is_available()) {
continue;
}
if (!field_state_by_socket_id[input_socket->id()].is_single) {
state.is_single = false;
break;