diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-23 15:13:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-23 15:13:48 +0300 |
commit | bb094b8655bac5dcee1b9728891d1e49bb18557e (patch) | |
tree | d1b10efdfc0b434a8fe6cfece5d671f9059b929d /release/scripts/op | |
parent | 489ff11f2bcf327084e8241f14b376ae50cbb583 (diff) |
key shortcits for sculpt back
- T was 'Flatten Brush', now Shift+T
- added an option to OBJECT_OT_subdivision_set to set the level relatively (so page up/down works), however RNA lets it set one level higher then the maximum, this seems displays OK in the 3D view so not sure whats going on here (as if there is always an extra hidden multires level).
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/object.py | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index 2ecd7b31b34..228d8566f77 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -84,7 +84,9 @@ class SubdivisionSet(bpy.types.Operator): bl_undo = True level = IntProperty(name="Level", - default=1, min=0, max=100, soft_min=0, soft_max=6) + default=1, min=-100, max=100, soft_min=-6, soft_max=6) + + relative = BoolProperty(name="Relative", description="Apply the subsurf level as an offset relative to the current level", default=False) def poll(self, context): obs = context.selected_editable_objects @@ -92,19 +94,35 @@ class SubdivisionSet(bpy.types.Operator): def execute(self, context): level = self.properties.level + relative = self.properties.relative + + if relative and level == 0: + return ('CANCELLED',) # nothing to do def set_object_subd(obj): for mod in obj.modifiers: if mod.type == 'MULTIRES': - if level < mod.total_levels: - if obj.mode == 'SCULPT' and mod.sculpt_levels != level: - mod.sculpt_levels = level - elif obj.mode == 'OBJECT' and mod.levels != level: - mod.levels = level + if level <= mod.total_levels: + if obj.mode == 'SCULPT': + if relative: + mod.sculpt_levels += level + else: + if mod.sculpt_levels != level: + mod.sculpt_levels = level + elif obj.mode == 'OBJECT': + if relative: + mod.levels += level + else: + if mod.levels != level: + mod.levels = level return elif mod.type == 'SUBSURF': - if mod.levels != level: - mod.levels = level + if relative: + mod.levels += level + else: + if mod.levels != level: + mod.levels = level + return # adda new modifier |