From b43dfa999136efa28a7781c724c19c41a3b2d047 Mon Sep 17 00:00:00 2001 From: Doug Hammond <doughammond@hamsterfight.co.uk> Date: Fri, 11 Feb 2011 16:35:26 +0000 Subject: [PATCH] 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. --- modules/extensions_framework/__init__.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/extensions_framework/__init__.py b/modules/extensions_framework/__init__.py index 4581046b2..7fcc98d92 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: -- GitLab