Fix for #34739 and #35060, avoid ambiguity in compositor viewer nodes.
[blender.git] / source / blender / editors / space_node / node_select.c
index 366fcce3dd5290e876a1a7b1b8035355f1a6d928..ea745c4769000f30b7f67b474db8d37fb1ba080f 100644 (file)
@@ -293,6 +293,7 @@ void node_select_single(bContext *C, bNode *node)
        nodeSetSelected(node, TRUE);
        
        ED_node_set_active(bmain, snode->edittree, node);
+       ED_node_set_active_viewer_key(snode);
        
        ED_node_sort(snode->edittree);
        
@@ -374,8 +375,10 @@ static int node_mouse_select(Main *bmain, SpaceNode *snode, ARegion *ar, const i
        }
        
        /* update node order */
-       if (selected)
+       if (selected) {
+               ED_node_set_active_viewer_key(snode);
                ED_node_sort(snode->edittree);
+       }
        
        return selected;
 }