edge loop delete, should be a c macro but they cant do settings atm
authorCampbell Barton <ideasman42@gmail.com>
Mon, 5 Oct 2009 19:42:48 +0000 (19:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 5 Oct 2009 19:42:48 +0000 (19:42 +0000)
release/scripts/modules/bpy_ops.py
source/blender/editors/mesh/editmesh_tools.c

index 83c2e82bf6cc31e462c58ecc9e03f0f9aecc2ff6..834a33d305d14c80cae395b6763c8b1bc1796fa3 100644 (file)
@@ -139,3 +139,20 @@ class bpy_ops_submodule_op(object):
 
 import bpy
 bpy.ops = bpy_ops()
+
+# TODO, C macro's cant define settings :|
+
+class MESH_OT_delete_edgeloop(bpy.types.Operator):
+       '''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
+       __idname__ = "mesh.delete_edgeloop"
+       __label__ = "Export PLY"
+       
+       def execute(self, context):
+               bpy.ops.tfm.edge_slide(value=1.0)
+               bpy.ops.mesh.select_more()
+               bpy.ops.mesh.remove_doubles()
+               return ('FINISHED',)
+
+
+bpy.ops.add(MESH_OT_delete_edgeloop)
+
index 510f6ab464bec00c95ac3368e9a3cf509c3dca9b..88d08efe95e7c83f6a4cf5973fe5a1812e5f15fc 100644 (file)
@@ -1305,8 +1305,12 @@ static int delete_mesh_exec(bContext *C, wmOperator *op)
 {
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
+       int type= RNA_enum_get(op->ptr, "type");
 
-       delete_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type"));
+       if(type==6)
+               return WM_operator_name_call(C, "MESH_OT_delete_edgeloop", WM_OP_EXEC_DEFAULT, NULL);
+
+       delete_mesh(obedit, em, op, type);
 
        DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
        WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);