minor edits to mesh operators

- 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.
This commit is contained in:
Campbell Barton 2012-11-01 05:07:15 +00:00
parent dcb3a5cbf4
commit 53160bd508
6 changed files with 34 additions and 32 deletions

@ -571,7 +571,7 @@ class VIEW3D_MT_select_edit_mesh(Menu):
layout.separator() layout.separator()
layout.operator("mesh.select_random", text="Random") 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.edges_select_sharp", text="Sharp Edges")
layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces") layout.operator("mesh.faces_select_linked_flat", text="Linked Flat Faces")
layout.operator("mesh.select_interior_faces", text="Interior Faces") layout.operator("mesh.select_interior_faces", text="Interior Faces")
@ -579,7 +579,7 @@ class VIEW3D_MT_select_edit_mesh(Menu):
layout.separator() 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: if context.scene.tool_settings.mesh_select_mode[2] is False:
layout.operator("mesh.select_non_manifold", text="Non Manifold") layout.operator("mesh.select_non_manifold", text="Non Manifold")
layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges") layout.operator("mesh.select_loose_verts", text="Loose Verts/Edges")
@ -1941,10 +1941,6 @@ class VIEW3D_MT_edit_mesh_dissolve(Menu):
layout.separator() layout.separator()
layout.operator_enum("mesh.dissolve", "type")
layout.separator()
layout.operator("mesh.dissolve_limited") layout.operator("mesh.dissolve_limited")

@ -5641,8 +5641,8 @@ static int select_nth_exec(bContext *C, wmOperator *op)
void CURVE_OT_select_nth(wmOperatorType *ot) void CURVE_OT_select_nth(wmOperatorType *ot)
{ {
/* identifiers */ /* identifiers */
ot->name = "Select Nth"; ot->name = "Checker Deselect";
ot->description = ""; ot->description = "Deselect every other vertex";
ot->idname = "CURVE_OT_select_nth"; ot->idname = "CURVE_OT_select_nth";
/* api callbacks */ /* api callbacks */

@ -2308,9 +2308,9 @@ static int edbm_select_nth_exec(bContext *C, wmOperator *op)
void MESH_OT_select_nth(wmOperatorType *ot) void MESH_OT_select_nth(wmOperatorType *ot)
{ {
/* identifiers */ /* identifiers */
ot->name = "Select Nth"; ot->name = "Checker Deselect";
ot->idname = "MESH_OT_select_nth"; 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 */ /* api callbacks */
ot->exec = edbm_select_nth_exec; ot->exec = edbm_select_nth_exec;

@ -3808,30 +3808,36 @@ void MESH_OT_screw(wmOperatorType *ot)
"Axis", "Axis in global view space", -1.0f, 1.0f); "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); Object *obedit = CTX_data_edit_object(C);
BMEditMesh *em = BMEdit_FromObject(obedit); BMEditMesh *em = BMEdit_FromObject(obedit);
BMFace *efa; BMFace *efa;
BMIter iter; BMIter iter;
int numverts = RNA_int_get(op->ptr, "number"); const int numverts = RNA_int_get(op->ptr, "number");
int type = RNA_enum_get(op->ptr, "type"); const int type = RNA_enum_get(op->ptr, "type");
BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) {
int select = 0; int select;
if (type == 0 && efa->len < numverts) { switch (type) {
select = 1; case 0:
} select = (efa->len < numverts);
else if (type == 1 && efa->len == numverts) { break;
select = 1; case 1:
} select = (efa->len == numverts);
else if (type == 2 && efa->len > numverts) { break;
select = 1; case 2:
} select = (efa->len > numverts);
else if (type == 3 && efa->len != numverts) { break;
select = 1; case 3:
select = (efa->len != numverts);
break;
default:
BLI_assert(0);
select = FALSE;
break;
} }
if (select) { if (select) {
@ -3845,7 +3851,7 @@ static int edbm_select_by_number_vertices_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED; 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[] = { static const EnumPropertyItem type_items[] = {
{0, "LESS", 0, "Less Than", ""}, {0, "LESS", 0, "Less Than", ""},
@ -3856,12 +3862,12 @@ void MESH_OT_select_by_number_vertices(wmOperatorType *ot)
}; };
/* identifiers */ /* identifiers */
ot->name = "Select by Number of Vertices"; ot->name = "Select Faces by Sides";
ot->description = "Select vertices or faces by vertex count"; ot->description = "Select vertices or faces by the number of polygon sides";
ot->idname = "MESH_OT_select_by_number_vertices"; ot->idname = "MESH_OT_select_face_by_sides";
/* api callbacks */ /* api callbacks */
ot->exec = edbm_select_by_number_vertices_exec; ot->exec = edbm_select_face_by_sides_exec;
ot->poll = ED_operator_editmesh; ot->poll = ED_operator_editmesh;
/* flags */ /* flags */

@ -121,7 +121,7 @@ void MESH_OT_select_linked(struct wmOperatorType *ot);
void MESH_OT_select_linked_pick(struct wmOperatorType *ot); void MESH_OT_select_linked_pick(struct wmOperatorType *ot);
void MESH_OT_hide(struct wmOperatorType *ot); void MESH_OT_hide(struct wmOperatorType *ot);
void MESH_OT_reveal(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_loose_verts(struct wmOperatorType *ot);
void MESH_OT_select_mirror(struct wmOperatorType *ot); void MESH_OT_select_mirror(struct wmOperatorType *ot);
void MESH_OT_normals_make_consistent(struct wmOperatorType *ot); void MESH_OT_normals_make_consistent(struct wmOperatorType *ot);

@ -68,7 +68,7 @@ void ED_operatortypes_mesh(void)
WM_operatortype_append(MESH_OT_select_random); WM_operatortype_append(MESH_OT_select_random);
WM_operatortype_append(MESH_OT_hide); WM_operatortype_append(MESH_OT_hide);
WM_operatortype_append(MESH_OT_reveal); 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_loose_verts);
WM_operatortype_append(MESH_OT_select_mirror); WM_operatortype_append(MESH_OT_select_mirror);
WM_operatortype_append(MESH_OT_normals_make_consistent); WM_operatortype_append(MESH_OT_normals_make_consistent);