remove doubles op, ton: is this working properly?

This commit is contained in:
Shaul Kedem
2009-01-23 03:07:07 +00:00
parent 6f24a2a559
commit b7f0add801
3 changed files with 29 additions and 0 deletions

View File

@@ -487,6 +487,32 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) /
return a; /* amount */
}
static int removedoublesflag_exec(bContext *C, wmOperator *op)
{
Object *obedit= CTX_data_edit_object(C);
Scene *scene = CTX_data_scene(C);
EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
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;
}
void MESH_OT_removedoublesflag(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Remove Doubles";
ot->idname= "MESH_OT_removedoublesflag";
/* api callbacks */
ot->exec= removedoublesflag_exec;
ot->poll= ED_operator_editmesh;
}
// XXX is this needed?
/* called from buttons */
static void xsortvert_flag__doSetX(void *userData, EditVert *eve, int x, int y, int index)
{

View File

@@ -215,6 +215,7 @@ void MESH_OT_subdivide(struct wmOperatorType *ot);
void MESH_OT_subdivide_multi(struct wmOperatorType *ot);
void MESH_OT_subdivide_multi_fractal(struct wmOperatorType *ot);
void MESH_OT_subdivide_smooth(struct wmOperatorType *ot);
void MESH_OT_removedoublesflag(struct wmOperatorType *ot);
#endif // MESH_INTERN_H

View File

@@ -131,6 +131,7 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_add_primitive_uv_sphere);
WM_operatortype_append(MESH_OT_add_primitive_ico_sphere);
WM_operatortype_append(MESH_OT_add_duplicate);
WM_operatortype_append(MESH_OT_removedoublesflag);
}
@@ -166,6 +167,7 @@ void ED_keymap_mesh(wmWindowManager *wm)
/*WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
WM_keymap_add_item(keymap, "MESH_OT_subdivide_multi_fractal", WKEY, KM_PRESS, KM_ALT, 0);
WM_keymap_add_item(keymap, "MESH_OT_subdivide_smooth", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0);*/
WM_keymap_add_item(keymap, "MESH_OT_removedoublesflag", VKEY, KM_PRESS, KM_CTRL, 0);