diff options
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 4b891843f5e..806ef4c299e 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1557,50 +1557,3 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) RNA_def_int(ot->srna, "subdivisions", 2, 0, 6, "Subdivisions", "", 0, 8); RNA_def_float(ot->srna, "size", 1.0f, 0.0f, FLT_MAX, "Size", "", 0.001f, 100.00); } - -/****************** add duplicate operator ***************/ - -static int mesh_duplicate_exec(bContext *C, wmOperator *op) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= CTX_data_edit_object(C); - EditMesh *em= BKE_mesh_get_editmesh(ob->data); - - adduplicateflag(em, SELECT); - - BKE_mesh_end_editmesh(ob->data, em); - - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); - - return OPERATOR_FINISHED; -} - -static int mesh_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - WM_cursor_wait(1); - mesh_duplicate_exec(C, op); - WM_cursor_wait(0); - - RNA_int_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - return OPERATOR_FINISHED; -} - -void MESH_OT_duplicate(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Duplicate"; - ot->idname= "MESH_OT_duplicate"; - - /* api callbacks */ - ot->invoke= mesh_duplicate_invoke; - ot->exec= mesh_duplicate_exec; - - ot->poll= ED_operator_editmesh; - - /* to give to transform */ - RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX); -} - |