More on bug #26432
authorTon Roosendaal <ton@blender.org>
Sat, 12 Mar 2011 15:09:29 +0000 (15:09 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 12 Mar 2011 15:09:29 +0000 (15:09 +0000)
More undo-push disabling for switching render slots.
Also added 'undo push' print in debug mode (blender -d)

source/blender/editors/space_image/image_ops.c
source/blender/editors/util/undo.c

index 3990f0916b17e28f8bb9b75a47e6f2886236e02a..93e5465cd64a942de90d3fbb412cb59a859f4694 100644 (file)
@@ -2134,7 +2134,7 @@ static int cycle_render_slot_exec(bContext *C, wmOperator *op)
        WM_event_add_notifier(C, NC_IMAGE|ND_DRAW, NULL);
 
        /* no undo push for browsing existing */
-       if(ima->renders[ima->render_slot])
+       if(ima->renders[ima->render_slot] || ima->render_slot==ima->last_render_slot)
                return OPERATOR_CANCELLED;
        
        return OPERATOR_FINISHED;
index b366a8460fcb71b7927a182cb3a4b044a3d8e685..2659863e592a14ea0559a6e5532faf3f00f92ac5 100644 (file)
@@ -80,6 +80,9 @@ void ED_undo_push(bContext *C, const char *str)
        Object *obedit= CTX_data_edit_object(C);
        Object *obact= CTX_data_active_object(C);
 
+       if (G.f & G_DEBUG)
+               printf("undo push %s\n", str);
+       
        if(obedit) {
                if (U.undosteps == 0) return;