fix [#27140] Negative Subdiv level in the operator panel.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Apr 2011 06:44:43 +0000 (06:44 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Apr 2011 06:44:43 +0000 (06:44 +0000)
when relative option is disabled, don't allow setting the subdiv value to a negative number.

release/scripts/startup/bl_operators/object.py
source/blender/blenkernel/intern/mesh_validate.c

index d19de50ea6a4e4e2afaa74fc299d4ae2c7139e10..0342a14a1b23c7e1fe4491222b0b010347b24004 100644 (file)
@@ -177,6 +177,9 @@ class SubdivisionSet(bpy.types.Operator):
         if relative and level == 0:
             return {'CANCELLED'}  # nothing to do
 
+        if not relative and level < 0:
+            self.level = level = 0
+
         def set_object_subd(obj):
             for mod in obj.modifiers:
                 if mod.type == 'MULTIRES':
index 7c38688c82e2bb83855605244deca9918f5833b9..34618a19ae9e521fc687c8dcc8200874623f9313 100644 (file)
@@ -307,7 +307,9 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
 
 int BKE_mesh_validate(Mesh *me, int do_verbose)
 {
-       printf("MESH: %s\n", me->id.name+2);
+       if(do_verbose) {
+               printf("MESH: %s\n", me->id.name+2);
+       }
        return BKE_mesh_validate_arrays(me, me->mvert, me->totvert, me->medge, me->totedge, me->mface, me->totface, do_verbose, TRUE);
 }