Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hammond <doughammond@hamsterfight.co.uk>2011-02-22 19:37:16 +0300
committerDoug Hammond <doughammond@hamsterfight.co.uk>2011-02-22 19:37:16 +0300
commit9c518302674ae1bef65bbc933a43af480046817e (patch)
tree22eefbb92bc883603b51658f0374a6d69716da39 /modules
parent70eada0ece98454bf9a0913973c68428ecbc127d (diff)
extensions_framework: added reset() method to declarative_property_group
Diffstat (limited to 'modules')
-rw-r--r--modules/extensions_framework/__init__.py8
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"""