diff options
author | Bastien Montagne <bastien@blender.org> | 2021-03-17 13:37:10 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-03-17 13:38:31 +0300 |
commit | e6bdd57191e833f336fdb582418935b997395f98 (patch) | |
tree | 427b087799316f7cc58467b40d080584d9193b7e /source/blender/editors/undo | |
parent | ac60e6474569a69ffa4b9c28f9ae79ef674c5408 (diff) |
Fix T86609: GPencil: Sculpt brush cursor disappears on undo.
Regression from rB2a8122fb65c5, somehow that piece of code was lost
during the refactor.
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r-- | source/blender/editors/undo/ed_undo.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 989863b34af..b69f62a2875 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -224,6 +224,28 @@ static void ed_undo_step_post(bContext *C, Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); + ScrArea *area = CTX_wm_area(C); + + /* Set special modes for grease pencil */ + if (area != NULL && (area->spacetype == SPACE_VIEW3D)) { + Object *obact = CTX_data_active_object(C); + if (obact && (obact->type == OB_GPENCIL)) { + /* set cursor */ + if (ELEM(obact->mode, + OB_MODE_PAINT_GPENCIL, + OB_MODE_SCULPT_GPENCIL, + OB_MODE_WEIGHT_GPENCIL, + OB_MODE_VERTEX_GPENCIL)) { + ED_gpencil_toggle_brush_cursor(C, true, NULL); + } + else { + ED_gpencil_toggle_brush_cursor(C, false, NULL); + } + /* set workspace mode */ + Base *basact = CTX_data_active_base(C); + ED_object_base_activate(C, basact); + } + } /* App-Handlers (post). */ { |