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

extensions_framework: don't use caching checks in init_properties when using...

extensions_framework: don't use caching checks in init_properties when using ef_initialise_properties - addons using this interface will now enable/disable/enable correctly in the same session.
parent ef6af8b3
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,10 @@ def ef_initialise_properties(cls):
sub-classes of declarative_property_group in order
to ensure that they are initialised when the addon
is loaded.
the init_properties is called without caching here,
as it is assumed that any addon calling this function
will also call ef_remove_properties when it is
unregistered.
"""
......@@ -134,9 +138,9 @@ def ef_initialise_properties(cls):
'ptype': cls,
'name': cls.__name__,
'description': cls.__name__
}])
}], cache=False)
init_properties(cls, cls.properties)
init_properties(cls, cls.properties, cache=False)
cls.ef_initialised = True
return cls
......@@ -161,10 +165,10 @@ def ef_remove_properties(cls):
"""
if cls.ef_initialised:
prototype = getattr(bpy.types, cls.__name__)
for prop in cls.properties:
if hasattr(cls, prop['attr']):
delattr(cls, prop['attr'])
added_property_cache[cls] = []
if hasattr(prototype, prop['attr']):
delattr(prototype, prop['attr'])
for property_group_parent in cls.ef_attach_to:
if property_group_parent is not None:
......
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