Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c100
1 files changed, 45 insertions, 55 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 23a810ba66b..b3085a6705f 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -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);