minor edits to mesh operators
authorCampbell Barton <ideasman42@gmail.com>
Thu, 1 Nov 2012 05:07:15 +0000 (05:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 1 Nov 2012 05:07:15 +0000 (05:07 +0000)
- Rename 'mesh.select_nth' operator menu item 'Every N Number of Verts' to 'Checker Deselect',
  since its not just de-selecting verts (works on edges and faces too) and the term 'checker' gives a better description of the result.

- Rename 'mesh.select_by_number_vertices' to 'mesh.select_face_by_sides', since this is a face selection tool, which wasnt obvious from its name.

also remove dissolve by type menu since the option has been removed from the operator and was giving an error.

release/scripts/startup/bl_ui/space_view3d.py
source/blender/editors/curve/editcurve.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c

index d44213c199ac92a0de917a12f4c0fbb80339692a..c5f54fc2eeb7a1644a0108146de2cf01c4ec8b80 100644 (file)
@@ -571,7 +571,7 @@ class VIEW3D_MT_select_edit_mesh(Menu):
         layout.separator()
 
         layout.operator("mesh.select_random", text="Random")
-        layout.operator("mesh.select_nth", text="Every N Number of Verts")
+        layout.operator("mesh.select_nth")
         layout.operator("mesh.edges_select_sharp", text="Sharp Edges")
         layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
         layout.operator("mesh.select_interior_faces", text="Interior Faces")
@@ -579,7 +579,7 @@ class VIEW3D_MT_select_edit_mesh(Menu):
 
         layout.separator()
 
-        layout.operator("mesh.select_by_number_vertices", text="By Number of Verts")
+        layout.operator("mesh.select_face_by_sides")
         if context.scene.tool_settings.mesh_select_mode[2] is False:
             layout.operator("mesh.select_non_manifold", text="Non Manifold")
         layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
@@ -1941,10 +1941,6 @@ class VIEW3D_MT_edit_mesh_dissolve(Menu):
 
         layout.separator()
 
-        layout.operator_enum("mesh.dissolve", "type")
-
-        layout.separator()
-
         layout.operator("mesh.dissolve_limited")
 
 
index 9ae5d3ca557ce0097a800c4560da5d6c39742b94..485d73974cd88614daa01b4974d91d7ef7d437c0 100644 (file)
@@ -5641,8 +5641,8 @@ static int select_nth_exec(bContext *C, wmOperator *op)
 void CURVE_OT_select_nth(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Select Nth";
-       ot->description = "";
+       ot->name = "Checker Deselect";
+       ot->description = "Deselect every other vertex";
        ot->idname = "CURVE_OT_select_nth";
 
        /* api callbacks */
index d0ca9a78abd8fcc62fdebd76a8fdd0ff218855de..0379068afd9ba9313122c71c022888517ca9eb3d 100644 (file)
@@ -2308,9 +2308,9 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
 void MESH_OT_select_nth(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Select Nth";
+       ot->name = "Checker Deselect";
        ot->idname = "MESH_OT_select_nth";
-       ot->description = "Select every Nth element starting from a selected vertex, edge or face";
+       ot->description = "Deselect every Nth element starting from a selected vertex, edge or face";
 
        /* api callbacks */
        ot->exec = edbm_select_nth_exec;
index fd3eabdaec37b35e11e2834c136c1a82f4524306..f10faddc169e10153314809edf700d742a260b44 100644 (file)
@@ -3808,30 +3808,36 @@ void MESH_OT_screw(wmOperatorType *ot)
                             "Axis", "Axis in global view space", -1.0f, 1.0f);
 }
 
-static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
+static int edbm_select_face_by_sides_exec(bContext *C, wmOperator *op)
 {
        Object *obedit = CTX_data_edit_object(C);
        BMEditMesh *em = BMEdit_FromObject(obedit);
        BMFace *efa;
        BMIter iter;
-       int numverts = RNA_int_get(op->ptr, "number");
-       int type = RNA_enum_get(op->ptr, "type");
+       const int numverts = RNA_int_get(op->ptr, "number");
+       const int type = RNA_enum_get(op->ptr, "type");
 
        BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
 
-               int select = 0;
+               int select;
 
-               if (type == 0 && efa->len < numverts) {
-                       select = 1;
-               }
-               else if (type == 1 && efa->len == numverts) {
-                       select = 1;
-               }
-               else if (type == 2 && efa->len > numverts) {
-                       select = 1;
-               }
-               else if (type == 3 && efa->len != numverts) {
-                       select = 1;
+               switch (type) {
+                       case 0:
+                               select = (efa->len < numverts);
+                               break;
+                       case 1:
+                               select = (efa->len == numverts);
+                               break;
+                       case 2:
+                               select = (efa->len > numverts);
+                               break;
+                       case 3:
+                               select = (efa->len != numverts);
+                               break;
+                       default:
+                               BLI_assert(0);
+                               select = FALSE;
+                               break;
                }
 
                if (select) {
@@ -3845,7 +3851,7 @@ static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
+void MESH_OT_select_face_by_sides(wmOperatorType *ot)
 {
        static const EnumPropertyItem type_items[] = {
                {0, "LESS", 0, "Less Than", ""},
@@ -3856,12 +3862,12 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
        };
 
        /* identifiers */
-       ot->name = "Select by Number of Vertices";
-       ot->description = "Select vertices or faces by vertex count";
-       ot->idname = "MESH_OT_select_by_number_vertices";
+       ot->name = "Select Faces by Sides";
+       ot->description = "Select vertices or faces by the number of polygon sides";
+       ot->idname = "MESH_OT_select_face_by_sides";
        
        /* api callbacks */
-       ot->exec = edbm_select_by_number_vertices_exec;
+       ot->exec = edbm_select_face_by_sides_exec;
        ot->poll = ED_operator_editmesh;
        
        /* flags */
index 8b56109202a7e4fb2f890f24300e602a8ccd1b8a..82b785e5785b96434ccb1b0e5197c66ef787869b 100644 (file)
@@ -121,7 +121,7 @@ void MESH_OT_select_linked(struct wmOperatorType *ot);
 void MESH_OT_select_linked_pick(struct wmOperatorType *ot);
 void MESH_OT_hide(struct wmOperatorType *ot);
 void MESH_OT_reveal(struct wmOperatorType *ot);
-void MESH_OT_select_by_number_vertices(struct wmOperatorType *ot);
+void MESH_OT_select_face_by_sides(struct wmOperatorType *ot);
 void MESH_OT_select_loose_verts(struct wmOperatorType *ot);
 void MESH_OT_select_mirror(struct wmOperatorType *ot);
 void MESH_OT_normals_make_consistent(struct wmOperatorType *ot);
index 716af1d938beca6d6a00e304f656929198e364fb..d319fdcca262ddc242357ef5c2b718c904ad507b 100644 (file)
@@ -68,7 +68,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_select_random);
        WM_operatortype_append(MESH_OT_hide);
        WM_operatortype_append(MESH_OT_reveal);
-       WM_operatortype_append(MESH_OT_select_by_number_vertices);
+       WM_operatortype_append(MESH_OT_select_face_by_sides);
        WM_operatortype_append(MESH_OT_select_loose_verts);
        WM_operatortype_append(MESH_OT_select_mirror);
        WM_operatortype_append(MESH_OT_normals_make_consistent);