2.5
authorTon Roosendaal <ton@blender.org>
Sat, 31 Jan 2009 19:40:40 +0000 (19:40 +0000)
committerTon Roosendaal <ton@blender.org>
Sat, 31 Jan 2009 19:40:40 +0000 (19:40 +0000)
Big commit, but mainly adminstration.

- Enabled ot->flag OPTYPE_UNDO to work.
- Removed all redundant ED_undo_pushes, but I'd
  recommend everyone to check it while testing. :)
- Added view manipulations as OPTYPE_REGISTER,
  although this will flood the redo stack a bit...
  Nevertheless; for a "redo last action" panel we
  can simply check if both flags are set for redo.

- Bugfix in editmode undo: selectmode was cleared,
  so you couldn't select after undo
- Bugfix in mixing tweaks and keymaps... solution
  works but is weak, need to think over a while.

35 files changed:
source/blender/editors/animation/anim_channels.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/keyframing.c
source/blender/editors/curve/editfont.c
source/blender/editors/include/ED_util.h
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/mesh/editmesh_add.c
source/blender/editors/mesh/editmesh_mods.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/editgroup.c
source/blender/editors/object/object_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt/sculpt.c
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_select.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_ipo/ipo_edit.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_select.c
source/blender/editors/space_node/node_state.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/space_view3d/vpaint.c
source/blender/editors/util/undo.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c

index 006ffc0..a744765 100644 (file)
@@ -549,7 +549,7 @@ void ANIM_OT_channels_move_up (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_enum(ot->srna, "direction", NULL /* XXX add enum for this */, REARRANGE_ACTCHAN_UP, "Direction", "");
@@ -566,7 +566,7 @@ void ANIM_OT_channels_move_down (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_enum(ot->srna, "direction", NULL /* XXX add enum for this */, REARRANGE_ACTCHAN_DOWN, "Direction", "");
@@ -583,7 +583,7 @@ void ANIM_OT_channels_move_top (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_enum(ot->srna, "direction", NULL /* XXX add enum for this */, REARRANGE_ACTCHAN_TOP, "Direction", "");
@@ -600,7 +600,7 @@ void ANIM_OT_channels_move_bottom (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_enum(ot->srna, "direction", NULL /* XXX add enum for this */, REARRANGE_ACTCHAN_BOTTOM, "Direction", "");
@@ -732,7 +732,7 @@ void ANIM_OT_channels_enable_setting (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
                /* flag-setting mode */
@@ -753,7 +753,7 @@ void ANIM_OT_channels_disable_setting (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
                /* flag-setting mode */
@@ -774,7 +774,7 @@ void ANIM_OT_channels_toggle_setting (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
                /* flag-setting mode */
@@ -816,7 +816,7 @@ void ANIM_OT_channels_deselectall (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
@@ -937,7 +937,7 @@ void ANIM_OT_channels_borderselect(wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
@@ -1248,6 +1248,9 @@ void ANIM_OT_channels_mouseclick (wmOperatorType *ot)
        ot->invoke= animchannels_mouseclick_invoke;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* id-props */
        RNA_def_boolean(ot->srna, "extend_select", 0, "Extend Select", ""); // SHIFTKEY
        RNA_def_boolean(ot->srna, "select_children_only", 0, "Select Children Only", ""); // CTRLKEY|SHIFTKEY
index 39ad92f..34d2767 100644 (file)
@@ -207,7 +207,6 @@ static int ed_marker_add(bContext *C, wmOperator *op)
        BLI_addtail(markers, marker);
        
        WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-       //BIF_undo_push("Add Marker");
        
        return OPERATOR_FINISHED;
 }
@@ -222,6 +221,8 @@ static void MARKER_OT_add(wmOperatorType *ot)
        ot->exec= ed_marker_add;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************************** transform markers *************************** */
@@ -474,6 +475,9 @@ static void MARKER_OT_move(wmOperatorType *ot)
        ot->modal= ed_marker_move_modal;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna storage */
        RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
 }
@@ -550,6 +554,9 @@ static void MARKER_OT_duplicate(wmOperatorType *ot)
        ot->modal= ed_marker_move_modal;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna storage */
        RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
 }
@@ -641,6 +648,9 @@ static void MARKER_OT_mouseselect(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= ed_marker_select_invoke;
        ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static void MARKER_OT_mouseselect_extend(wmOperatorType *ot)
@@ -652,6 +662,9 @@ static void MARKER_OT_mouseselect_extend(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= ed_marker_select_extend_invoke;
        ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* *************************** border select markers **************** */
@@ -731,6 +744,9 @@ static void MARKER_OT_border_select(wmOperatorType *ot)
        
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -791,6 +807,9 @@ static void MARKER_OT_select_all(wmOperatorType *ot)
        ot->invoke= ed_marker_select_all_invoke;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_boolean(ot->srna, "select_swap", 0, "Select Swap", "");
        RNA_def_int(ot->srna, "select_type", 0, INT_MIN, INT_MAX, "Select Type", "", INT_MIN, INT_MAX);
@@ -834,6 +853,9 @@ static void MARKER_OT_delete(wmOperatorType *ot)
        ot->exec= ed_marker_delete_exec;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 /* ************************** registration **********************************/
index d93f3b2..80b9ba9 100644 (file)
@@ -248,6 +248,9 @@ void ANIM_OT_previewrange_define(wmOperatorType *ot)
        
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
                /* used to define frame range */
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -274,8 +277,6 @@ static int previewrange_clear_exec(bContext *C, wmOperator *op)
        
        ED_area_tag_redraw(curarea);
        
-       //BIF_undo_push("Clear Preview Range");
-       
        return OPERATOR_FINISHED;
 } 
 
@@ -287,6 +288,11 @@ void ANIM_OT_previewrange_clear(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= previewrange_clear_exec;
+       
+       ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ****************** time display toggle operator ****************************/
@@ -349,6 +355,8 @@ void ANIM_OT_time_toggle(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= toggle_time_exec;
+       
+       ot->poll= ED_operator_areaactive;
 }
 
 /* ************************** registration **********************************/
index a476b56..ece982f 100644 (file)
@@ -2114,7 +2114,6 @@ static int insert_key_exec (bContext *C, wmOperator *op)
        
        /* send updates */
        ED_anim_dag_flush_update(C);    
-       ED_undo_push(C, "Insert Keyframe");
        
        if (mode == 3) // material color requires different notifiers
                WM_event_add_notifier(C, NC_MATERIAL|ND_KEYS, NULL);
@@ -2135,6 +2134,10 @@ void ANIM_OT_insert_keyframe (wmOperatorType *ot)
        /* callbacks */
        ot->invoke= WM_menu_invoke; // XXX we will need our own one eventually, to cope with the dynamic menus...
        ot->exec= insert_key_exec; 
+       ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
                // XXX update this for the latest RNA stuff styles...
@@ -2181,7 +2184,6 @@ static int delete_key_exec (bContext *C, wmOperator *op)
        
        /* send updates */
        ED_anim_dag_flush_update(C);    
-       ED_undo_push(C, "Delete Keyframe");
        
                // XXX what if it was a material keyframe?
        WM_event_add_notifier(C, NC_OBJECT|ND_KEYS, NULL);
@@ -2198,6 +2200,11 @@ void ANIM_OT_delete_keyframe (wmOperatorType *ot)
        /* callbacks */
        ot->invoke= WM_operator_confirm; // XXX we will need our own one eventually, to cope with the dynamic menus...
        ot->exec= delete_key_exec; 
+       
+       ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************************************* */
index ed621ac..431637f 100644 (file)
@@ -68,7 +68,6 @@
 #include "curve_intern.h"
 
 /* XXX */
-static void BIF_undo_push() {}
 static void error() {}
 static int okee() {return 0;}
 /* XXX */
@@ -472,7 +471,6 @@ void txt_export_to_objects(struct Text *text)
                linenum++;
                curline = curline->next;
        }
-       BIF_undo_push("Add Text as Objects");
 }
 
 static short next_word(Curve *cu)
@@ -932,8 +930,6 @@ static int do_textedit(bContext *C, wmOperator *op, wmEvent *evt)
                        DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                }                       
 
-               BIF_undo_push("Textedit");
-               
                WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, NULL); // XXX better note
 
        }
@@ -959,6 +955,8 @@ void FONT_OT_textedit(wmOperatorType *ot)
        ot->invoke= do_textedit;
        
        ot->poll= font_editmode;
+       
+       ot->flag = OPTYPE_UNDO;
 }
 
 
@@ -1006,7 +1004,6 @@ void paste_unicodeText(Scene *scene, char *filename)
                update_string(cu);
                BKE_text_to_curve(scene, obedit, 0);
                DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-               BIF_undo_push("Paste text");
        }
 }
 
@@ -1070,7 +1067,6 @@ void paste_editText(Scene *scene)
                update_string(cu);
                BKE_text_to_curve(scene, obedit, 0);
                DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-               BIF_undo_push("Paste text");
        }
 }
 
@@ -1109,7 +1105,6 @@ void make_editText(Object *obedit)
        update_string(cu);
        
        textediting= 1;
-       BIF_undo_push("Original");
 }
 
 
@@ -1161,7 +1156,6 @@ void remake_editText(Object *obedit)
 
        update_string(cu);
        
-       BIF_undo_push("Reload");
 }
 
 
@@ -1242,7 +1236,6 @@ void to_upper(Scene *scene)
                }
        }
        DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-       BIF_undo_push("To upper");
 
        update_string(cu);
 }
index 1fbf545..6f0c475 100644 (file)
@@ -32,6 +32,7 @@ struct Object;
 struct bContext;
 struct ARegion;
 struct uiBlock;
+struct wmOperator;
 struct wmOperatorType;
 
 /* ed_util.c */
@@ -42,6 +43,7 @@ void  ED_editors_exit                 (struct bContext *C);
 
 /* undo.c */
 void   ED_undo_push                    (struct bContext *C, char *str);
+void   ED_undo_push_op                 (struct bContext *C, struct wmOperator *op);
 void   ED_OT_undo                              (struct wmOperatorType *ot);
 void   ED_OT_redo                              (struct wmOperatorType *ot);
 
index b62877b..f2dd689 100644 (file)
 /* ***************** XXX **************** */
 static int sample_backbuf_rect() {return 0;}
 static int sample_backbuf() {return 0;}
-static void BIF_undo_push() {}
 static void error() {}
 static int pupmenu() {return 0;}
 /* ***************** XXX **************** */
@@ -592,8 +591,6 @@ static void calculate_uv_map(Scene *scene, ARegion *ar, View3D *v3d, EditMesh *e
                correct_uv_aspect(em);
        }
        
-       BIF_undo_push("UV calculation");
-
 // XXX notifier        object_uvs_changed(OBACT);
 
 }
@@ -653,8 +650,6 @@ void reveal_tface(Scene *scene)
                mface++;
        }
 
-       BIF_undo_push("Reveal face");
-
 // XXX notifier!       object_tface_flags_changed(OBACT, 0);
 }
 
@@ -690,8 +685,6 @@ void hide_tface(Scene *scene)
                mface++;
        }
 
-       BIF_undo_push("Hide face");
-
 // XXX notifier!               object_tface_flags_changed(OBACT, 0);
 }
 
@@ -746,8 +739,6 @@ void deselectall_tface(Scene *scene)
                mface++;
        }
 
-       BIF_undo_push("(De)select all faces");
-
 // XXX notifier!               object_tface_flags_changed(OBACT, 0);
 }
 
@@ -771,8 +762,6 @@ void selectswap_tface(Scene *scene)
                mface++;
        }
 
-       BIF_undo_push("Select inverse face");
-
 // XXX notifier!               object_tface_flags_changed(OBACT, 0);
 }
 
@@ -1105,7 +1094,6 @@ void seam_mark_clear_tface(Scene *scene, short mode)
 //             unwrap_lscm(1);
 
        me->drawflag |= ME_DRAWSEAMS;
-       BIF_undo_push("Mark Seam");
 
 // XXX notifier!               object_tface_flags_changed(OBACT, 1);
 }
@@ -1154,7 +1142,6 @@ void face_select(Scene *scene, View3D *v3d)
        
        /* image window redraw */
        
-       BIF_undo_push("Select UV face");
 
 // XXX notifier!               object_tface_flags_changed(OBACT, 1);
 }
@@ -1216,7 +1203,6 @@ void face_borderselect(Scene *scene, ARegion *ar)
                IMB_freeImBuf(ibuf);
                MEM_freeN(selar);
 
-               BIF_undo_push("Border Select UV face");
 
 // XXX notifier!                       object_tface_flags_changed(OBACT, 0);
        }
index 77371fd..9e24e52 100644 (file)
@@ -1621,7 +1621,7 @@ void MESH_OT_separate(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_separate_types, 0, "Type", "");
 }
@@ -1807,13 +1807,13 @@ static void undoMesh_to_editMesh(void *umv, void *emv)
        EditSelectionC *esec;
        int a=0;
 
-       em->selectmode = um->selectmode;
-       
        free_editMesh(em);
        
        /* malloc blocks */
        memset(em, 0, sizeof(EditMesh));
                
+       em->selectmode = um->selectmode;
+       
        init_editmesh_fastmalloc(em, um->totvert, um->totedge, um->totface);
 
        CustomData_free(&em->vdata, 0);
index 72c2e60..e16ec86 100644 (file)
@@ -75,7 +75,6 @@
 /* bpymenu removed XXX */
 
 /* XXX */
-static void BIF_undo_push() {}
 static void error() {}
 #define add_numbut(a, b, c, d, e, f, g) {}
 /* XXX */
@@ -257,7 +256,7 @@ void MESH_OT_dupli_extrude_cursor(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -383,6 +382,9 @@ void MESH_OT_make_fgon(struct wmOperatorType *ot)
        /* api callbacks */
        ot->exec= make_fgon_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int clear_fgon_exec(bContext *C, wmOperator *op)
@@ -409,6 +411,9 @@ void MESH_OT_clear_fgon(struct wmOperatorType *ot)
        /* api callbacks */
        ot->exec= clear_fgon_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* precondition; 4 vertices selected, check for 4 edges and create face */
@@ -674,7 +679,6 @@ void addfaces_from_edgenet(EditMesh *em)
 
        EM_select_flush(em);
        
-       BIF_undo_push("Add faces");
 // XXX DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 }
 
@@ -703,7 +707,6 @@ static void addedgeface_mesh(EditMesh *em)
        if(amount==2) {
                eed= addedgelist(em, neweve[0], neweve[1], NULL);
                EM_select_edge(eed, 1);
-               BIF_undo_push("Add edge");
 
                // XXX          DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); 
                return;
@@ -802,7 +805,6 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op)
        
        addedgeface_mesh(em);
        
-       ED_undo_push(C, "Make Edge/Face");      // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA);     
@@ -819,6 +821,10 @@ void MESH_OT_add_edge_face(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= addedgeface_mesh_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 
@@ -1323,7 +1329,6 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
        
        make_prim(obedit, PRIM_PLANE, mat, 4, 0, 0, dia, 0.0f, 0, 1);
        
-       ED_undo_push(C, "Add Plane");   // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1340,7 +1345,7 @@ void MESH_OT_add_primitive_plane(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int add_primitive_cube_exec(bContext *C, wmOperator *op)
@@ -1354,7 +1359,6 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
        
        make_prim(obedit, PRIM_CUBE, mat, 4, 0, 0, dia, 1.0f, 1, 1);
        
-       ED_undo_push(C, "Add Cube");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1371,7 +1375,7 @@ void MESH_OT_add_primitive_cube(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int add_primitive_circle_exec(bContext *C, wmOperator *op)
@@ -1385,7 +1389,6 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
        make_prim(obedit, PRIM_CIRCLE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 0.0f, 0, 
                          RNA_boolean_get(op->ptr, "fill"));
        
-       ED_undo_push(C, "Add Circle");  // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1400,9 +1403,9 @@ void MESH_OT_add_primitive_circle(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_circle_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 3, 500);
@@ -1421,7 +1424,6 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
        make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 
                          RNA_float_get(op->ptr, "depth"), 1, 1);
        
-       ED_undo_push(C, "Add Cylinder");        // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1436,9 +1438,9 @@ void MESH_OT_add_primitive_cylinder(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_cylinder_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
@@ -1457,7 +1459,6 @@ static int add_primitive_tube_exec(bContext *C, wmOperator *op)
        make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 
                          RNA_float_get(op->ptr, "depth"), 1, 0);
        
-       ED_undo_push(C, "Add Tube");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1472,9 +1473,9 @@ void MESH_OT_add_primitive_tube(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_tube_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
@@ -1493,7 +1494,6 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
        make_prim(obedit, PRIM_CONE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 
                          RNA_float_get(op->ptr, "depth"), 0, RNA_boolean_get(op->ptr, "cap_end"));
        
-       ED_undo_push(C, "Add Cone");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1508,9 +1508,9 @@ void MESH_OT_add_primitive_cone(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_cone_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
@@ -1531,7 +1531,6 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
        make_prim(obedit, PRIM_GRID, mat, RNA_int_get(op->ptr, "x_subdivisions"), 
                          RNA_int_get(op->ptr, "y_subdivisions"), 0, dia, 0.0f, 0, 1);
        
-       ED_undo_push(C, "Add Grid");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1548,7 +1547,7 @@ void MESH_OT_add_primitive_grid(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "x_subdivisions", 10, INT_MIN, INT_MAX, "X Subdivisions", "", 3, 1000);
@@ -1565,7 +1564,6 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
        
        make_prim(obedit, PRIM_MONKEY, mat, 0, 0, 2, 0.0f, 0.0f, 0, 0);
        
-       ED_undo_push(C, "Add Monkey");  // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -1582,7 +1580,7 @@ void MESH_OT_add_primitive_monkey(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
@@ -1610,9 +1608,9 @@ void MESH_OT_add_primitive_uv_sphere(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= add_primitive_uvsphere_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "segments", 32, INT_MIN, INT_MAX, "Segments", "", 3, 500);
@@ -1647,7 +1645,7 @@ void MESH_OT_add_primitive_ico_sphere(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_int(ot->srna, "subdivisions", 2, 0, 6, "Subdivisions", "", 0, 8);
index c32fe9c..f7a1e15 100644 (file)
@@ -90,7 +90,7 @@ editmesh_mods.c, UI level access, no geometry changes
 
 #include "BLO_sys_types.h" // for intptr_t support
 
-static void BIF_undo_push() {}
+/* XXX */
 static void waitcursor() {}
 static void error() {}
 static int pupmenu() {return 0;}
@@ -826,6 +826,9 @@ void MESH_OT_similar_face_select(wmOperatorType *ot)
        ot->exec= similar_face_select_exec;
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_simface_types, 0, "Type", "");
 }
@@ -1082,6 +1085,9 @@ void MESH_OT_similar_edge_select(wmOperatorType *ot)
        ot->exec= similar_edge_select_exec;
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_simedge_types, 0, "Type", "");
 }
@@ -1236,6 +1242,9 @@ void MESH_OT_similar_vertex_select(wmOperatorType *ot)
        ot->exec= similar_vert_select_exec;
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_simvertex_types, 0, "Type", "");
 }
@@ -1367,7 +1376,6 @@ void EM_mesh_copy_edge(EditMesh *em, short type)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                
-               BIF_undo_push("Copy Edge Attribute");
        }
 }
 
@@ -1496,7 +1504,6 @@ void EM_mesh_copy_face(EditMesh *em, short type)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                
-               BIF_undo_push("Copy Face Attribute");
        }
 }
 
@@ -1627,7 +1634,6 @@ void EM_mesh_copy_face_layer(EditMesh *em, short type)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                
-               BIF_undo_push("Copy Face Layer");
        }
 }
 
@@ -1932,7 +1938,6 @@ void loop_multiselect(EditMesh *em, int looptype)
                        edgering_select(em, eed,SELECT);
                }
                EM_selectmode_flush(em);
-               BIF_undo_push("Edge Ring Multi-Select");
        }
        else{
                for(edindex = 0; edindex < edfirstcount; edindex +=1){
@@ -1940,7 +1945,6 @@ void loop_multiselect(EditMesh *em, int looptype)
                        edgeloop_select(em, eed,SELECT);
                }
                EM_selectmode_flush(em);
-               BIF_undo_push("Edge Loop Multi-Select");
        }
        MEM_freeN(edarray);
 //     if (EM_texFaceCheck())
@@ -2021,6 +2025,9 @@ void MESH_OT_loop_select(wmOperatorType *ot)
        ot->invoke= mesh_loop_select_invoke;
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
        RNA_def_boolean(ot->srna, "ring", 0, "Select Ring", "");
@@ -2122,6 +2129,9 @@ void MESH_OT_shortest_path_select(wmOperatorType *ot)
        ot->invoke= mesh_shortest_path_select_invoke;
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", "");
 }
@@ -2239,7 +2249,6 @@ void selectconnected_mesh_all(EditMesh *em)
        EM_select_flush(em);
        
 //     if (EM_texFaceCheck())
-       BIF_undo_push("Select Connected (All)");
 }
 
 static int selectconnected_mesh_all_exec(bContext *C, wmOperator *op)
@@ -2262,7 +2271,10 @@ void MESH_OT_selectconnected_mesh_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= selectconnected_mesh_all_exec;
        ot->poll= ED_operator_editmesh;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 /* *********** select connected ************* */
@@ -2342,8 +2354,6 @@ static int selectconnected_mesh_invoke(bContext *C, wmOperator *op, wmEvent *eve
        
 //     if (EM_texFaceCheck())
        
-       BIF_undo_push("Select Linked");
-       
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        return OPERATOR_FINISHED;       
 }
@@ -2357,7 +2367,10 @@ void MESH_OT_selectconnected_mesh(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= selectconnected_mesh_invoke;
        ot->poll= ED_operator_editmesh;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_boolean(ot->srna, "deselect", 0, "Deselect", "");
 }
 
@@ -2451,8 +2464,6 @@ static void selectconnected_delimit_mesh__internal(ViewContext *vc, short all, s
        
 //     if (EM_texFaceCheck())
        
-       BIF_undo_push("Select Linked Delimeted");
-       
 }
 
 #undef is_edge_delimit_ok
@@ -2571,7 +2582,6 @@ void hide_mesh(EditMesh *em, int swap)
 //     if(EM_texFaceCheck())
 
        //      DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); 
-       BIF_undo_push("Hide");
 }
 
 static int hide_mesh_exec(bContext *C, wmOperator *op)
@@ -2600,7 +2610,7 @@ void MESH_OT_hide_mesh(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_boolean(ot->srna, "swap", 0, "Swap", "");
@@ -2640,7 +2650,6 @@ void reveal_mesh(EditMesh *em)
 
 //     if (EM_texFaceCheck())
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); 
-       BIF_undo_push("Reveal");
 }
 
 static int reveal_mesh_exec(bContext *C, wmOperator *op)
@@ -2663,6 +2672,9 @@ void MESH_OT_reveal_mesh(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= reveal_mesh_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void hide_tface_uv(EditMesh *em, int swap)
@@ -2777,8 +2789,6 @@ void hide_tface_uv(EditMesh *em, int swap)
        
        EM_validate_selections();
        
-       BIF_undo_push("Hide UV");
-
 // XXX object_tface_flags_changed(OBACT, 0);
 #endif
 }
@@ -2885,8 +2895,6 @@ void reveal_tface_uv(EditMesh *em)
                }
        }
        
-       BIF_undo_push("Reveal UV");
-       
 // XXX object_tface_flags_changed(OBACT, 0);
 #endif
 }
@@ -2918,12 +2926,6 @@ void select_faces_by_numverts(EditMesh *em, int numverts)
 
 //     if (EM_texFaceCheck())
        
-       if (numverts==3)
-               BIF_undo_push("Select Triangles");
-       else if (numverts==4)
-               BIF_undo_push("Select Quads");
-       else
-               BIF_undo_push("Select non-Triangles/Quads");
 }
 
 static int select_sharp_edges_exec(bContext *C, wmOperator *op)
@@ -3022,7 +3024,6 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op)
 
 //     if (EM_texFaceCheck())
        
-       BIF_undo_push("Select Sharp Edges");
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); //TODO is this needed ?
        return OPERATOR_FINISHED;       
 }
@@ -3038,7 +3039,7 @@ void MESH_OT_select_sharp_edges(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_float(ot->srna, "sharpness", 0.01f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f);
@@ -3179,7 +3180,6 @@ static void select_linked_flat_faces(EditMesh *em, float sharpness)
 
 //     if (EM_texFaceCheck())
 
-       BIF_undo_push("Select Linked Flat Faces");
 }
 
 static int select_linked_flat_faces_exec(bContext *C, wmOperator *op)
@@ -3204,7 +3204,7 @@ void MESH_OT_select_linked_flat_faces(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_float(ot->srna, "sharpness", 0.0f, 0.0f, FLT_MAX, "sharpness", "", 0.0f, 180.0f);
@@ -3278,7 +3278,6 @@ void select_non_manifold(EditMesh *em)
 
 //     if (EM_texFaceCheck())
 
-       BIF_undo_push("Select Non Manifold");
 }
 
 static int select_non_manifold_exec(bContext *C, wmOperator *op)
@@ -3301,6 +3300,9 @@ void MESH_OT_select_non_manifold(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= select_non_manifold_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void selectswap_mesh(EditMesh *em) /* UI level */
@@ -3337,8 +3339,6 @@ void selectswap_mesh(EditMesh *em) /* UI level */
        
 //     if (EM_texFaceCheck())
 
-       BIF_undo_push("Select Swap");
-       
 }
 
 static int selectswap_mesh_exec(bContext *C, wmOperator *op)
@@ -3361,6 +3361,9 @@ void MESH_OT_selectswap_mesh(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= selectswap_mesh_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
        
 /* ******************** (de)select all operator **************** */
@@ -3372,11 +3375,9 @@ static int toggle_select_all_exec(bContext *C, wmOperator *op)
        
        if( EM_nvertices_selected(em) ) {
                EM_clear_flag_all(em, SELECT);
-               BIF_undo_push("Deselect All");
        }
        else  {
                EM_set_flag_all(em, SELECT);
-               BIF_undo_push("Select All");
        }
                
 //             if (EM_texFaceCheck())
@@ -3394,6 +3395,9 @@ void MESH_OT_de_select_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= toggle_select_all_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** **************** */
@@ -3446,8 +3450,6 @@ static int select_more(bContext *C, wmOperator *op)
 
 //     if (EM_texFaceCheck(em))
 
-       BIF_undo_push("Select More");
-
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        return OPERATOR_FINISHED;
 }
@@ -3461,6 +3463,9 @@ void MESH_OT_select_more(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= select_more;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void EM_select_less(EditMesh *em)
@@ -3531,8 +3536,6 @@ static int select_less(bContext *C, wmOperator *op)
 
        EM_select_less(em);
 
-       BIF_undo_push("Select Less");
-
 //     if (EM_texFaceCheck(em))
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        return OPERATOR_FINISHED;
@@ -3547,6 +3550,9 @@ void MESH_OT_select_less(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= select_less;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void selectrandom_mesh(EditMesh *em) /* randomly selects a user-set % of vertices/edges/faces */
@@ -3569,7 +3575,6 @@ void selectrandom_mesh(EditMesh *em) /* randomly selects a user-set % of vertice
                        }
                }
                EM_selectmode_flush(em);
-               BIF_undo_push("Select Random: Vertices");
        }
        else if(em->selectmode & SCE_SELECT_EDGE) {
                for(eed= em->edges.first; eed; eed= eed->next) {
@@ -3579,7 +3584,6 @@ void selectrandom_mesh(EditMesh *em) /* randomly selects a user-set % of vertice
                        }
                }
                EM_selectmode_flush(em);
-               BIF_undo_push("Select Random:Edges");
        }
        else {
                for(efa= em->faces.first; efa; efa= efa->next) {
@@ -3590,7 +3594,6 @@ void selectrandom_mesh(EditMesh *em) /* randomly selects a user-set % of vertice
                }
                
                EM_selectmode_flush(em);
-               BIF_undo_push("Select Random:Faces");
        }
 //     if (EM_texFaceCheck())
 }
@@ -3636,20 +3639,17 @@ void EM_selectmode_menu(EditMesh *em)
                if(val==1){ 
                        em->selectmode= SCE_SELECT_VERTEX;
                        EM_selectmode_set(em);
-                       BIF_undo_push("Selectmode Set: Vertex");
                        }
                else if(val==2){
                        if(ctrl) EM_convertsel(em, em->selectmode, SCE_SELECT_EDGE);
                        em->selectmode= SCE_SELECT_EDGE;
                        EM_selectmode_set(em);
-                       BIF_undo_push("Selectmode Set: Edge");
                }
                
                else{
                        if((ctrl)) EM_convertsel(em, em->selectmode, SCE_SELECT_FACE);
                        em->selectmode= SCE_SELECT_FACE;
                        EM_selectmode_set(em);
-                       BIF_undo_push("Selectmode Set: Vertex");
                }
                
 //             if (EM_texFaceCheck())
@@ -3676,7 +3676,6 @@ void editmesh_mark_seam(EditMesh *em, int clear)
                        }
                        eed= eed->next;
                }
-               BIF_undo_push("Mark Seam");
        }
        else {
                eed= em->edges.first;
@@ -3686,7 +3685,6 @@ void editmesh_mark_seam(EditMesh *em, int clear)
                        }
                        eed= eed->next;
                }
-               BIF_undo_push("Clear Seam");
        }
 
 }
@@ -3740,7 +3738,6 @@ void Vertex_Menu(EditMesh *em)
        {
                case 1:
 // XXX                 notice("Removed %d Vertices", removedoublesflag(1, 0, scene->toolsettings->doublimit));
-                       BIF_undo_push("Remove Doubles");
                        break;
                case 2: 
 // XXX                 mergemenu(em);
@@ -3750,7 +3747,6 @@ void Vertex_Menu(EditMesh *em)
                        break;
                case 4:
 // XXX                 pathselect(em);
-                       BIF_undo_push("Select Vertex Path");
                        break;
                case 5: 
 // XXX                 shape_copy_select_from(em);
@@ -3786,11 +3782,9 @@ void Edge_Menu(EditMesh *em)
                break;
        case 5:
 //             EdgeSlide(em, 0,0.0);
-  //           BIF_undo_push("EdgeSlide");
                break;
        case 6:
 //             CutEdgeloop(em, 1);
-               BIF_undo_push("Loopcut New");
                break;
        case 7:
 //             loop_multiselect(em, 0);
@@ -3806,12 +3800,10 @@ void Edge_Menu(EditMesh *em)
                break;
        case 11:
 //             editmesh_mark_sharp(em, 1);
-               BIF_undo_push("Mark Sharp");
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                break;
        case 12: 
 //             editmesh_mark_sharp(em, 0);
-               BIF_undo_push("Clear Sharp");
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
                break;
        }
@@ -3834,7 +3826,6 @@ void Face_Menu(EditMesh *em)
                case 1:
 //                     flip_editnormals(em);
 //                     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-                       BIF_undo_push("Flip Normals");
                        break;
                case 2:
 //                     bevel_menu(em);
@@ -4121,7 +4112,7 @@ void MESH_OT_consistant_normals(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_boolean(ot->srna, "inside", 0, "Inside", "");
 }
@@ -4431,7 +4422,6 @@ void vertexsmooth(Object *obedit, EditMesh *em)
 
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Vertex Smooth");
 }
 
 void vertexnoise(Object *obedit, EditMesh *em)
@@ -4477,7 +4467,6 @@ void vertexnoise(Object *obedit, EditMesh *em)
        recalc_editnormals(em);
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Vertex Noise");
 }
 
 void vertices_to_sphere(Scene *scene, View3D *v3d, Object *obedit, EditMesh *em)
@@ -4536,6 +4525,5 @@ void vertices_to_sphere(Scene *scene, View3D *v3d, Object *obedit, EditMesh *em)
        recalc_editnormals(em);
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("To Sphere");
 }
 
index 23a810b..b3085a6 100644 (file)
@@ -94,7 +94,6 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise
 #include "mesh_intern.h"
 
 /* XXX */
-static void BIF_undo_push() {}
 static int extern_qread() {return 0;}
 static void waitcursor() {}
 static void error() {}
@@ -181,7 +180,6 @@ void convert_to_triface(EditMesh *em, int direction)
        
        EM_fgon_flags(em);      // redo flags and indices for fgons
 
-       BIF_undo_push("Convert Quads to Triangles");
        
 }
 
@@ -494,7 +492,6 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op)
 
        removedoublesflag(em,1,0,scene->toolsettings->doublimit);
                
-       ED_undo_push(C, "Remove Doubles");      // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -509,6 +506,9 @@ void MESH_OT_removedoublesflag(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= removedoublesflag_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 // XXX is this needed?
@@ -555,8 +555,6 @@ void xsortvert_flag(bContext *C, int flag)
        
        MEM_freeN(sortblock);
 
-       BIF_undo_push("Xsort");
-       
 }
 
 /* called from buttons */
@@ -615,8 +613,6 @@ void hashvert_flag(EditMesh *em, int flag)
        
        MEM_freeN(sortblock);
 
-       BIF_undo_push("Hash");
-
 }
 
 /* generic extern called extruder */
@@ -702,7 +698,6 @@ static int extrude_mesh_exec(bContext *C, wmOperator *op)
 
        extrude_mesh(obedit,em);
                
-       ED_undo_push(C, "Extrude Mesh");        // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -717,6 +712,9 @@ void MESH_OT_extrude_mesh(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= extrude_mesh_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void split_mesh(EditMesh *em)
@@ -734,8 +732,6 @@ void split_mesh(EditMesh *em)
 
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Split");
-
 }
 
 void extrude_repeat_mesh(RegionView3D *rv3d, Object *obedit, EditMesh *em, int steps, float offs)
@@ -768,7 +764,6 @@ void extrude_repeat_mesh(RegionView3D *rv3d, Object *obedit, EditMesh *em, int s
        
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Extrude Repeat");
 }
 
 void spin_mesh(View3D *v3d, Object *obedit, EditMesh *em, int steps, float degr, float *dvec, int mode)
@@ -853,8 +848,6 @@ void spin_mesh(View3D *v3d, Object *obedit, EditMesh *em, int steps, float degr,
 
        //      DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       
-       if(dvec==NULL) BIF_undo_push("Spin");
 }
 
 void screw_mesh(Object *obedit, EditMesh *em, int steps, int turns)
@@ -915,7 +908,6 @@ void screw_mesh(Object *obedit, EditMesh *em, int steps, int turns)
 
        spin_mesh(v3d, obedit, em, turns*steps, turns*360, dvec, 0);
 
-       BIF_undo_push("Spin");
 }
 
 
@@ -1102,7 +1094,6 @@ void delete_mesh(Object *obedit, EditMesh *em, int event)
        EM_fgon_flags(em);      // redo flags and indices for fgons
 
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-       BIF_undo_push(str);
 }
 
 static int delete_mesh_exec(bContext *C, wmOperator *op)
@@ -1112,7 +1103,6 @@ static int delete_mesh_exec(bContext *C, wmOperator *op)
        
        delete_mesh(obedit,em,RNA_int_get(op->ptr, "event"));
        
-       ED_undo_push(C, "Delete Mesh"); // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -1156,6 +1146,9 @@ void MESH_OT_delete_mesh(wmOperatorType *ot)
        
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /*props */
        RNA_def_int(ot->srna, "event", 0, 0, INT_MAX, "event", "", 0, 1000);
 }
@@ -1240,7 +1233,6 @@ void fill_mesh(EditMesh *em)
        EM_select_flush(em);
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Fill");
 }
 /*GB*/
 /*-------------------------------------------------------------------------------*/
@@ -3170,7 +3162,6 @@ void beauty_fill(EditMesh *em)
        
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Beauty Fill");
 }
 
 
@@ -3472,7 +3463,6 @@ void join_triangles(EditMesh *em)
        EM_selectmode_flush(em);
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Convert Triangles to Quads");
 }
 /* ******************** END TRIANGLE TO QUAD ************************************* */
 
@@ -3570,8 +3560,6 @@ void edge_flip(EditMesh *em)
        
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Flip Triangle Edges");
-       
 }
 
 static void edge_rotate(EditMesh *em, EditEdge *eed,int dir)
@@ -3807,7 +3795,6 @@ void edge_rotate_selected(EditMesh *em, int dir)
        
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-       BIF_undo_push("Rotate Edge");   
 }
 
 /******************* BEVEL CODE STARTS HERE ********************/
@@ -3834,7 +3821,7 @@ void bevel_menu(EditMesh *em)
                options = G.editBMesh->options;
                res = G.editBMesh->res;
                bm = BME_editmesh_to_bmesh(em);
-               BIF_undo_push("Pre-Bevel");
+//             BIF_undo_push("Pre-Bevel");
                free_editMesh(em);
                BME_bevel(bm,0.1f,res,options,0,0,&td);
                BME_bmesh_to_editmesh(bm, td, em);
@@ -4772,9 +4759,6 @@ void mesh_set_face_flags(EditMesh *em, short mode)
                efa= efa->next;
        }
        
-       if (change) {
-               BIF_undo_push((mode ? "Set Flags" : "Clear Flags"));
-       }
 }
 
 void mesh_set_smooth_faces(EditMesh *em, short event)
@@ -4794,8 +4778,6 @@ void mesh_set_smooth_faces(EditMesh *em, short event)
        
 //     DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        
-       if(event==1) BIF_undo_push("Set Smooth");
-       else if(event==0) BIF_undo_push("Set Solid");
 }
 
 /* helper to find edge for edge_rip */
@@ -5074,7 +5056,6 @@ void shape_propagate(Scene *scene, Object *obedit, EditMesh *em)
                }
        }               
 
-       BIF_undo_push("Propagate Blendshape Verts");
        DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        return; 
 }
@@ -5149,8 +5130,7 @@ void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock
                        } 
                }
        }
-       if(!canceled)                                           
-               BIF_undo_push("Copy Blendshape Verts");
+       if(!canceled);
        else
                for(ev = em->verts.first; ev ; ev = ev->next){
                        if(ev->f & SELECT){
@@ -5980,8 +5960,6 @@ void region_to_loop(EditMesh *em)
 
 //             if (EM_texFaceCheck())
 
-               BIF_undo_push("Face Region to Edge Loop");
-
        }
 }
 
@@ -6139,7 +6117,6 @@ void loop_to_region(EditMesh *em)
 
 //     if (EM_texFaceCheck())
 
-       BIF_undo_push("Edge Loop to Face Region");
 }
 
 
@@ -6209,7 +6186,6 @@ void mesh_rotate_uvs(EditMesh *em)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-               BIF_undo_push("Rotate UV face");
        }
 }
 
@@ -6292,7 +6268,6 @@ void mesh_mirror_uvs(EditMesh *em)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-               BIF_undo_push("Mirror UV face");
        }
 }
 
@@ -6342,7 +6317,6 @@ void mesh_rotate_colors(EditMesh *em)
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
 
-               BIF_undo_push("Rotate Color face");
        }       
 }
 
@@ -6391,7 +6365,6 @@ void mesh_mirror_colors(EditMesh *em)
        
        if (change) {
 //             DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
-               BIF_undo_push("Mirror Color face");
        }
 }
 
@@ -6403,7 +6376,6 @@ static int subdivide_exec(bContext *C, wmOperator *op)
        
        esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, 1, 0);
                
-       ED_undo_push(C, "Subdivide");   // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -6418,6 +6390,9 @@ void MESH_OT_subdivide(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= subdivide_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int subdivide_multi_exec(bContext *C, wmOperator *op)
@@ -6428,7 +6403,6 @@ static int subdivide_multi_exec(bContext *C, wmOperator *op)
        
        esubdivideflag(obedit, em, 1, 0.0, scene->toolsettings->editbutflag, RNA_int_get(op->ptr,"number_cuts"), 0);
                
-       ED_undo_push(C, "Subdivide Multi");     // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -6443,13 +6417,11 @@ void MESH_OT_subdivide_multi(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= subdivide_multi_exec;
        ot->poll= ED_operator_editmesh;
-
+       
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
-
-       
        RNA_def_int(ot->srna, "number_cuts", 4, 0, 100, "Number of Cuts", "", 0, INT_MAX);
 }
 
@@ -6461,7 +6433,6 @@ static int subdivide_multi_fractal_exec(bContext *C, wmOperator *op)
 
        esubdivideflag(obedit, em, 1, -(RNA_float_get(op->ptr, "random_factor")/100), scene->toolsettings->editbutflag, RNA_int_get(op->ptr, "number_cuts"), 0);
                
-       ED_undo_push(C, "Subdivide Multi Fractal");     // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -6478,7 +6449,7 @@ void MESH_OT_subdivide_multi_fractal(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
        RNA_def_int(ot->srna, "number_cuts", 4, 0, 100, "Number of Cuts", "", 0, INT_MAX);
@@ -6493,7 +6464,6 @@ static int subdivide_smooth_exec(bContext *C, wmOperator *op)
 
        esubdivideflag(obedit, em, 1, 0.292f*RNA_float_get(op->ptr, "smoothness"), scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
                
-       ED_undo_push(C, "Subdivide Smooth");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;       
@@ -6510,7 +6480,7 @@ void MESH_OT_subdivide_smooth(wmOperatorType *ot)
        ot->poll= ED_operator_editmesh;
 
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_float(ot->srna, "smoothness", 5.0f, 0.0f, 1000.0f, "Smoothness", "", 0.0f, FLT_MAX);
@@ -6570,6 +6540,9 @@ void MESH_OT_subdivs(wmOperatorType *ot)
        
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /*props */
        RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, 1000);
        
@@ -6587,7 +6560,6 @@ static int fill_mesh_exec(bContext *C, wmOperator *op)
        
        fill_mesh(em);
        
-       ED_undo_push(C, "Fill Mesh");   // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6603,6 +6575,9 @@ void MESH_OT_fill_mesh(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= fill_mesh_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int beauty_fill_exec(bContext *C, wmOperator *op)
@@ -6612,7 +6587,6 @@ static int beauty_fill_exec(bContext *C, wmOperator *op)
        
         beauty_fill(em);
        
-       ED_undo_push(C, "Beauty Fill"); // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6627,6 +6601,9 @@ void MESH_OT_beauty_fill(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= beauty_fill_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int convert_quads_to_tris_exec(bContext *C, wmOperator *op)
@@ -6636,7 +6613,6 @@ static int convert_quads_to_tris_exec(bContext *C, wmOperator *op)
        
        convert_to_triface(em,0);
        
-       ED_undo_push(C, "Quads to Tris");       // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6651,6 +6627,9 @@ void MESH_OT_convert_quads_to_tris(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= convert_quads_to_tris_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int convert_tris_to_quads_exec(bContext *C, wmOperator *op)
@@ -6660,7 +6639,6 @@ static int convert_tris_to_quads_exec(bContext *C, wmOperator *op)
 
        join_triangles(em);
        
-       ED_undo_push(C, "Tris To Quads");       // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6675,6 +6653,9 @@ void MESH_OT_convert_tris_to_quads(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= convert_tris_to_quads_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int edge_flip_exec(bContext *C, wmOperator *op)
@@ -6684,7 +6665,6 @@ static int edge_flip_exec(bContext *C, wmOperator *op)
        
        edge_flip(em);
        
-       ED_undo_push(C, "Edge Flip");   // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6699,6 +6679,9 @@ void MESH_OT_edge_flip(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= edge_flip_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int mesh_set_smooth_faces_exec(bContext *C, wmOperator *op)
@@ -6708,7 +6691,6 @@ static int mesh_set_smooth_faces_exec(bContext *C, wmOperator *op)
        
        mesh_set_smooth_faces(em,1);
        
-       ED_undo_push(C, "Set Smooth Faces");    // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6723,6 +6705,9 @@ void MESH_OT_mesh_set_smooth_faces(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= mesh_set_smooth_faces_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int mesh_set_solid_faces_exec(bContext *C, wmOperator *op)
@@ -6732,7 +6717,6 @@ static int mesh_set_solid_faces_exec(bContext *C, wmOperator *op)
        
        mesh_set_smooth_faces(em,0);
        
-       ED_undo_push(C, "Set Solid Faces");     // Note this will become depricated 
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
@@ -6747,6 +6731,9 @@ void MESH_OT_mesh_set_solid_faces(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= mesh_set_solid_faces_exec;
        ot->poll= ED_operator_editmesh;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int edit_faces_invoke(bContext *C, wmOperator *op, wmEvent *event)
@@ -6816,6 +6803,9 @@ void MESH_OT_edit_faces(wmOperatorType *ot)
        
        ot->poll= ED_operator_editmesh;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /*props */
        RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, 1000);
        
index bdd119c..5a47c6c 100644 (file)
@@ -95,7 +95,6 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
        if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
        
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Add To Active Group");
 
        WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
@@ -113,6 +112,9 @@ void GROUP_OT_objects_add_active(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= objects_add_active_exec;      
        ot->poll= ED_operator_scene_editable;
+
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int objects_remove_active_exec(bContext *C, wmOperator *op)
@@ -147,7 +149,6 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
        if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
        
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Remove From Active Group");
 
        WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
@@ -165,6 +166,9 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= objects_remove_active_exec;   
        ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int group_remove_exec(bContext *C, wmOperator *op)
@@ -183,7 +187,6 @@ static int group_remove_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Remove From Group");
 
        WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
@@ -201,6 +204,9 @@ void GROUP_OT_group_remove(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= group_remove_exec;    
        ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int group_create_exec(bContext *C, wmOperator *op)
@@ -221,7 +227,6 @@ static int group_create_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Create Group");
 
        WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
@@ -240,6 +245,9 @@ void GROUP_OT_group_create(wmOperatorType *ot)
        ot->exec= group_create_exec;    
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_string(ot->srna, "GID", "Group", 32, "Name", "Name of the new group");
 }
 
index 9d997b5..cc8b529 100644 (file)
 
 /* ************* XXX **************** */
 static void allqueue() {}
-static void BIF_undo_push() {}
 static void error() {}
 static void waitcursor() {}
 static int pupmenu() {return 0;}
@@ -329,7 +328,9 @@ void OBJECT_OT_object_add(wmOperatorType *ot)
        ot->exec= object_add_exec;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_object_types, 0, "Type", "");
 }
@@ -413,7 +414,9 @@ void OBJECT_OT_mesh_add(wmOperatorType *ot)
        ot->exec= object_add_mesh_exec;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= 0;
        
        RNA_def_enum(ot->srna, "type", prop_mesh_types, 0, "Primitive", "");
 }
@@ -466,7 +469,9 @@ void OBJECT_OT_curve_add(wmOperatorType *ot)
        ot->exec= object_add_curve_exec;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_curve_types, 0, "Primitive", "");
 }
@@ -503,7 +508,9 @@ void OBJECT_OT_primitive_add(wmOperatorType *ot)
        ot->invoke= object_add_primitive_invoke;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= 0;
 }
 
 
@@ -581,7 +588,6 @@ void delete_obj(Scene *scene, View3D *v3d, int ok)
        DAG_scene_sort(scene);
        ED_anim_dag_flush_update(C);    
 
-       BIF_undo_push("Delete object(s)");
 }
 
 static void single_object_users__forwardModifierLinks(void *userData, Object *ob, Object **obpoin)
@@ -1224,7 +1230,6 @@ void add_hook_menu(Scene *scene, View3D *v3d)
        allqueue(REDRAWVIEW3D, 0);
        allqueue(REDRAWBUTSOBJECT, 0);
        
-       BIF_undo_push("Add hook");
 }
 
 /* ******************** clear parent operator ******************* */
@@ -1260,8 +1265,6 @@ static int clear_parent_exec(bContext *C, wmOperator *op)
        DAG_scene_sort(CTX_data_scene(C));
        ED_anim_dag_flush_update(C);
        
-       ED_undo_push(C,"Clear Parent"); 
-       
        return OPERATOR_FINISHED;
 }
 
@@ -1276,7 +1279,9 @@ void OBJECT_OT_clear_parent(wmOperatorType *ot)
        ot->exec= clear_parent_exec;
        
        ot->poll= ED_operator_object_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_clear_parent_types, 0, "Type", "");
 }
@@ -1310,8 +1315,6 @@ static int object_clear_track_exec(bContext *C, wmOperator *op)
        DAG_scene_sort(CTX_data_scene(C));
        ED_anim_dag_flush_update(C);
 
-       ED_undo_push(C,"Clear Track");  
-       
        return OPERATOR_FINISHED;
 }
 
@@ -1326,7 +1329,9 @@ void OBJECT_OT_clear_track(wmOperatorType *ot)
        ot->exec= object_clear_track_exec;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_clear_track_types, 0, "Type", "");
 }
@@ -1348,8 +1353,6 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
        
-       /* undo? */
-       ED_undo_push(C,"Select By Type");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1366,6 +1369,9 @@ void OBJECT_OT_select_by_type(wmOperatorType *ot)
        ot->exec= object_select_by_type_exec;
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "type", prop_object_types, 0, "Type", "");
 
 }
@@ -1498,10 +1504,10 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
        
        if (changed) {
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
-               ED_undo_push(C,"Select linked");
+               return OPERATOR_FINISHED;
        }
        
-       return OPERATOR_FINISHED;
+       return OPERATOR_CANCELLED;
 }
 
 void OBJECT_OT_select_linked(wmOperatorType *ot)
@@ -1515,6 +1521,9 @@ void OBJECT_OT_select_linked(wmOperatorType *ot)
        ot->exec= object_select_linked_exec;
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "type", prop_select_linked_types, 0, "Type", "");
 
 }
@@ -1533,7 +1542,6 @@ static int object_select_by_layer_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
        
        /* undo? */
-       ED_undo_push(C,"Select By Layer");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1550,6 +1558,9 @@ void OBJECT_OT_select_by_layer(wmOperatorType *ot)
        ot->exec= object_select_by_layer_exec;
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_int(ot->srna, "layer", 1, 1, 20, "Layer", "", 1, 20);
 }
 
@@ -1565,7 +1576,6 @@ static int object_select_invert_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
        
        /* undo? */
-       ED_undo_push(C,"Selection Invert");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1581,7 +1591,10 @@ void OBJECT_OT_select_invert(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= object_select_invert_exec;
        ot->poll= ED_operator_scene_editable;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 /* ****** (de)select All *******/
 
@@ -1609,7 +1622,6 @@ static int object_de_select_all_exec(bContext *C, wmOperator *op)
        
        /* undo? */
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
-       ED_undo_push(C,"(De)Select All");
        
        return OPERATOR_FINISHED;
 }
@@ -1624,7 +1636,10 @@ void OBJECT_OT_de_select_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= object_de_select_all_exec;
        ot->poll= ED_operator_scene_editable;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 /* ****** random selection *******/
 
@@ -1641,8 +1656,6 @@ static int object_select_random_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
        
-       /* undo? */
-       ED_undo_push(C,"Select Random");
        WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        
        return OPERATOR_FINISHED;
@@ -1659,6 +1672,9 @@ void OBJECT_OT_select_random(wmOperatorType *ot)
        ot->exec = object_select_random_exec;
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_float(ot->srna, "percent", 50.0f, 0.0f, FLT_MAX, "Percent", "1", 0.01f, 100.0f);
 }
 
@@ -1694,7 +1710,6 @@ static int object_clear_location_exec(bContext *C, wmOperator *op)
 
        if(armature_clear==0) /* in this case flush was done */
                ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Clear Location");
        
        WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
        
@@ -1713,6 +1728,9 @@ void OBJECT_OT_clear_location(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_location_exec;
        ot->poll= ED_operator_object_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int object_clear_rotation_exec(bContext *C, wmOperator *op)
@@ -1746,7 +1764,6 @@ static int object_clear_rotation_exec(bContext *C, wmOperator *op)
 
        if(armature_clear==0) /* in this case flush was done */
                ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Clear Rotation");
        
        WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
        
@@ -1765,6 +1782,9 @@ void OBJECT_OT_clear_rotation(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_rotation_exec;
        ot->poll= ED_operator_object_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int object_clear_scale_exec(bContext *C, wmOperator *op)
@@ -1803,7 +1823,6 @@ static int object_clear_scale_exec(bContext *C, wmOperator *op)
        
        if(armature_clear==0) /* in this case flush was done */
                ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Clear Scale");
        
        WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, CTX_data_scene(C));
        
@@ -1821,6 +1840,9 @@ void OBJECT_OT_clear_scale(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_scale_exec;
        ot->poll= ED_operator_object_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int object_clear_origin_exec(bContext *C, wmOperator *op)
@@ -1846,7 +1868,6 @@ static int object_clear_origin_exec(bContext *C, wmOperator *op)
 
        if(armature_clear==0) /* in this case flush was done */
                ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Clear origin");
        
        WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
        
@@ -1864,6 +1885,9 @@ void OBJECT_OT_clear_origin(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_origin_exec;
        ot->poll= ED_operator_object_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ********* clear/set restrict view *********/
@@ -1885,7 +1909,6 @@ static int object_clear_restrictview_exec(bContext *C, wmOperator *op)
                }
        }
        if (changed) {
-               ED_undo_push(C,"Unhide Objects");
                DAG_scene_sort(scene);
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
        }
@@ -1904,6 +1927,9 @@ void OBJECT_OT_clear_restrictview(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_restrictview_exec;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static EnumPropertyItem prop_set_restrictview_types[] = {
@@ -1939,8 +1965,6 @@ static int object_set_restrictview_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        if (changed) {
-               if(RNA_enum_is_equal(op->ptr, "type", "SELECTED")) ED_undo_push(C,"Hide Selected Objects");
-               else if(RNA_enum_is_equal(op->ptr, "type", "UNSELECTED")) ED_undo_push(C,"Hide Unselected Objects");
                DAG_scene_sort(scene);
                
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
@@ -1961,6 +1985,9 @@ void OBJECT_OT_set_restrictview(wmOperatorType *ot)
        ot->exec= object_set_restrictview_exec;
        ot->poll= ED_operator_view3d_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "type", prop_set_restrictview_types, 0, "Type", "");
        
 }
@@ -1977,7 +2004,6 @@ static int object_set_slowparent_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Set Slow Parent");
        
        WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
        
@@ -1995,6 +2021,9 @@ void OBJECT_OT_set_slowparent(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_set_slowparent_exec;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int object_clear_slowparent_exec(bContext *C, wmOperator *op)
@@ -2015,7 +2044,6 @@ static int object_clear_slowparent_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        ED_anim_dag_flush_update(C);    
-       ED_undo_push(C,"Clear Slow Parent");
        
        WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
        
@@ -2033,6 +2061,9 @@ void OBJECT_OT_clear_slowparent(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= object_clear_slowparent_exec;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 /* ******************** **************** */
 
@@ -2174,7 +2205,6 @@ void make_vertex_parent(Scene *scene, Object *obedit, View3D *v3d)
        allqueue(REDRAWVIEW3D, 0);
        
        DAG_scene_sort(scene);
-       /* BIF_undo_push(str); not, conflicts with editmode undo... */
 }
 
 static Object *group_objects_menu(Group *group)
@@ -2260,7 +2290,6 @@ void make_proxy(Scene *scene)
                DAG_scene_sort(scene);
                DAG_object_flush_update(scene, newob, OB_RECALC);
                allqueue(REDRAWALL, 0);
-               BIF_undo_push("Make Proxy Object");
        }
 }
 
@@ -2417,8 +2446,6 @@ static int make_parent_exec(bContext *C, wmOperator *op)
        DAG_scene_sort(CTX_data_scene(C));
        ED_anim_dag_flush_update(C);    
        
-       ED_undo_push(C,"make Parent");
-       
        return OPERATOR_FINISHED;
 }
 
@@ -2461,7 +2488,9 @@ void OBJECT_OT_make_parent(wmOperatorType *ot)
        ot->exec= make_parent_exec;
        
        ot->poll= ED_operator_object_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= 0;
        
        RNA_def_enum(ot->srna, "type", prop_make_parent_types, 0, "Type", "");
 }
@@ -2538,8 +2567,6 @@ static int make_track_exec(bContext *C, wmOperator *op)
        DAG_scene_sort(CTX_data_scene(C));
        ED_anim_dag_flush_update(C);    
        
-       BIF_undo_push("make track");
-       
        return OPERATOR_FINISHED;
 }
 
@@ -2554,7 +2581,9 @@ void OBJECT_OT_make_track(wmOperatorType *ot)
        ot->exec= make_track_exec;
        
        ot->poll= ED_operator_scene_editable;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_make_track_types, 0, "Type", "");
 }
@@ -2620,8 +2649,6 @@ static int object_make_dupli_real_exec(bContext *C, wmOperator *op)
        ED_anim_dag_flush_update(C);    
        WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
        
-       ED_undo_push(C,"Make duplicates real"); 
-       
        return OPERATOR_FINISHED;
 }
 
@@ -2637,6 +2664,9 @@ void OBJECT_OT_make_dupli_real(wmOperatorType *ot)
        ot->exec= object_make_dupli_real_exec;
        
        ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 /* ******************* Set Object Center ********************** */
 
@@ -2960,8 +2990,7 @@ static int object_set_center_exec(bContext *C, wmOperator *op)
        if (tot_change) {
                ED_anim_dag_flush_update(C);
                allqueue(REDRAWVIEW3D, 0);
-               ED_undo_push(C,"Do Center");    
-               }
+       }
        
        /* Warn if any errors occured */
        if (tot_lib_error+tot_multiuser_arm_error) {
@@ -2985,7 +3014,9 @@ void OBJECT_OT_set_center(wmOperatorType *ot)
        ot->exec= object_set_center_exec;
        
        ot->poll= ED_operator_view3d_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        RNA_def_enum(ot->srna, "type", prop_set_center_types, 0, "Type", "");
 }
@@ -3183,6 +3214,9 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot)
        ot->exec= toggle_editmode_exec;
        
        ot->poll= ED_operator_object_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* *************************** */
@@ -3250,7 +3284,6 @@ void movetolayer(Scene *scene, View3D *v3d)
        allqueue(REDRAWOOPS, 0);
        allqueue(REDRAWINFO, 0);
        
-       BIF_undo_push("Move to layer");
 }
 
 
@@ -3444,7 +3477,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
                        allqueue(REDRAWVIEW3D, 0);
                        allqueue(REDRAWBUTSEDIT, 0);
-                       BIF_undo_push("Change texture face");
                }
                else if(G.f & G_VERTEXPAINT) {
                        Mesh *me= get_mesh(ob);
@@ -3456,8 +3488,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                                
 // XXX                         do_shared_vertexcol(me);
                                
-                               BIF_undo_push("Shared VertexCol");
-
                                DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
                        }
                }
@@ -3546,7 +3576,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                                                                } else if (ret==-2) {
                                                                        error("Both meshes must be a closed mesh");
                                                                }
-                                                               else BIF_undo_push("Boolean");
                                                                waitcursor(0);
                                                        } else {
                                                                BooleanModifierData *bmd = NULL;
@@ -3560,7 +3589,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                                                                        case 6: bmd->operation = eBooleanModifierOp_Difference; break;
                                                                }
 // XXX                                                         do_common_editbuts(B_CHANGEDEP);
-                                                               BIF_undo_push("Add Boolean modifier");                                                          
                                                        }                                                               
                                                } else {
                                                        error("Please select 2 meshes");
@@ -3593,13 +3621,11 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        waitcursor(1);
                        esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, 1, 0);
                        
-                       BIF_undo_push("ESubdivide Single");            
                        break;
                case 2:
                        if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
                        waitcursor(1);
                        esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, numcuts, 0);
-                       BIF_undo_push("ESubdivide");
                        break;
                case 3:
                        if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
@@ -3608,7 +3634,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        waitcursor(1);                  
                        fac= -( (float)randfac )/100;
                        esubdivideflag(1, fac, scene->toolsettings->editbutflag, numcuts, 0);
-                       BIF_undo_push("Subdivide Fractal");
                        break;
                        
                case 4:
@@ -3618,7 +3643,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        
                        waitcursor(1);
                        esubdivideflag(1, fac, scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
-                       BIF_undo_push("Subdivide Smooth");
                        break;          
                }
                */
@@ -3630,13 +3654,11 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        waitcursor(1);
 // XXX                 esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, 1, 0);
                        
-                       BIF_undo_push("ESubdivide Single");            
                        break;
                case 2:
 // XXX                 if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
                        waitcursor(1);
 // XXX                 esubdivideflag(1, 0.0, scene->toolsettings->editbutflag, numcuts, 0);
-                       BIF_undo_push("ESubdivide");
                        break;
                case 3:
 // XXX                 if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return;
@@ -3645,7 +3667,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        waitcursor(1);                  
                        fac= -( (float)randfac )/100;
 // XXX                 esubdivideflag(1, fac, scene->toolsettings->editbutflag, numcuts, 0);
-                       BIF_undo_push("Subdivide Fractal");
                        break;
                        
                case 12:        /* smooth */
@@ -3656,7 +3677,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        
                        waitcursor(1);
 // XXX                 esubdivideflag(1, fac, scene->toolsettings->editbutflag | B_SMOOTH, 1, 0);
-                       BIF_undo_push("Subdivide Smooth");
                        break;          
 
                case 4:
@@ -3664,7 +3684,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        break;
                case 5:
 // XXX                 notice("Removed %d Vertices", removedoublesflag(1, 0, scene->toolsettings->doublimit));
-                       BIF_undo_push("Remove Doubles");
                        break;
                case 6:
 // XXX                 hide_mesh(0);
@@ -3677,7 +3696,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        break;
                case 9:
 // XXX                 flip_editnormals();
-                       BIF_undo_push("Flip Normals");
                        break;
                case 10:
 // XXX                 vertexsmooth();
@@ -3699,7 +3717,6 @@ void special_editmenu(Scene *scene, View3D *v3d)
                        break;
                case 18:
 // XXX                 pathselect();
-                       BIF_undo_push("Select Vertex Path");
                        break;
                }
                
@@ -4007,7 +4024,6 @@ void convertmenu(Scene *scene, View3D *v3d)
        allqueue(REDRAWOOPS, 0);
 //     allspace(OOPS_TEST, 0);
        allqueue(REDRAWBUTSEDIT, 0);
-       BIF_undo_push("Convert Object");
 
        DAG_scene_sort(scene);
 }
@@ -4151,10 +4167,6 @@ void flip_subdivison(Scene *scene, View3D *v3d, int level)
        allqueue(REDRAWBUTSEDIT, 0);
        allqueue(REDRAWBUTSOBJECT, 0);
        ED_anim_dag_flush_update(C);    
-       if(particles)
-               BIF_undo_push("Switch particles on/off");
-       else
-               BIF_undo_push("Switch subsurf on/off");
 }
  
 static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
@@ -4216,7 +4228,6 @@ static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
        MEM_freeN(str);
        allqueue(REDRAWVIEW3D, 0);
        
-       BIF_undo_push("Copy properties");
 }
 
 static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob)
@@ -4251,7 +4262,6 @@ static void copymenu_logicbricks(Scene *scene, View3D *v3d, Object *ob)
                        }
                }
        }
-       BIF_undo_push("Copy logic");
 }
 
 static void copymenu_modifiers(Scene *scene, View3D *v3d, Object *ob)
@@ -4355,7 +4365,6 @@ static void copymenu_modifiers(Scene *scene, View3D *v3d, Object *ob)
        allqueue(REDRAWBUTSOBJECT, 0);
        DAG_scene_sort(scene);
        
-       BIF_undo_push("Copy modifiers");
 }
 
 /* both pointers should exist */
@@ -4653,7 +4662,6 @@ void copy_attr(Scene *scene, View3D *v3d, short event)
                allqueue(REDRAWBUTSOBJECT, 0);
        }
        
-       BIF_undo_push("Copy Attributes");
 }
 
 void copy_attr_menu(Scene *scene, View3D *v3d)
@@ -4858,7 +4866,6 @@ void make_links(Scene *scene, View3D *v3d, short event)
 
        ED_anim_dag_flush_update(C);    
 
-       BIF_undo_push("Create links");
 }
 
 void make_links_menu(Scene *scene, View3D *v3d)
@@ -4998,7 +5005,6 @@ static void apply_objects_internal(Scene *scene, View3D *v3d, int apply_scale, i
                                /* texspace and normals */
                                BASACT= base;
 // XXX                         ED_object_enter_editmode(C, 0);
-                               BIF_undo_push("Applied object");        /* editmode undo itself */
 // XXX                         ED_object_exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */
                                BASACT= basact;
                                
@@ -5074,7 +5080,6 @@ static void apply_objects_internal(Scene *scene, View3D *v3d, int apply_scale, i
                                /* texspace and normals */
                                BASACT= base;
 // XXX                         ED_object_enter_editmode(C, 0);
-                               BIF_undo_push("Applied object");        /* editmode undo itself */
 // XXX                         ED_object_exit_editmode(C, EM_FREEDATA|EM_WAITCURSOR); /* freedata, but no undo */
                                BASACT= basact;
                                
@@ -5088,12 +5093,6 @@ static void apply_objects_internal(Scene *scene, View3D *v3d, int apply_scale, i
        }
        if (change) {
                allqueue(REDRAWVIEW3D, 0);
-               if (apply_scale && apply_rot)
-                       BIF_undo_push("Apply Objects Scale & Rotation");
-               else if (apply_scale)
-                       BIF_undo_push("Apply Objects Scale");
-               else
-                       BIF_undo_push("Apply Objects Rotation");
        }
 }
 
@@ -5133,7 +5132,6 @@ void apply_objects_visual_tx( Scene *scene, View3D *v3d )
        }
        if (change) {
                allqueue(REDRAWVIEW3D, 0);
-               BIF_undo_push("Apply Objects Visual Transform");
        }
 }
 
@@ -5558,7 +5556,6 @@ void single_user(Scene *scene, View3D *v3d)
                clear_id_newpoins();
 
                allqueue(REDRAWALL, 0);
-               BIF_undo_push("Single user");
        }
 }
 
@@ -5730,7 +5727,6 @@ void make_local(Scene *scene, View3D *v3d, int mode)
        }
 
        allqueue(REDRAWALL, 0);
-       BIF_undo_push("Make local");
 }
 
 void make_local_menu(Scene *scene, View3D *v3d)
@@ -6024,6 +6020,9 @@ void OBJECT_OT_add_duplicate(wmOperatorType *ot)
        
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* to give to transform */
        RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
 }
@@ -6089,7 +6088,6 @@ void image_aspect(Scene *scene, View3D *v3d)
        }
        
        allqueue(REDRAWVIEW3D, 0);
-       BIF_undo_push("Image aspect");
 }
 
 void set_ob_ipoflags(Scene *scene, View3D *v3d)
@@ -6178,7 +6176,6 @@ void select_select_keys(Scene *scene, View3D *v3d)
 //     allspace(REMAKEIPO, 0);
        allqueue(REDRAWIPO, 0);
 
-       BIF_undo_push("Select keys");
 #endif  // XXX old animation system
 }
 
@@ -6410,10 +6407,6 @@ void hookmenu(Scene *scene, View3D *v3d)
        }
        
        if (changed) {
-               if (event==1)
-                       BIF_undo_push("Clear hook offset for selected");
-               else if (event==2)
-                       BIF_undo_push("Hook cursor center for selected");
                
                allqueue(REDRAWVIEW3D, 0);
                allqueue(REDRAWBUTSEDIT, 0);
index 2cf440a..810e52a 100644 (file)
@@ -1034,6 +1034,8 @@ void SCREEN_OT_screen_full_area(wmOperatorType *ot)
        
        ot->exec= screen_full_area_exec;
        ot->poll= ED_operator_screenactive;
+       ot->flag= OPTYPE_REGISTER;
+
 }
 
 
@@ -1321,12 +1323,15 @@ static int repeat_last_exec(bContext *C, wmOperator *op)
        
        if(lastop) {
                if(lastop->type->poll==NULL || lastop->type->poll(C)) {
-                       printf("repeat %s\n", lastop->type->idname);
-                       lastop->type->exec(C, lastop);
+                       if(lastop->type->exec) {
+                               printf("repeat %s\n", lastop->type->idname);
+                               lastop->type->exec(C, lastop);
+                               return OPERATOR_FINISHED;
+                       }
                }
        }
        
-       return OPERATOR_FINISHED;
+       return OPERATOR_CANCELLED;
 }
 
 void SCREEN_OT_repeat_last(wmOperatorType *ot)
@@ -1528,6 +1533,7 @@ void SCREEN_OT_region_foursplit(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= region_foursplit_exec;
        ot->poll= ED_operator_areaactive;
+       ot->flag= OPTYPE_REGISTER;
 }
 
 
@@ -1597,6 +1603,7 @@ void SCREEN_OT_region_flip(wmOperatorType *ot)
        ot->exec= region_flip_exec;
        
        ot->poll= ED_operator_areaactive;
+       ot->flag= OPTYPE_REGISTER;
        
        RNA_def_int(ot->srna, "test", 0, INT_MIN, INT_MAX, "test", "", INT_MIN, INT_MAX);
 
index be1fcc8..757c20a 100644 (file)
@@ -1011,8 +1011,6 @@ void sculptmode_selectbrush_menu(void)
        if(val>0) {
                sd->brush_type= val;
 
-               BIF_undo_push("Brush type");
-               
                allqueue(REDRAWVIEW3D, 1);
                allqueue(REDRAWBUTSEDIT, 1);
        }*/
@@ -1253,7 +1251,7 @@ static int sculpt_radial_control_exec(bContext *C, wmOperator *op)
        int ret = brush_radial_control_exec(op, CTX_data_scene(C)->toolsettings->sculpt->brush);
        char str[256];
        WM_radial_control_string(op, str, 256);
-       ED_undo_push(C, str);   
+
        return ret;
 }
 
@@ -1268,6 +1266,8 @@ static void SCULPT_OT_radial_control(wmOperatorType *ot)
        ot->modal= sculpt_radial_control_modal;
        ot->exec= sculpt_radial_control_exec;
        ot->poll= sculpt_poll;
+
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /**** Operator for applying a stroke (various attributes including mouse path)
@@ -1601,6 +1601,9 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
        ot->modal= sculpt_brush_stroke_modal;
        ot->exec= sculpt_brush_stroke_exec;
        ot->poll= sculpt_poll;
+       
+       /* flags (sculpt does own undo? (ton) */
+       ot->flag= OPTYPE_REGISTER;
 
        /* properties */
        RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
@@ -1634,8 +1637,6 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
                toggle_paint_cursor(C);
 
                sculptsession_free(ts->sculpt);
-
-               ED_undo_push(C, "Exit sculpt");
        }
        else {
                MTex *mtex; // XXX: temporary
@@ -1671,8 +1672,6 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op)
                                mtex->size[0] = mtex->size[1] = mtex->size[2] = 50;
                        }
                }
-
-               ED_undo_push(C, "Enter sculpt");
        }
 
        return OPERATOR_FINISHED;
@@ -1688,6 +1687,7 @@ static void SCULPT_OT_sculptmode_toggle(wmOperatorType *ot)
        ot->exec= sculpt_toggle_mode;
        ot->poll= ED_operator_object_active;
        
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void ED_operatortypes_sculpt()
@@ -2144,8 +2144,6 @@ void sculptmode_pmv(int mode)
 
        /*XXX: scrarea_do_windraw(curarea); */
 
-       BIF_undo_push("Partial mesh hide");
-
        waitcursor(0);
 }
 #endif
index 3cf593d..1b59223 100644 (file)
@@ -181,7 +181,7 @@ void ACT_OT_set_previewrange (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ****************** View-All Operator ****************** */
@@ -228,7 +228,7 @@ void ACT_OT_view_all (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************************************************************************** */
@@ -524,7 +524,7 @@ void ACT_OT_keyframes_copy (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -568,7 +568,7 @@ void ACT_OT_keyframes_paste (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** Delete Keyframes Operator ************************* */
@@ -632,7 +632,7 @@ void ACT_OT_keyframes_delete (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** Clean Keyframes Operator ************************* */
@@ -695,7 +695,7 @@ void ACT_OT_keyframes_clean (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
        RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
@@ -818,7 +818,7 @@ void ACT_OT_keyframes_sample (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************************************************************************** */
@@ -894,7 +894,7 @@ void ACT_OT_keyframes_extrapolation_type (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_actkeys_expo_types, 0, "Type", "");
@@ -972,7 +972,7 @@ void ACT_OT_keyframes_interpolation_type (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_actkeys_ipo_types, 0, "Type", "");
@@ -1070,7 +1070,7 @@ void ACT_OT_keyframes_handletype (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_actkeys_handletype_types, 0, "Type", "");
@@ -1145,7 +1145,7 @@ void ACT_OT_keyframes_cfrasnap (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** Snap Keyframes Operator *********************** */
@@ -1237,7 +1237,7 @@ void ACT_OT_keyframes_snap (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_actkeys_snap_types, 0, "Type", "");
@@ -1352,7 +1352,7 @@ void ACT_OT_keyframes_mirror (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_actkeys_mirror_types, 0, "Type", "");
index 3c9e8a4..b9bcc62 100644 (file)
@@ -338,7 +338,7 @@ void ACT_OT_keyframes_deselectall (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
@@ -500,7 +500,7 @@ void ACT_OT_keyframes_borderselect(wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
@@ -733,7 +733,7 @@ void ACT_OT_keyframes_columnselect (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* props */
        RNA_def_enum(ot->srna, "mode", prop_column_select_types, 0, "Mode", "");
@@ -1082,6 +1082,9 @@ void ACT_OT_keyframes_clickselect (wmOperatorType *ot)
        ot->invoke= actkeys_clickselect_invoke;
        ot->poll= ED_operator_areaactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* id-props */
        // XXX should we make this into separate operators?
        RNA_def_enum(ot->srna, "left_right", NULL /* XXX prop_actkeys_clickselect_items */, 0, "Left Right", ""); // ALTKEY
index a4f0abb..e8f5b69 100644 (file)
@@ -266,7 +266,10 @@ void IMAGE_OT_view_pan(wmOperatorType *ot)
        ot->modal= view_pan_modal;
        ot->cancel= view_pan_cancel;
        ot->poll= space_image_main_area_poll;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* properties */
        RNA_def_float_vector(ot->srna, "offset", 2, NULL, -FLT_MAX, FLT_MAX,
                "Offset", "Offset in floating point units, 1.0 is the width and height of the image.", -FLT_MAX, FLT_MAX);
@@ -378,7 +381,10 @@ void IMAGE_OT_view_zoom(wmOperatorType *ot)
        ot->modal= view_zoom_modal;
        ot->cancel= view_zoom_cancel;
        ot->poll= space_image_main_area_poll;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* properties */
        RNA_def_float(ot->srna, "factor", 0.0f, 0.0f, FLT_MAX,
                "Factor", "Zoom factor, values higher than 1.0 zoom in, lower values zoom out.", -FLT_MAX, FLT_MAX);
@@ -444,6 +450,9 @@ void IMAGE_OT_view_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= view_all_exec;
        ot->poll= space_image_main_area_poll;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /********************** view selected operator *********************/
@@ -498,6 +507,9 @@ void IMAGE_OT_view_selected(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= view_selected_exec;
        ot->poll= ED_operator_uvedit;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /********************** view zoom in/out operator *********************/
@@ -523,6 +535,9 @@ void IMAGE_OT_view_zoom_in(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= view_zoom_in_exec;
        ot->poll= space_image_main_area_poll;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 static int view_zoom_out_exec(bContext *C, wmOperator *op)
@@ -546,6 +561,9 @@ void IMAGE_OT_view_zoom_out(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= view_zoom_out_exec;
        ot->poll= space_image_main_area_poll;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /********************** view zoom ratio operator *********************/
@@ -585,6 +603,9 @@ void IMAGE_OT_view_zoom_ratio(wmOperatorType *ot)
        ot->exec= view_zoom_ratio_exec;
        ot->poll= space_image_main_area_poll;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* properties */
        RNA_def_float(ot->srna, "ratio", 0.0f, 0.0f, FLT_MAX,
                "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX);
index 1e67b30..94e8b6e 100644 (file)
@@ -189,7 +189,7 @@ void GRAPHEDIT_OT_set_previewrange (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ****************** View-All Operator ****************** */
@@ -236,7 +236,7 @@ void GRAPHEDIT_OT_view_all (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************************************************************************** */
@@ -518,7 +518,7 @@ void GRAPHEDIT_OT_keyframes_copy (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -557,7 +557,7 @@ void GRAPHEDIT_OT_keyframes_paste (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 #endif // XXX code to be sanitied for new system
@@ -617,7 +617,7 @@ void GRAPHEDIT_OT_keyframes_delete (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** Clean Keyframes Operator ************************* */
@@ -678,7 +678,7 @@ void GRAPHEDIT_OT_keyframes_clean (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* properties */
        RNA_def_float(ot->srna, "threshold", 0.001f, 0.0f, FLT_MAX, "Threshold", "", 0.0f, 1000.0f);
@@ -801,7 +801,7 @@ void GRAPHEDIT_OT_keyframes_sample (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -876,7 +876,7 @@ void GRAPHEDIT_OT_keyframes_extrapolation_type (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", "");
@@ -952,7 +952,7 @@ void GRAPHEDIT_OT_keyframes_interpolation_type (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_graphkeys_ipo_types, 0, "Type", "");
@@ -1049,7 +1049,7 @@ void GRAPHEDIT_OT_keyframes_handletype (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_graphkeys_handletype_types, 0, "Type", "");
@@ -1124,7 +1124,7 @@ void GRAPHEDIT_OT_keyframes_cfrasnap (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ******************** Snap Keyframes Operator *********************** */
@@ -1212,7 +1212,7 @@ void GRAPHEDIT_OT_keyframes_snap (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_graphkeys_snap_types, 0, "Type", "");
@@ -1322,7 +1322,7 @@ void GRAPHEDIT_OT_keyframes_mirror (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", "");
@@ -1375,7 +1375,7 @@ void GRAPHEDIT_OT_keyframes_smooth (wmOperatorType *ot)
        ot->poll= ED_operator_areaactive;
        
        /* flags */
-       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************************************************************************** */
index b4c0fcb..fe5d196 100644 (file)
@@ -85,8 +85,6 @@
  
 #include "node_intern.h"
 
-// XXX XXX XXX
-static void BIF_undo_push(char *s) {}
 
 /* ***************** composite job manager ********************** */
 
@@ -768,7 +766,6 @@ void node_ungroup(SpaceNode *snode)
        else {
                if(nodeGroupUnGroup(snode->edittree, gnode)) {
                        
-                       BIF_undo_push("Deselect all nodes");
                        // allqueue(REDRAWNODE, 0);
                }
                else
@@ -844,7 +841,6 @@ static void node_addgroup(SpaceNode *snode)
                                id_us_plus(node->id);
                                
                                node_set_active(snode, node);
-                               BIF_undo_push("Add Node");
                        }
                }                       
        }
@@ -1202,8 +1198,6 @@ static void transform_nodes(bNodeTree *ntree, char mode, char *undostr)
                }
                
        }
-       else
-               BIF_undo_push(undostr);
        
        // allqueue(REDRAWNODE, 1);
        MEM_freeN(oldlocs);
@@ -1290,8 +1284,6 @@ void scale_node(SpaceNode *snode, bNode *node)
        if(cancel) {
                node->width= oldwidth;
        }
-       else
-               BIF_undo_push("Scale Node");
        
        // allqueue(REDRAWNODE, 1);
        
@@ -1319,7 +1311,6 @@ void node_rename(SpaceNode *snode)
        if(found_node) {
                rename_node= nodeGetActive(snode->edittree);
                node_rename_but((char *)rename_node->username);
-               BIF_undo_push("Rename Node");
        
                // allqueue(REDRAWNODE, 1);
        }
@@ -1441,7 +1432,6 @@ static void node_hide_unhide_sockets(SpaceNode *snode, bNode *node)
 
        // allqueue(REDRAWNODE, 1);
        snode_verify_groups(snode);
-       BIF_undo_push("Hide/Unhide sockets");
 
 }
 
@@ -1708,7 +1698,6 @@ void node_border_select(SpaceNode *snode)
                        }
                }
                // allqueue(REDRAWNODE, 1);
-               BIF_undo_push("Border select nodes");
        }               
 }
 
@@ -1846,8 +1835,6 @@ void node_mute(SpaceNode *snode)
                }
        }
        
-       // allqueue(REDRAWNODE, 0);
-       BIF_undo_push("Enable/Disable nodes");
 
 }
 
@@ -2007,9 +1994,6 @@ static int node_add_link_drag(SpaceNode *snode, bNode *node, bNodeSocket *sock,
        snode_verify_groups(snode);
        snode_handle_recalc(snode);
        
-       // allqueue(REDRAWNODE, 0);
-       BIF_undo_push("Add link");
-
        return 1;
 }
 
@@ -2091,7 +2075,6 @@ void node_delete(SpaceNode *snode)
        snode_verify_groups(snode);
        // NODE_FIX_ME
        // snode_handle_recalc(snode);
-       // BIF_undo_push("Delete nodes");
        // allqueue(REDRAWNODE, 1);
 }
 
@@ -2117,8 +2100,6 @@ void node_hide(SpaceNode *snode)
                                node->flag &= ~NODE_HIDDEN;
                }
        }
-       // BIF_undo_push("Hide nodes");
-       // allqueue(REDRAWNODE, 1);
 }
 
 #if 0
@@ -2142,8 +2123,6 @@ void node_insert_key(SpaceNode *snode)
                        if(fbutton(&fval, 0.0f, 1.0f, 10, 10, "Insert Value")) {
                                curvemap_insert(cumap->cm, curval, fval);
 
-                               BIF_undo_push("Insert key in Time node");
-                               // allqueue(REDRAWNODE, 1);
                        }
                }
        }
@@ -2173,8 +2152,6 @@ void node_select_linked(SpaceNode *snode, int out)
                if(node->flag & NODE_TEST)
                        node->flag |= NODE_SELECT;
        
-       BIF_undo_push("Select Linked nodes");
-       // allqueue(REDRAWNODE, 1);
 }
 
 /* makes a link between selected output and input sockets */
@@ -2200,8 +2177,6 @@ void node_make_link(SpaceNode *snode)
        snode_verify_groups(snode);
        snode_handle_recalc(snode);
 
-       // allqueue(REDRAWNODE, 0);
-       BIF_undo_push("Make Link Between Sockets");
 }
 
 static void node_border_link_delete(SpaceNode *snode)
@@ -2272,8 +2247,6 @@ static void node_border_link_delete(SpaceNode *snode)
                                snode_verify_groups(snode);
                                snode_handle_recalc(snode);
                        }
-                       // allqueue(REDRAWNODE, 0);
-                       BIF_undo_push("Erase links");
                }
        }
        
@@ -2421,8 +2394,6 @@ void node_make_group(SpaceNode *snode)
        else {
                nodeSetActive(snode->nodetree, gnode);
                ntreeSolveOrder(snode->nodetree);
-               // allqueue(REDRAWNODE, 0);
-               BIF_undo_push("Make Node Group");
        }
 }
 
@@ -2634,7 +2605,6 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        }
                        else if(G.qual==0) {
                                node_deselectall(snode, 1);
-                               BIF_undo_push("Deselect all nodes");
                        }
                        break;
                case BKEY:
@@ -2746,5 +2716,8 @@ void NODE_OT_delete_selection(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= node_delete_selection_exec;
        ot->poll= ED_operator_node_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
index 451e963..eb5e85c 100644 (file)
@@ -147,8 +147,6 @@ void do_node_addmenu(bContext *C, void *arg, int event)
        // XXX snode_autoconnect(snode, node, NODE_TEST);
                
        // XXX addqueue(curarea->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
-       
-       // ED_undo_push("Add Node");
 }
 
 static void node_make_addmenu(bContext *C, int nodeclass, uiBlock *block)
index 35391df..0d0ff25 100644 (file)
@@ -188,6 +188,9 @@ void NODE_OT_extend_select(wmOperatorType *ot)
        ot->invoke= node_extend_select_invoke;
        ot->poll= ED_operator_node_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "select_type", prop_select_items, 0, "Select Type", "");
        
        RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);
@@ -206,6 +209,9 @@ void NODE_OT_select(wmOperatorType *ot)
        ot->poll= ED_operator_node_active;
        ot->modal= node_select_modal;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "select_type", prop_select_items, 0, "Select Type", "");
        
        RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);
@@ -270,6 +276,9 @@ void NODE_OT_border_select(wmOperatorType *ot)
        
        ot->poll= ED_operator_node_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
index 908e990..418c51a 100644 (file)
@@ -191,6 +191,9 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot)
        ot->invoke= node_toggle_visibility_invoke;
        ot->poll= ED_operator_node_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", INT_MIN, INT_MAX);
 }
@@ -214,4 +217,7 @@ void NODE_OT_fit_all(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= node_fit_all_exec;
        ot->poll= ED_operator_node_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
index 60a7aae..5ab149f 100644 (file)
@@ -190,7 +190,6 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
                seq->flag |= SELECT;
        }
        
-       ED_undo_push(C, "Add Scene Strip, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -220,8 +219,10 @@ void SEQUENCER_OT_add_scene_strip(struct wmOperatorType *ot)
        ot->exec= sequencer_add_scene_strip_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME);
        RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME-2, "Scene Name", "Scene name to add as a strip");
 }
@@ -279,7 +280,6 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op)
                seq->flag |= SELECT;
        }
        
-       ED_undo_push(C, "Add Movie Strip, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -306,7 +306,9 @@ void SEQUENCER_OT_add_movie_strip(struct wmOperatorType *ot)
        ot->exec= sequencer_add_movie_strip_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILENAME);
        RNA_def_boolean(ot->srna, "sound", FALSE, "Sound", "Load hd sound with the movie"); // XXX need to impliment this
@@ -378,7 +380,6 @@ static int sequencer_add_sound_strip_exec(bContext *C, wmOperator *op)
                seq->flag |= SELECT;
        }
 
-       ED_undo_push(C, "Add Sound Strip, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -405,8 +406,10 @@ void SEQUENCER_OT_add_sound_strip(struct wmOperatorType *ot)
        ot->exec= sequencer_add_sound_strip_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILENAME);
        RNA_def_boolean(ot->srna, "hd", FALSE, "HD Sound", "Load the sound as streaming audio"); // XXX need to impliment this
 }
@@ -469,7 +472,6 @@ static int sequencer_add_image_strip_exec(bContext *C, wmOperator *op)
                seq->flag |= SELECT;
        }
 
-       ED_undo_push(C, "Add Image Strip, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -496,7 +498,9 @@ void SEQUENCER_OT_add_image_strip(struct wmOperatorType *ot)
        ot->exec= sequencer_add_image_strip_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_FILENAME);
 }
@@ -595,13 +599,6 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
                seq->flag |= SELECT;
        }
 
-       if (seq->type==SEQ_PLUGIN) {
-               ED_undo_push(C, "Add Plugin Strip, Sequencer");
-       }
-       else {
-               ED_undo_push(C, "Add Effect Strip, Sequencer");
-       }
-
        ED_area_tag_redraw(CTX_wm_area(C));
        return OPERATOR_FINISHED;
 }
@@ -632,8 +629,10 @@ void SEQUENCER_OT_add_effect_strip(struct wmOperatorType *ot)
        ot->exec= sequencer_add_effect_strip_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME|SEQPROP_ENDFRAME|SEQPROP_FILENAME);
        RNA_def_enum(ot->srna, "type", sequencer_prop_effect_types, SEQ_CROSS, "Type", "Sequencer effect type");
        RNA_def_float_vector(ot->srna, "color", 3, NULL, 0.0f, 1.0f, "Color", "Initialize the strip with this color (only used when type='COLOR')", 0.0f, 1.0f);
index 8771f85..8c70e1d 100644 (file)
@@ -95,7 +95,6 @@
 //static Sequence *_last_seq=0;
 //static int _last_seq_init=0;
 /* XXX */
-static void BIF_undo_push() {}
 static void error() {}
 static void waitcursor() {}
 static void activate_fileselect() {}
@@ -211,7 +210,6 @@ static void change_plugin_seq(Scene *scene, char *str)      /* called from fileselect
 
        if( seq_test_overlap(ed->seqbasep, last_seq) ) shuffle_seq(ed->seqbasep, last_seq);
        
-       BIF_undo_push("Load/Change Plugin, Sequencer");
 }
 
 
@@ -485,7 +483,6 @@ void deselect_all_seq(Scene *scene)
        }
        SEQ_END
                
-       //BIF_undo_push("(De)select all Strips, Sequencer"); - manage undo elsewhere for 2.5, campbell
 }
 
 void recurs_sel_seq(Sequence *seqm)
@@ -693,7 +690,6 @@ void change_sequence(Scene *scene)
                        }
 
                        update_changed_seq_and_deps(scene, last_seq, 0, 1);
-                       BIF_undo_push("Change Strip Effect, Sequencer");
                }
        }
        else if(last_seq->type == SEQ_IMAGE) {
@@ -1334,7 +1330,6 @@ void seq_remap_paths(Scene *scene)
        }
        SEQ_END
                
-       BIF_undo_push("Remap Paths, Sequencer");
 }
 
 
@@ -1360,7 +1355,6 @@ void no_gaps(Scene *scene)
                }
        }
 
-       BIF_undo_push("No Gaps, Sequencer");
 }
 
 #if 0
@@ -1430,7 +1424,6 @@ void seq_snap(Scene *scene, short event)
        /* as last: */
        sort_seq(scene);
 
-       BIF_undo_push("Snap Strips, Sequencer");
 }
 
 void seq_snap_menu(Scene *scene)
@@ -1473,8 +1466,6 @@ static int sequencer_mute_exec(bContext *C, wmOperator *op)
                }
        }
        
-       ED_undo_push(C, "Mute Strips, Sequencer");
-       
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -1490,8 +1481,10 @@ void SEQUENCER_OT_mute(struct wmOperatorType *ot)
        ot->exec= sequencer_mute_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", "");
 }
 
@@ -1525,8 +1518,6 @@ static int sequencer_unmute_exec(bContext *C, wmOperator *op)
                }
        }
        
-       ED_undo_push(C, "UnMute Strips, Sequencer");
-       
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -1542,8 +1533,10 @@ void SEQUENCER_OT_unmute(struct wmOperatorType *ot)
        ot->exec= sequencer_unmute_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_enum(ot->srna, "type", sequencer_prop_operate_types, SEQ_SELECTED, "Type", "");
 }
 
@@ -1564,8 +1557,6 @@ static int sequencer_lock_exec(bContext *C, wmOperator *op)
                }
        }
 
-       ED_undo_push(C, "Lock Strips, Sequencer");
-
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -1581,7 +1572,9 @@ void SEQUENCER_OT_lock(struct wmOperatorType *ot)
        ot->exec= sequencer_lock_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* unlock operator */
@@ -1600,7 +1593,6 @@ static int sequencer_unlock_exec(bContext *C, wmOperator *op)
                }
        }
 
-       ED_undo_push(C, "UnLock Strips, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -1616,7 +1608,9 @@ void SEQUENCER_OT_unlock(struct wmOperatorType *ot)
        ot->exec= sequencer_unlock_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* reload operator */
@@ -1635,8 +1629,6 @@ static int sequencer_reload_exec(bContext *C, wmOperator *op)
                }
        }
 
-       ED_undo_push(C, "UnLock Strips, Sequencer");
-
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -1652,7 +1644,9 @@ void SEQUENCER_OT_reload(struct wmOperatorType *ot)
        ot->exec= sequencer_reload_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* reload operator */
@@ -1666,8 +1660,6 @@ static int sequencer_refresh_all_exec(bContext *C, wmOperator *op)
 
        free_imbuf_seq(&ed->seqbase);
 
-       ED_undo_push(C, "Refresh, Sequencer");
-
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -1683,7 +1675,9 @@ void SEQUENCER_OT_refresh_all(struct wmOperatorType *ot)
        ot->exec= sequencer_refresh_all_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* cut operator */
@@ -1742,7 +1736,6 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
        }
 
        if (changed) {
-               ED_undo_push(C, "Cut Strips, Sequencer");
                ED_area_tag_redraw(CTX_wm_area(C));
        }
        
@@ -1780,8 +1773,10 @@ void SEQUENCER_OT_cut(struct wmOperatorType *ot)
        ot->exec= sequencer_cut_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_int(ot->srna, "frame", 0, INT_MIN, INT_MAX, "Frame", "Frame where selected strips will be cut", INT_MIN, INT_MAX);
        RNA_def_enum(ot->srna, "type", prop_cut_types, SEQ_CUT_SOFT, "Type", "the type of cut operation to perform on strips");
        RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side that remains selected after cutting");
@@ -1801,7 +1796,6 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *op)
        recurs_dupli_seq(scene, ed->seqbasep, &new);
        addlisttolist(ed->seqbasep, &new);
 
-       ED_undo_push(C, "Cut Strips, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -1829,7 +1823,10 @@ void SEQUENCER_OT_add_duplicate(wmOperatorType *ot)
        ot->exec= sequencer_add_duplicate_exec;
 
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* to give to transform */
        RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
 }
@@ -1889,7 +1886,6 @@ static int sequencer_delete_exec(bContext *C, wmOperator *op)
                ms= ms->prev;
        }
 
-       ED_undo_push(C, "Delete Strip(s), Sequencer");
        //ED_area_tag_redraw(CTX_wm_area(C));
        WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, NULL); /* redraw other sequencer views */
        
@@ -1909,6 +1905,9 @@ void SEQUENCER_OT_delete(wmOperatorType *ot)
        ot->exec= sequencer_delete_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -1982,7 +1981,6 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
        /* as last: */
        sort_seq(scene);
        
-       ED_undo_push(C, "Separate Image Strips, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -2000,6 +1998,9 @@ void SEQUENCER_OT_separate_images(wmOperatorType *ot)
        ot->exec= sequencer_separate_images_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -2027,7 +2028,6 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *op)
 
                set_last_seq(scene, NULL);
 
-               ED_undo_push(C, "Enter Meta Strip, Sequence");
        }
        else {
                /* Exit Metastrip (if possible) */
@@ -2053,7 +2053,6 @@ static int sequencer_meta_toggle_exec(bContext *C, wmOperator *op)
 
                MEM_freeN(ms);
 
-               ED_undo_push(C, "Exit Meta Strip, Sequence");
        }
 
        ED_area_tag_redraw(CTX_wm_area(C));
@@ -2070,6 +2069,9 @@ void SEQUENCER_OT_meta_toggle(wmOperatorType *ot)
        ot->exec= sequencer_meta_toggle_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -2157,8 +2159,6 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op)
 
        if( seq_test_overlap(ed->seqbasep, seqm) ) shuffle_seq(ed->seqbasep, seqm);
 
-       ED_undo_push(C, "Make Meta Strip, Sequencer");
-       
        ED_area_tag_redraw(CTX_wm_area(C));
        return OPERATOR_FINISHED;
 }
@@ -2174,6 +2174,9 @@ void SEQUENCER_OT_meta_make(wmOperatorType *ot)
        ot->exec= sequencer_meta_make_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -2225,8 +2228,6 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *op)
 
        sort_seq(scene);
 
-       ED_undo_push(C, "UnMeta Strip, Sequencer");
-
        ED_area_tag_redraw(CTX_wm_area(C));
        return OPERATOR_FINISHED;
 }
@@ -2242,6 +2243,9 @@ void SEQUENCER_OT_meta_separate(wmOperatorType *ot)
        ot->exec= sequencer_meta_separate_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* view_all operator */
@@ -2304,6 +2308,9 @@ void SEQUENCER_OT_view_all(wmOperatorType *ot)
        ot->exec= sequencer_view_all_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 
@@ -2381,6 +2388,9 @@ void SEQUENCER_OT_view_selected(wmOperatorType *ot)
        ot->exec= sequencer_view_selected_exec;
 
        ot->poll= ED_operator_sequencer_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 
@@ -2415,7 +2425,6 @@ static int sequencer_view_zoom_exec(bContext *C, wmOperator *op)
        UI_view2d_curRect_validate(v2d);
        UI_view2d_sync(sc, area, v2d, V2D_LOCK_COPY);
 
-       ED_undo_push(C,"Zoom View, Sequencer");
        return OPERATOR_FINISHED;
 }
 
@@ -2433,7 +2442,10 @@ void SEQUENCER_OT_view_zoom(wmOperatorType *ot)
        ot->modal= WM_border_select_modal;
 
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
index 93c5026..2328ab2 100644 (file)
@@ -78,7 +78,6 @@
 
 /* own include */
 #include "sequencer_intern.h"
-static void BIF_undo_push() {}
 static void *find_nearest_marker() {return NULL;}
 static void deselect_markers() {}
        
@@ -118,8 +117,6 @@ void select_dir_from_last(Scene *scene, int lr)
        
        select_channel_direction(scene, seq,lr);
        
-       if (lr==1)      BIF_undo_push("Select Strips to the Left, Sequencer");
-       else            BIF_undo_push("Select Strips to the Right, Sequencer");
 }
        
 void select_surrounding_handles(Scene *scene, Sequence *test) /* XXX BRING BACK */
@@ -149,7 +146,6 @@ void select_surround_from_last(Scene *scene)
                return;
        
        select_surrounding_handles(scene, seq);
-       ED_undo_push(C, "Select Surrounding Handles, Sequencer");
 }
 #endif
 
@@ -204,9 +200,6 @@ void select_neighbor_from_last(Scene *scene, int lr)
                }
        }
        if (change) {
-               
-               if (lr==1)      BIF_undo_push("Select Left Handles, Sequencer");
-               else            BIF_undo_push("Select Right Handles, Sequencer");
        }
 }
 
@@ -238,7 +231,6 @@ static int sequencer_deselect_exec(bContext *C, wmOperator *op)
                        seq->flag |= SELECT;
                }
        }
-       ED_undo_push(C, "(De)Select All, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -254,7 +246,9 @@ void SEQUENCER_OT_deselect_all(struct wmOperatorType *ot)
        ot->exec= sequencer_deselect_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -277,7 +271,6 @@ static int sequencer_select_invert_exec(bContext *C, wmOperator *op)
                        seq->flag |= SELECT;
                }
        }
-       ED_undo_push(C, "Select Invert, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -293,7 +286,9 @@ void SEQUENCER_OT_select_invert(struct wmOperatorType *ot)
        ot->exec= sequencer_select_invert_exec;
 
        ot->poll= ED_operator_sequencer_active;
-       ot->flag= OPTYPE_REGISTER;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 
@@ -339,8 +334,6 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
                        deselect_markers(0, 0);
                        marker->flag |= SELECT;                         
                }
-
-               ED_undo_push(C,"Select Marker, Sequencer");
                
        } else {
        
@@ -429,8 +422,6 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
 
                        recurs_sel_seq(seq);
                }
-
-               ED_undo_push(C,"Select Strips, Sequencer");
        }
        
        /* marker transform */
@@ -465,7 +456,10 @@ void SEQUENCER_OT_select(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= sequencer_select_invoke;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_select_types, 0, "Type", "");
 }
@@ -530,7 +524,6 @@ static int sequencer_select_more_exec(bContext *C, wmOperator *op)
        Scene *scene= CTX_data_scene(C);
        
        if (select_more_less_seq__internal(scene, 0, 0)) {
-               ED_undo_push(C, "Select More, Sequencer");
                ED_area_tag_redraw(CTX_wm_area(C));
        }
        
@@ -546,7 +539,10 @@ void SEQUENCER_OT_select_more(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= sequencer_select_more_exec;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
 }
 
@@ -557,7 +553,6 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *op)
        Scene *scene= CTX_data_scene(C);
        
        if (select_more_less_seq__internal(scene, 1, 0)) {
-               ED_undo_push(C, "Select less, Sequencer");
                ED_area_tag_redraw(CTX_wm_area(C));
        }
        
@@ -573,7 +568,10 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= sequencer_select_less_exec;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
 }
 
@@ -610,7 +608,6 @@ static int sequencer_select_pick_linked_invoke(bContext *C, wmOperator *op, wmEv
                selected = select_more_less_seq__internal(scene, 1, 1);
        }
        
-       ED_undo_push(C, "Select pick linked, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
        
        return OPERATOR_FINISHED;
@@ -625,7 +622,10 @@ void SEQUENCER_OT_select_pick_linked(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= sequencer_select_pick_linked_invoke;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_select_types, 0, "Type", "Type of select linked operation");
 }
@@ -642,7 +642,6 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *op)
                selected = select_more_less_seq__internal(scene, 1, 1);
        }
 
-       ED_undo_push(C, "Select linked, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -657,7 +656,10 @@ void SEQUENCER_OT_select_linked(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= sequencer_select_linked_exec;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
 }
 
@@ -691,7 +693,6 @@ static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
                }
        }
 
-       ED_undo_push(C, "Select Handles, Sequencer");
        ED_area_tag_redraw(CTX_wm_area(C));
 
        return OPERATOR_FINISHED;
@@ -706,7 +707,10 @@ void SEQUENCER_OT_select_handles(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= sequencer_select_handles_exec;
        ot->poll= ED_operator_sequencer_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "side", prop_side_types, SEQ_SIDE_BOTH, "Side", "The side of the handle that is selected");
 }
@@ -751,7 +755,6 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
                }
        }
 
-       ED_undo_push(C,"Border Select");
        return OPERATOR_FINISHED;
 } 
 
@@ -770,6 +773,9 @@ void SEQUENCER_OT_borderselect(wmOperatorType *ot)
        
        ot->poll= ED_operator_sequencer_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
index ee2f1f9..8b8859d 100644 (file)
@@ -555,6 +555,9 @@ void VIEW3D_OT_viewrotate(wmOperatorType *ot)
        ot->invoke= viewrotate_invoke;
        ot->modal= viewrotate_modal;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /* ************************ viewmove ******************************** */
@@ -634,6 +637,9 @@ void VIEW3D_OT_viewmove(wmOperatorType *ot)
        ot->invoke= viewmove_invoke;
        ot->modal= viewmove_modal;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /* ************************ viewzoom ******************************** */
@@ -821,7 +827,7 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void VIEW3D_OT_viewzoom(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name= "Rotate view";
+       ot->name= "Zoom view";
        ot->idname= "VIEW3D_OT_viewzoom";
 
        /* api callbacks */
@@ -829,7 +835,10 @@ void VIEW3D_OT_viewzoom(wmOperatorType *ot)
        ot->exec= viewzoom_exec;
        ot->modal= viewzoom_modal;
        ot->poll= ED_operator_view3d_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
 }
 
@@ -906,7 +915,10 @@ void VIEW3D_OT_viewhome(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= viewhome_exec;
        ot->poll= ED_operator_view3d_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        RNA_def_boolean(ot->srna, "center", 0, "Center", "");
 }
 
@@ -1037,6 +1049,9 @@ void VIEW3D_OT_viewcenter(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= viewcenter_exec;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
 }
 
 /* ********************* Set render border operator ****************** */
@@ -1108,6 +1123,9 @@ void VIEW3D_OT_render_border(wmOperatorType *ot)
        
        ot->poll= ED_operator_view3d_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
@@ -1278,6 +1296,9 @@ void VIEW3D_OT_border_zoom(wmOperatorType *ot)
        
        ot->poll= ED_operator_view3d_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* rna */
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
@@ -1521,8 +1542,10 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= viewnumpad_exec;
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
        ot->flag= OPTYPE_REGISTER;
-
+       
        RNA_def_enum(ot->srna, "view", prop_view_items, 0, "View", "");
 }
 
@@ -1621,7 +1644,10 @@ void VIEW3D_OT_clipping(wmOperatorType *ot)
        ot->modal= WM_border_select_modal;
 
        ot->poll= ED_operator_view3d_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* rna */
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX);
@@ -1670,7 +1696,10 @@ void VIEW3D_OT_drawtype(wmOperatorType *ot)
        ot->exec= view3d_drawtype_exec;
 
        ot->poll= ED_operator_view3d_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       
        /* rna XXX should become enum */
        RNA_def_int(ot->srna, "draw_type", 0, INT_MIN, INT_MAX, "Draw Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "draw_type_alternate", -1, INT_MIN, INT_MAX, "Draw Type Alternate", "", INT_MIN, INT_MAX);
index 73ceb5c..0154380 100644 (file)
@@ -724,6 +724,9 @@ void VIEW3D_OT_lasso_select(wmOperatorType *ot)
        ot->exec= view3d_lasso_select_exec;
        ot->poll= WM_operator_winactive;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
        RNA_def_enum(ot->srna, "type", lasso_select_types, 0, "Type", "");
 }
@@ -1481,7 +1484,6 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op)
                }
                MEM_freeN(vbuffer);
        }
-       ED_undo_push(C,"Border Select");
        return OPERATOR_FINISHED;
 } 
 
@@ -1507,6 +1509,9 @@ void VIEW3D_OT_borderselect(wmOperatorType *ot)
        
        ot->poll= ED_operator_view3d_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* rna */
        RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX);
@@ -1545,10 +1550,9 @@ static int view3d_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
        }
        else 
                mouse_select(C, mval, extend, 0);
-       
-       ED_undo_push(C,"Mouse Select");
+
        /* allowing tweaks */
-       return OPERATOR_PASS_THROUGH;
+       return OPERATOR_PASS_THROUGH|OPERATOR_FINISHED;
 }
 
 void VIEW3D_OT_select(wmOperatorType *ot)
@@ -1560,7 +1564,10 @@ void VIEW3D_OT_select(wmOperatorType *ot)
        /* api callbacks */
        ot->invoke= view3d_select_invoke;
        ot->poll= ED_operator_view3d_active;
-
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        /* properties */
        RNA_def_enum(ot->srna, "type", prop_select_types, 0, "Type", "");
 }
@@ -1774,7 +1781,6 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op)
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C));
        }
        
-       ED_undo_push(C,"Circle Select");
        return OPERATOR_FINISHED;
 }
 
@@ -1788,6 +1794,9 @@ void VIEW3D_OT_circle_select(wmOperatorType *ot)
        ot->exec= view3d_circle_select_exec;
        ot->poll= ED_operator_view3d_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX);
        RNA_def_int(ot->srna, "radius", 0, INT_MIN, INT_MAX, "Radius", "", INT_MIN, INT_MAX);
index 05162cb..fb9d5a7 100644 (file)
@@ -415,6 +415,9 @@ void VIEW3D_OT_setcameratoview(wmOperatorType *ot)
        /* api callbacks */
        ot->exec= view3d_setcameratoview_exec;  
        ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ********************************** */
index 80dbf05..41a343d 100644 (file)
 #define MAXINDEX       512000
 
 /* XXX */
-static void BIF_undo_push() {}
 static void error() {}
 
 /* polling - retrieve whether cursor should be set or operator should be done */
@@ -397,7 +396,6 @@ void clear_vpaint(Scene *scene)
                *to= paintcol;
                to++; 
        }
-       BIF_undo_push("Clear vertex colors");
        DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
        
 }
@@ -430,7 +428,6 @@ void clear_vpaint_selectedfaces(Scene *scene)
                }
        }
        
-       BIF_undo_push("Clear vertex colors");
        DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
 }
 
@@ -541,7 +538,6 @@ void clear_wpaint_selectedfaces(Scene *scene)
        copy_wpaint_prev(wp, NULL, 0);
 
        DAG_object_flush_update(scene, ob, OB_RECALC_DATA);
-       BIF_undo_push("Set vertex weight");
 }
 
 
@@ -1207,6 +1203,9 @@ void VIEW3D_OT_wpaint_toggle(wmOperatorType *ot)
        ot->exec= set_wpaint;
        ot->poll= ED_operator_object_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 /* ************ paint radial controls *************/
@@ -1257,7 +1256,6 @@ static int vpaint_radial_control_exec(bContext *C, wmOperator *op)
        int ret = paint_radial_control_exec(op, CTX_data_scene(C)->toolsettings->vpaint);
        char str[256];
        WM_radial_control_string(op, str, 256);
-       ED_undo_push(C, str);   
        return ret;
 }
 
@@ -1281,7 +1279,6 @@ static int wpaint_radial_control_exec(bContext *C, wmOperator *op)
        int ret = paint_radial_control_exec(op, CTX_data_scene(C)->toolsettings->wpaint);
        char str[256];
        WM_radial_control_string(op, str, 256);
-       ED_undo_push(C, str);   
        return ret;
 }
 
@@ -1296,6 +1293,9 @@ void VIEW3D_OT_wpaint_radial_control(wmOperatorType *ot)
        ot->modal= wpaint_radial_control_modal;
        ot->exec= wpaint_radial_control_exec;
        ot->poll= wp_poll;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 void VIEW3D_OT_vpaint_radial_control(wmOperatorType *ot)
@@ -1309,6 +1309,9 @@ void VIEW3D_OT_vpaint_radial_control(wmOperatorType *ot)
        ot->modal= vpaint_radial_control_modal;
        ot->exec= vpaint_radial_control_exec;
        ot->poll= vp_poll;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 /* ************ weight paint operator ********** */
@@ -1351,8 +1354,6 @@ static void wpaint_exit(bContext *C, wmOperator *op)
        
        DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA);
        
-       ED_undo_push(C, "Weight Paint");
-       
        MEM_freeN(wpd);
        op->customdata= NULL;
 }
@@ -1635,6 +1636,9 @@ void VIEW3D_OT_wpaint(wmOperatorType *ot)
        /* ot->exec= vpaint_exec; <-- needs stroke property */
        ot->poll= wp_poll;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 
@@ -1706,6 +1710,9 @@ void VIEW3D_OT_vpaint_toggle(wmOperatorType *ot)
        ot->exec= set_vpaint;
        ot->poll= ED_operator_object_active;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 
@@ -1751,8 +1758,6 @@ static void vpaint_exit(bContext *C, wmOperator *op)
        /* frees prev buffer */
        copy_vpaint_prev(ts->vpaint, NULL, 0);
        
-       ED_undo_push(C, "Vertex Paint");
-       
        MEM_freeN(vpd);
        op->customdata= NULL;
 }
@@ -1929,6 +1934,9 @@ void VIEW3D_OT_vpaint(wmOperatorType *ot)
        /* ot->exec= vpaint_exec; <-- needs stroke property */
        ot->poll= vp_poll;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
 }
 
 
index 0d36d63..1a31373 100644 (file)
@@ -107,6 +107,12 @@ void ED_undo_push(bContext *C, char *str)
        }
 }
 
+void ED_undo_push_op(bContext *C, wmOperator *op)
+{
+       /* in future, get undo string info? */
+       ED_undo_push(C, op->type->name);
+}
+
 static int ed_undo_step(bContext *C, wmOperator *op, int step)
 {      
        Object *obedit= CTX_data_edit_object(C);
index 2b53121..b9fe054 100644 (file)
@@ -41,6 +41,7 @@ struct wmWindowManager;
 
 /* flag */
 #define OPTYPE_REGISTER                1
+#define OPTYPE_UNDO                    2
 
 /* context to call operator in for WM_operator_name_call */
 enum {
index 0da13fa..6d18df4 100644 (file)
 #include "BKE_report.h"
 #include "BKE_utildefines.h"
 
+#include "ED_anim_api.h"
 #include "ED_screen.h"
 #include "ED_space_api.h"
-#include "ED_anim_api.h"
+#include "ED_util.h"
 
 #include "RNA_access.h"
 
@@ -214,8 +215,14 @@ int WM_operator_call(bContext *C, wmOperator *op)
                if(op->reports->list.first)
                        uiPupMenuReports(C, op->reports);
        
-       if((retval & OPERATOR_FINISHED) && (op->type->flag & OPTYPE_REGISTER)) {
-               wm_operator_register(CTX_wm_manager(C), op);
+       if(retval & OPERATOR_FINISHED) {
+               if(op->type->flag & OPTYPE_UNDO)
+                       ED_undo_push_op(C, op);
+               
+               if(op->type->flag & OPTYPE_REGISTER)
+                       wm_operator_register(CTX_wm_manager(C), op);
+               else
+                       WM_operator_free(op);
        }
        else
                WM_operator_free(op);
@@ -282,8 +289,14 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P
                                WM_operator_print(op);
                }
 
-               if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
-                       wm_operator_register(wm, op);
+               if(retval & OPERATOR_FINISHED) {
+                       if(ot->flag & OPTYPE_UNDO)
+                               ED_undo_push_op(C, op);
+                       
+                       if(ot->flag & OPTYPE_REGISTER)
+                               wm_operator_register(wm, op);
+                       else
+                               WM_operator_free(op);
                }
                else if(!(retval & OPERATOR_RUNNING_MODAL)) {
                        WM_operator_free(op);
@@ -510,8 +523,17 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi)
                if(winevent->keymodifier!=kmi->keymodifier) return 0;
        
        /* happens on tweak failure */
-       if(kmi->is_tweak)
-               if(winevent->no_tweak) return 0;
+       /* weak code, testing only now! (ton) */
+       if(kmi->is_tweak) {
+               /* only after tweak keymap we allow the hack */
+               if(winevent->no_tweak) {
+                       winevent->no_tweak= 2;
+                       return 0;
+               }
+       }
+       
+       if(winevent->no_tweak==1)
+               return 0;
        
        return 1;
 }
@@ -562,8 +584,14 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                        WM_operator_print(op); /* todo - this print may double up, might want to check more flags then the FINISHED */
                        }                       
 
-                       if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
-                               wm_operator_register(CTX_wm_manager(C), op);
+                       if(retval & OPERATOR_FINISHED) {
+                               if(ot->flag & OPTYPE_UNDO)
+                                       ED_undo_push_op(C, op);
+                               
+                               if(ot->flag & OPTYPE_REGISTER)
+                                       wm_operator_register(CTX_wm_manager(C), op);
+                               else
+                                       WM_operator_free(op);
                                handler->op= NULL;
                        }
                        else if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
index b4ab5d9..22189b1 100644 (file)
@@ -64,6 +64,7 @@ static void keymap_event_set(wmKeymapItem *kmi, short type, short val, int modif
        }
        else {
                
+               /* defines? */
                if(modifier & KM_SHIFT)
                        kmi->shift= 1;
                else if(modifier & KM_SHIFT2)
index 55d0fd4..50de3a0 100644 (file)
@@ -283,8 +283,6 @@ static void WM_OT_save_homefile(wmOperatorType *ot)
        ot->invoke= WM_operator_confirm;
        ot->exec= WM_write_homefile;
        ot->poll= WM_operator_winactive;
-       
-       ot->flag= OPTYPE_REGISTER;
 }
 
 /* ********* recent file *********** */
@@ -351,10 +349,7 @@ static void WM_OT_open_recentfile(wmOperatorType *ot)
        ot->exec= recentfile_exec;
        ot->poll= WM_operator_winactive;
        
-       ot->flag= OPTYPE_REGISTER;
-       
        RNA_def_property(ot->srna, "nr", PROP_ENUM, PROP_NONE);
-
 }
 
 /* ********* main file *********** */