diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-02 16:31:09 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-02 16:31:09 +0400 |
commit | a2941a464b41c73f10ef3e559f509a9d4aefd3f5 (patch) | |
tree | 35a94ad813a520e29308fc81c4b5b5e0e3587c59 /source/blender | |
parent | e23e125c3481d86698659f5d11bf5437255f5b97 (diff) |
Fix #27098: missing 3d view updates when editing GLSL material nodes.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_header.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 9 |
4 files changed, 29 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 22bbd93de00..01f32b49888 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -51,6 +51,7 @@ #include "BLI_utildefines.h" #include "BKE_context.h" +#include "BKE_depsgraph.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_library.h" @@ -234,6 +235,11 @@ static bNode *editnode_get_active(bNodeTree *ntree) return nodeGetActive(ntree); } +void snode_dag_update(bContext *UNUSED(C), SpaceNode *snode) +{ + DAG_id_tag_update(snode->id, 0); +} + void snode_notify(bContext *C, SpaceNode *snode) { WM_event_add_notifier(C, NC_NODE|NA_EDITED, NULL); @@ -912,7 +918,8 @@ static int node_group_ungroup_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_SCENE|ND_NODES, NULL); + snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2014,6 +2021,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) node_tree_verify_groups(snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2169,6 +2177,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) ntreeSolveOrder(snode->edittree); node_tree_verify_groups(snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); BLI_remlink(&snode->linkdrag, nldrag); MEM_freeN(nldrag); @@ -2303,6 +2312,7 @@ static int node_make_link_exec(bContext *C, wmOperator *op) node_tree_verify_groups(snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2377,6 +2387,7 @@ static int cut_links_exec(bContext *C, wmOperator *op) ntreeSolveOrder(snode->edittree); node_tree_verify_groups(snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2436,6 +2447,8 @@ static int node_read_renderlayers_exec(bContext *C, wmOperator *UNUSED(op)) } snode_notify(C, snode); + snode_dag_update(C, snode); + return OPERATOR_FINISHED; } @@ -2464,6 +2477,7 @@ static int node_read_fullsamplelayers_exec(bContext *C, wmOperator *UNUSED(op)) RE_MergeFullSample(re, bmain, curscene, snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); WM_cursor_wait(0); return OPERATOR_FINISHED; @@ -2572,6 +2586,7 @@ static int node_group_make_exec(bContext *C, wmOperator *op) } snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2758,6 +2773,7 @@ static int node_mute_exec(bContext *C, wmOperator *UNUSED(op)) } snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2799,6 +2815,7 @@ static int node_delete_exec(bContext *C, wmOperator *UNUSED(op)) node_tree_verify_groups(snode->nodetree); snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } @@ -2900,6 +2917,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) node->id = (ID *)ima; snode_notify(C, snode); + snode_dag_update(C, snode); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index d7084d51180..a982f4b1994 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -102,6 +102,7 @@ static void do_node_add(bContext *C, void *UNUSED(arg), int event) } snode_notify(C, snode); + snode_dag_update(C, snode); } static void node_auto_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index fc1b579d1e1..fcf1c182600 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -95,6 +95,7 @@ void draw_nodespace_color_info(struct ARegion *ar, int color_manage, int channel /* node_edit.c */ void node_tree_from_ID(ID *id, bNodeTree **ntree, bNodeTree **edittree, int *treetype); void snode_notify(bContext *C, SpaceNode *snode); +void snode_dag_update(bContext *C, SpaceNode *snode); bNode *next_node(bNodeTree *ntree); bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float locy); void snode_set_context(SpaceNode *snode, Scene *scene); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 93d86f2d97b..b26883b8fd6 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -975,7 +975,14 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn) break; } break; - + case NC_MATERIAL: + switch(wmn->data) { + case ND_NODES: + if(v3d->drawtype == OB_TEXTURE) + ED_area_tag_redraw_regiontype(sa, RGN_TYPE_WINDOW); + break; + } + break; } #if 0 // removed since BKE_image_user_calc_frame is now called in draw_bgpic because screen_ops doesnt call the notifier. |