[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22257] branches/blender2.5/blender/source /blender/editors/mesh/editmesh_mods.c: added a 'repeat' option to vertex smooth in the main 2.5 branch.
Joseph Eagar
joeedh at gmail.com
Thu Aug 6 14:34:49 CEST 2009
Revision: 22257
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22257
Author: joeedh
Date: 2009-08-06 14:34:48 +0200 (Thu, 06 Aug 2009)
Log Message:
-----------
added a 'repeat' option to vertex smooth in the main 2.5 branch.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
Modified: branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c 2009-08-06 12:22:50 UTC (rev 22256)
+++ branches/blender2.5/blender/source/blender/editors/mesh/editmesh_mods.c 2009-08-06 12:34:48 UTC (rev 22257)
@@ -4299,6 +4299,18 @@
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 @@
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)
More information about the Bf-blender-cvs
mailing list