diff options
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index e234b4255ed..ec5c4657b9c 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -90,6 +90,8 @@ void ED_node_tree_start(SpaceNode *snode, bNodeTree *ntree, ID *id, ID *from) snode->id = id; snode->from = from; + ED_node_set_active_viewer_key(snode); + WM_main_add_notifier(NC_SCENE | ND_NODES, NULL); } @@ -117,6 +119,8 @@ void ED_node_tree_push(SpaceNode *snode, bNodeTree *ntree, bNode *gnode) /* update current tree */ snode->edittree = ntree; + ED_node_set_active_viewer_key(snode); + WM_main_add_notifier(NC_SCENE | ND_NODES, NULL); } @@ -135,6 +139,8 @@ void ED_node_tree_pop(SpaceNode *snode) path = snode->treepath.last; snode->edittree = path->nodetree; + ED_node_set_active_viewer_key(snode); + /* listener updates the View2D center from edittree */ WM_main_add_notifier(NC_SCENE | ND_NODES, NULL); } @@ -208,6 +214,14 @@ void ED_node_tree_path_get_fixedbuf(SpaceNode *snode, char *value, int max_lengt } } +void ED_node_set_active_viewer_key(SpaceNode *snode) +{ + bNodeTreePath *path = snode->treepath.last; + if (snode->nodetree && path) { + snode->nodetree->active_viewer_key = path->parent_key; + } +} + void snode_group_offset(SpaceNode *snode, float *x, float *y) { bNodeTreePath *path = snode->treepath.last; |