diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/extensions_framework/__init__.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/extensions_framework/__init__.py b/modules/extensions_framework/__init__.py index 0aabc15d..8e7ee390 100644 --- a/modules/extensions_framework/__init__.py +++ b/modules/extensions_framework/__init__.py @@ -116,16 +116,13 @@ def init_properties(obj, props, cache=True): continue def ef_initialise_properties(cls): - """This is mostly copied from plugin.plugin.install - This is a class decorator that should be used on + """This is a class decorator that should be used on sub-classes of declarative_property_group in order to ensure that they are initialised when the addon is loaded. """ - bpy.utils.register_class(cls) - for property_group_parent in cls.ef_attach_to: if property_group_parent is not None: prototype = getattr(bpy.types, property_group_parent) @@ -142,6 +139,17 @@ def ef_initialise_properties(cls): return cls +def ef_register_initialise_properties(cls): + """As ef_initialise_properties, but also registers the + class with RNA. Note that this isn't a great idea + because it's non-trivial to unregister the class, unless + you keep track of it yourself. + """ + + bpy.utils.register_class(cls) + ef_initialise_properties(cls) + return cls + class declarative_property_group(bpy.types.IDPropertyGroup): """A declarative_property_group describes a set of logically related properties, using a declarative style to list each |