diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-12-19 04:14:57 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-12-19 04:14:57 +0300 |
commit | 43af26fa413acbc5514106b71e0fb3c145c9b165 (patch) | |
tree | 62259ec794a6201e86f535cb3793aa4fb7e508f9 /release | |
parent | 555427765de0921451477e004600aa816b2078ea (diff) |
Bugfix [#25291] Objects that should not have subsurface modifier have
it (eg cameras)
When trying to add a modifier to non-geometry objects, warnings are
now shown instead of just adding some (useless) modifiers that cannot
be removed later.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/object.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/op/object.py b/release/scripts/op/object.py index cb6db059e9f..ffd40b9a9bd 100644 --- a/release/scripts/op/object.py +++ b/release/scripts/op/object.py @@ -207,9 +207,12 @@ class SubdivisionSet(bpy.types.Operator): return - # adda new modifier - mod = obj.modifiers.new("Subsurf", 'SUBSURF') - mod.levels = level + # add a new modifier + try: + mod = obj.modifiers.new("Subsurf", 'SUBSURF') + mod.levels = level + except: + self.report({'WARNING'}, "Modifiers cannot be added to object: " + obj.name) for obj in context.selected_editable_objects: set_object_subd(obj) |