merge with 2.5 (not trunk, last merge message said that on accident) at r22252
[blender.git] / source / blender / editors / mesh / editmesh_add.c
index 4b891843f5e8bdbe1eb1fcb00a52f8a07b66916a..ff0814661ebd84cb6a5cfff6434a16e01a6eca2b 100644 (file)
@@ -1180,9 +1180,9 @@ static float new_primitive_matrix(bContext *C, float primmat[][4])
        
        Mat4One(primmat);
        
-       if(rv3d)
+       if(rv3d && (U.flag & USER_ADD_VIEWALIGNED)) {
                Mat3CpyMat4(vmat, rv3d->viewmat);
-       else
+       else
                Mat3One(vmat);
        
        /* inverse transform for view and object */
@@ -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);
-}
-