Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 24c4e887ecc..d1ff06ec213 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)
{
@@ -5243,7 +5291,7 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot)
prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending.");
RNA_def_enum_funcs(prop, shape_itemf);
RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f);
- RNA_def_boolean(ot->srna, "add", 1, "Add", "Add rather then blend between shapes.");
+ RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather then blend between shapes.");
}
/************************ Merge Operator *************************/