Fix #133603: reroute node breaks graying out node group inputs

The evaluated value was not properly forwarded through reroute nodes.
This commit is contained in:
Jacques Lucke
2025-01-28 16:51:17 +01:00
parent 3eaa70c251
commit a15aaa3aa6

View File

@@ -492,6 +492,10 @@ struct SocketUsageInferencer {
this->value_task__output__group_input_node(socket);
return;
}
case NODE_REROUTE: {
this->value_task__output__reroute_node(socket);
return;
}
case GEO_NODE_SWITCH: {
this->value_task__output__generic_switch(socket, switch__is_socket_selected);
return;
@@ -565,6 +569,17 @@ struct SocketUsageInferencer {
all_socket_values_.add_new(socket, *value);
}
void value_task__output__reroute_node(const SocketInContext &socket)
{
const SocketInContext input_socket = socket.owner_node().input_socket(0);
const std::optional<const void *> value = all_socket_values_.lookup_try(input_socket);
if (!value.has_value()) {
this->push_value_task(input_socket);
return;
}
all_socket_values_.add_new(socket, *value);
}
/**
* Assumes that the first input is a condition that selects one of the remaining inputs which is
* then output. If necessary, this can trigger a value task for the condition socket.