From c94fe5e2995873536cbdb180652b1aa027e4ef8d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 6 Sep 2011 07:59:18 +0000 Subject: Grease pencil: non-blocking sketch sessions - Implement own undo stack for grease pencil, so now there'll be no keymaps conflicts. - Supported redo's during sketch session. - Get rid of flag stored in Globals -- use undo stack to check if grease pencil session is active. --- source/blender/editors/util/undo.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/util') diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index a2381a208ef..c1aca61f795 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -54,6 +54,7 @@ #include "ED_armature.h" #include "ED_particle.h" #include "ED_curve.h" +#include "ED_gpencil.h" #include "ED_mball.h" #include "ED_mesh.h" #include "ED_object.h" @@ -126,6 +127,11 @@ static int ed_undo_step(bContext *C, int step, const char *undoname) Object *obact= CTX_data_active_object(C); ScrArea *sa= CTX_wm_area(C); + /* grease pencil can be can be used in plenty of spaces, so check it first */ + if(ED_gpencil_session_active()) { + return ED_undo_gpencil_step(C, step, undoname); + } + if(sa && sa->spacetype==SPACE_IMAGE) { SpaceImage *sima= (SpaceImage *)sa->spacedata.first; -- cgit v1.2.3