diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 08:22:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-08 08:22:52 +0300 |
commit | 469d43b1dbc54d2afcbfe104a2d8ca9c03df9b81 (patch) | |
tree | 380520b1c0566a8f2687b42156c0cd82ff9a4e97 /source/blender/editors/sculpt_paint/paint_vertex.c | |
parent | bf593a8631e84a258d1c8e5e7b198b458811c11b (diff) |
WM: publish Object.mode changes on mode switching
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d5991ac67d4..196505c9542 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -68,6 +68,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "WM_message.h" #include "ED_object.h" #include "ED_mesh.h" @@ -1217,6 +1218,7 @@ void ED_object_wpaintmode_exit(struct bContext *C) */ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op) { + struct wmMsgBus *mbus = CTX_wm_message_bus(C); Object *ob = CTX_data_active_object(C); const int mode_flag = OB_MODE_WEIGHT_PAINT; const bool is_mode_set = (ob->mode & mode_flag) != 0; @@ -1248,6 +1250,8 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); + WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); + return OPERATOR_FINISHED; } @@ -2349,6 +2353,7 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) */ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op) { + struct wmMsgBus *mbus = CTX_wm_message_bus(C); Object *ob = CTX_data_active_object(C); const int mode_flag = OB_MODE_VERTEX_PAINT; const bool is_mode_set = (ob->mode & mode_flag) != 0; @@ -2379,6 +2384,8 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene); + WM_msg_publish_rna_prop(mbus, &ob->id, ob, Object, mode); + return OPERATOR_FINISHED; } |