Skip to content
Snippets Groups Projects
Commit 9c518302 authored by Doug Hammond's avatar Doug Hammond
Browse files

extensions_framework: added reset() method to declarative_property_group

parent 70eada0e
No related branches found
No related tags found
No related merge requests found
......@@ -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"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment