diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-10-28 02:10:00 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-10-28 02:10:00 +0300 |
commit | fd1487977b0d1a24b2076e1bdf72b6102821e6e4 (patch) | |
tree | e09feec01bb065aae3b840807ac62ec1e8b782d1 | |
parent | 16796c281352b4fbc5fd1ed5046c166aafd8cf64 (diff) |
Fix T46471: Sculpt strokes doesn't mark file as modified
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_hide.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_mask.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 8 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 4 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 10 |
8 files changed, 24 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index 2f1d4cd4194..5af6792f10f 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -417,7 +417,7 @@ static int hide_show_exec(bContext *C, wmOperator *op) MEM_freeN(nodes); /* end undo */ - sculpt_undo_push_end(); + sculpt_undo_push_end(C); /* ensure that edges and faces get hidden as well (not used by * sculpt but it looks wrong when entering editmode otherwise) */ diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 118f3a7571f..2f6314685e0 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -133,7 +133,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op) if (multires) multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED); - sculpt_undo_push_end(); + sculpt_undo_push_end(C); if (nodes) MEM_freeN(nodes); @@ -265,7 +265,7 @@ int ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *r if (multires) multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED); - sculpt_undo_push_end(); + sculpt_undo_push_end(C); ED_region_tag_redraw(ar); @@ -420,7 +420,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) if (multires) multires_mark_as_modified(ob, MULTIRES_COORDS_MODIFIED); - sculpt_undo_push_end(); + sculpt_undo_push_end(C); ED_region_tag_redraw(vc.ar); MEM_freeN((void *)mcords); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 07511e1924e..81c158aebf8 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4522,7 +4522,7 @@ static void sculpt_stroke_done(const bContext *C, struct PaintStroke *UNUSED(str sculpt_cache_free(ss->cache); ss->cache = NULL; - sculpt_undo_push_end(); + sculpt_undo_push_end(C); BKE_pbvh_update(ss->pbvh, PBVH_UpdateOriginalBB, NULL); @@ -4846,7 +4846,7 @@ static int sculpt_dynamic_topology_toggle_exec(bContext *C, wmOperator *UNUSED(o sculpt_dynamic_topology_enable(C); sculpt_undo_push_node(ob, NULL, SCULPT_UNDO_DYNTOPO_BEGIN); } - sculpt_undo_push_end(); + sculpt_undo_push_end(C); return OPERATOR_FINISHED; } @@ -5008,7 +5008,7 @@ static int sculpt_symmetrize_exec(bContext *C, wmOperator *UNUSED(op)) /* Finish undo */ BM_log_all_added(ss->bm, ss->bm_log); - sculpt_undo_push_end(); + sculpt_undo_push_end(C); /* Redraw */ sculpt_pbvh_clear(ob); @@ -5216,7 +5216,7 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *UNUSED(op)) } MEM_freeN(nodes); - sculpt_undo_push_end(); + sculpt_undo_push_end(C); /* force rebuild of pbvh for better BB placement */ sculpt_pbvh_clear(ob); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 8f1a4655c37..51af8788e60 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -118,7 +118,7 @@ typedef struct SculptUndoNode { SculptUndoNode *sculpt_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type); SculptUndoNode *sculpt_undo_get_node(PBVHNode *node); void sculpt_undo_push_begin(const char *name); -void sculpt_undo_push_end(void); +void sculpt_undo_push_end(const struct bContext *C); void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3]); diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 1f1be51b9a6..28fe526e952 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -884,7 +884,7 @@ void sculpt_undo_push_begin(const char *name) sculpt_undo_restore, sculpt_undo_free, sculpt_undo_cleanup); } -void sculpt_undo_push_end(void) +void sculpt_undo_push_end(const bContext *C) { ListBase *lb = undo_paint_push_get_list(UNDO_PAINT_MESH); SculptUndoNode *unode; @@ -901,4 +901,6 @@ void sculpt_undo_push_end(void) } ED_undo_paint_push_end(UNDO_PAINT_MESH); + + WM_file_tag_modified(C); } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index cd68df52ed4..483bb88b91c 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -111,11 +111,7 @@ void ED_undo_push(bContext *C, const char *str) BKE_undo_write(C, str); } - if (wm->file_saved) { - wm->file_saved = 0; - /* notifier that data changed, for save-over warning or header */ - WM_event_add_notifier(C, NC_WM | ND_DATACHANGED, NULL); - } + WM_file_tag_modified(C); } /* note: also check undo_history_exec() in bottom if you change notifiers */ diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 11407678e53..ca658632bbb 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -112,6 +112,7 @@ void WM_file_autoexec_init(const char *filepath); bool WM_file_read(struct bContext *C, const char *filepath, struct ReportList *reports); void WM_autosave_init(struct wmWindowManager *wm); void WM_recover_last_session(struct bContext *C, struct ReportList *reports); +void WM_file_tag_modified(const struct bContext *C); /* mouse cursors */ void WM_cursor_set(struct wmWindow *win, int curs); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 8288b2ed1ef..37fb4e5d89e 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -1314,3 +1314,13 @@ void wm_open_init_use_scripts(wmOperator *op, bool use_prefs) } /** \} */ + +void WM_file_tag_modified(const bContext *C) +{ + wmWindowManager *wm = CTX_wm_manager(C); + if (wm->file_saved) { + wm->file_saved = 0; + /* notifier that data changed, for save-over warning or header */ + WM_event_add_notifier(C, NC_WM | ND_DATACHANGED, NULL); + } +} |