Fix T92505: previewing specific node outputs did not work anymore

This was missing from my refactor in rB5bfe09df2244cb9de0b6554a378eecef77b1e75d.
This commit is contained in:
Jacques Lucke 2021-10-26 17:53:29 +02:00
parent efbd36429a
commit 01d7211380
Notes: blender-bot 2023-02-14 10:14:07 +01:00
Referenced by issue #92505, Previewing specific node outputs in Compositor no longer works like before
1 changed files with 8 additions and 0 deletions

View File

@ -768,6 +768,14 @@ static const NodeRef *get_existing_viewer(const NodeTreeRef &tree)
static const OutputSocketRef *find_output_socket_to_be_viewed(const NodeRef *active_viewer_node,
const NodeRef &node_to_view)
{
/* Check if any of the output sockets is selected, which is the case when the user just clicked
* on the socket. */
for (const OutputSocketRef *output_socket : node_to_view.outputs()) {
if (output_socket->bsocket()->flag & SELECT) {
return output_socket;
}
}
const OutputSocketRef *last_socket_linked_to_viewer = nullptr;
if (active_viewer_node != nullptr) {
for (const OutputSocketRef *output_socket : node_to_view.outputs()) {