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:
authorJoseph Eagar <joeedh@gmail.com>2009-08-06 16:34:48 +0400
committerJoseph Eagar <joeedh@gmail.com>2009-08-06 16:34:48 +0400
commitc443f0161b6059fde88437d43458819da5c99073 (patch)
treedb15a3fccb07a9532409776eeef5d15ae520e5da /source/blender/editors/mesh
parent1e4fb484001994f4e164aab7b44c9578df59f67d (diff)
added a 'repeat' option to vertex smooth in the main 2.5 branch.
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_mods.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c
index 86910706540..72ca97921ef 100644
--- a/source/blender/editors/mesh/editmesh_mods.c
+++ b/source/blender/editors/mesh/editmesh_mods.c
@@ -4299,6 +4299,18 @@ static int smooth_vertex(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
+static int smooth_vertex_exec(bContext *C, wmOperator *op)
+{
+ int repeat = RNA_int_get(op->ptr, "repeat");
+ int i;
+
+ if (!repeat) repeat = 1;
+
+ for (i=0; i<repeat; i++) {
+ smooth_vertex(C, op);
+ }
+}
+
void MESH_OT_vertices_smooth(wmOperatorType *ot)
{
/* identifiers */
@@ -4306,11 +4318,13 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot)
ot->idname= "MESH_OT_vertices_smooth";
/* api callbacks */
- ot->exec= smooth_vertex;
+ ot->exec= smooth_vertex_exec;
ot->poll= ED_operator_editmesh;
/* flags */
- ot->flag= OPTYPE_UNDO;
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX);
}
void vertexnoise(Object *obedit, EditMesh *em)