From a15aaa3aa63fae047fb842a00d488db0e683dfd0 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 28 Jan 2025 16:51:17 +0100 Subject: [PATCH] Fix #133603: reroute node breaks graying out node group inputs The evaluated value was not properly forwarded through reroute nodes. --- .../nodes/intern/socket_usage_inference.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/blender/nodes/intern/socket_usage_inference.cc b/source/blender/nodes/intern/socket_usage_inference.cc index 10bac6b5dda..410a5054a94 100644 --- a/source/blender/nodes/intern/socket_usage_inference.cc +++ b/source/blender/nodes/intern/socket_usage_inference.cc @@ -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 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.