diff options
author | Doug Hammond <doughammond@hamsterfight.co.uk> | 2011-02-22 19:37:16 +0300 |
---|---|---|
committer | Doug Hammond <doughammond@hamsterfight.co.uk> | 2011-02-22 19:37:16 +0300 |
commit | 9c518302674ae1bef65bbc933a43af480046817e (patch) | |
tree | 22eefbb92bc883603b51658f0374a6d69716da39 /modules/extensions_framework | |
parent | 70eada0ece98454bf9a0913973c68428ecbc127d (diff) |
extensions_framework: added reset() method to declarative_property_group
Diffstat (limited to 'modules/extensions_framework')
-rw-r--r-- | modules/extensions_framework/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/extensions_framework/__init__.py b/modules/extensions_framework/__init__.py index e61b645c..4a4763f6 100644 --- a/modules/extensions_framework/__init__.py +++ b/modules/extensions_framework/__init__.py @@ -270,6 +270,14 @@ class declarative_property_group(bpy.types.PropertyGroup): if 'save_in_preset' in prop.keys() and prop['save_in_preset']: out.append(prop) return out + + def reset(self): + """Reset all properties in this group to the default value, + if specified""" + for prop in self.properties: + pk = prop.keys() + if 'attr' in pk and 'default' in pk and hasattr(self, prop['attr']): + setattr(self, prop['attr'], prop['default']) class Addon(object): """A list of classes registered by this addon""" |