diff options
author | Doug Hammond <doughammond@hamsterfight.co.uk> | 2011-02-11 19:35:26 +0300 |
---|---|---|
committer | Doug Hammond <doughammond@hamsterfight.co.uk> | 2011-02-11 19:35:26 +0300 |
commit | b43dfa999136efa28a7781c724c19c41a3b2d047 (patch) | |
tree | 5e3d74850304e59a343246b592b3d536a45fa740 /modules | |
parent | ef6af8b33a16211346acf7596922e229444c2fe8 (diff) |
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.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/extensions_framework/__init__.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/extensions_framework/__init__.py b/modules/extensions_framework/__init__.py index 4581046b..7fcc98d9 100644 --- a/modules/extensions_framework/__init__.py +++ b/modules/extensions_framework/__init__.py @@ -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: |