Cleanup: use utility method to get node group input usage

This also results in a small speedup because of the early exit
in is_group_input_used.
This commit is contained in:
Jacques Lucke
2025-09-28 21:19:19 +02:00
parent fa03d2558c
commit 96ce5ee0c0

View File

@@ -845,11 +845,8 @@ void infer_group_interface_usage(const bNodeTree &group,
{
/* Detect actually used inputs. */
SocketUsageInferencer inferencer{group, group_input_values, scope, compute_context_cache};
for (const bNode *node : group.group_input_nodes()) {
for (const int i : group.interface_inputs().index_range()) {
const bNodeSocket &socket = node->output_socket(i);
r_input_usages[i].is_used |= inferencer.is_socket_used({nullptr, &socket});
}
for (const int i : group.interface_inputs().index_range()) {
r_input_usages[i].is_used |= inferencer.is_group_input_used(i);
}
}
bool visibility_controlling_input_exists = false;