2.5: warning fixes
[blender.git] / source / blender / editors / mesh / editmesh_mods.c
index 8691070654067b96693208203aefb066e5957ddf..44f63427e5f250f37f6a9eab02d9f0ad2ab91df2 100644 (file)
@@ -4299,6 +4299,20 @@ 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);
+       }
+
+       return OPERATOR_FINISHED;
+}
+
 void MESH_OT_vertices_smooth(wmOperatorType *ot)
 {
        /* identifiers */
@@ -4306,11 +4320,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)