diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-23 08:17:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-23 08:17:29 +0300 |
commit | 2f472ccd60f37ad9adcd388575e88bcf78336074 (patch) | |
tree | 4a10ed79ac6b96b2456e61025fa6cde2f50ce618 /source/blender/editors/mesh/editmesh_tools.c | |
parent | 0a7fecac8f967150d736e3b99d469179b7290f45 (diff) |
add back 2.4x mesh vertex sort/randomize operators, were called xsort and hash in 2.4x.
available from vertex menu.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_tools.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 24c4e887ecc..4a0b1cb9e5e 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -563,6 +563,29 @@ static void xsortvert_flag(bContext *C, int flag) } +static int mesh_vertices_sort_exec(bContext *C, wmOperator *UNUSED(op)) +{ + xsortvert_flag(C, SELECT); + return OPERATOR_FINISHED; +} + +void MESH_OT_vertices_sort(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Vertex Sort"; + ot->description= "Sort vertex order"; + ot->idname= "MESH_OT_vertices_sort"; + + /* api callbacks */ + ot->exec= mesh_vertices_sort_exec; + + ot->poll= EM_view3d_poll; /* uses view relative X axis to sort verts */ + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* called from buttons */ static void hashvert_flag(EditMesh *em, int flag) { @@ -621,6 +644,31 @@ static void hashvert_flag(EditMesh *em, int flag) } +static int mesh_vertices_randomize_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); + hashvert_flag(em, SELECT); + return OPERATOR_FINISHED; +} + +void MESH_OT_vertices_randomize(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Vertex Randomize"; + ot->description= "Randomize vertex order"; + ot->idname= "MESH_OT_vertices_randomize"; + + /* api callbacks */ + ot->exec= mesh_vertices_randomize_exec; + + ot->poll= ED_operator_editmesh; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* generic extern called extruder */ static void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op, short type) { |