Fix [#20514] In sculpting mode is possible to use page down/up to exceed the actual...
authorMatt Ebb <matt@mke3.net>
Fri, 15 Jan 2010 05:00:02 +0000 (05:00 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 15 Jan 2010 05:00:02 +0000 (05:00 +0000)
release/scripts/op/object.py

index 1cf46d514c7f3482fb91233d72507cc5ce5648e8..8c9108f9baa39ae76e55c7f62b97b158ea43bab7 100644 (file)
@@ -102,20 +102,24 @@ class SubdivisionSet(bpy.types.Operator):
         def set_object_subd(obj):
             for mod in obj.modifiers:
                 if mod.type == 'MULTIRES':
-                    if level <= mod.total_levels:
-                        if obj.mode == 'SCULPT':
-                            if relative:
-                                mod.sculpt_levels += level
-                            else:
+                    if not relative:
+                        if level <= mod.total_levels:
+                            if obj.mode == 'SCULPT':
                                 if mod.sculpt_levels != level:
                                     mod.sculpt_levels = level
+                            elif obj.mode == 'OBJECT':
+                                if mod.levels != level:
+                                    mod.levels = level                          
+                        return
+                    else:
+                        if obj.mode == 'SCULPT':
+                            if mod.sculpt_levels+level <= mod.total_levels:
+                                mod.sculpt_levels += level
                         elif obj.mode == 'OBJECT':
-                            if relative:
+                            if mod.levels+level <= mod.total_levels:
                                 mod.levels += level
-                            else:
-                                if mod.levels != level:
-                                    mod.levels = level
-                    return
+                        return
+                
                 elif mod.type == 'SUBSURF':
                     if relative:
                         mod.levels += level