diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-08-12 22:27:48 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-08-12 22:27:48 +0400 |
commit | a7dd2649406afec5cdd9267c136ca79c92c20fab (patch) | |
tree | ba0d639fba9190be729d1effbb49a153e44aad56 /source/blender/editors/space_node/node_select.c | |
parent | 0cb606a9bc76488031559e06717d576d5cc66dce (diff) |
Nodes: make node set active function usable outside of node editor, and in doing
so fix a missing updating when activating a node with multiple node editors open.
Diffstat (limited to 'source/blender/editors/space_node/node_select.c')
-rw-r--r-- | source/blender/editors/space_node/node_select.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 1abcaccc939..ca673277739 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -37,10 +37,12 @@ #include "DNA_scene_types.h" #include "BKE_context.h" +#include "BKE_main.h" #include "BLI_rect.h" #include "BLI_utildefines.h" +#include "ED_node.h" #include "ED_screen.h" #include "ED_types.h" @@ -70,7 +72,7 @@ static bNode *node_under_mouse(bNodeTree *ntree, int mx, int my) /* ****** Click Select ****** */ -static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const int mval[2], short extend) +static bNode *node_mouse_select(Main *bmain, SpaceNode *snode, ARegion *ar, const int mval[2], short extend) { bNode *node; float mx, my; @@ -92,7 +94,7 @@ static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const int mval[2] else node->flag ^= SELECT; - node_set_active(snode, node); + ED_node_set_active(bmain, snode->edittree, node); } return node; @@ -100,6 +102,7 @@ static bNode *node_mouse_select(SpaceNode *snode, ARegion *ar, const int mval[2] static int node_select_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); SpaceNode *snode= CTX_wm_space_node(C); ARegion *ar= CTX_wm_region(C); int mval[2]; @@ -113,7 +116,7 @@ static int node_select_exec(bContext *C, wmOperator *op) extend = RNA_boolean_get(op->ptr, "extend"); /* perform the select */ - node= node_mouse_select(snode, ar, mval, extend); + node= node_mouse_select(bmain, snode, ar, mval, extend); /* send notifiers */ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL); |