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

extensions_framework: changed ef_initialise_properties function to not...

extensions_framework: changed ef_initialise_properties function to not register the class with RNA, added another function ef_register_initialise_properties that does both.
parent 0dad0490
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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