[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1583] trunk/py/scripts/addons/modules/ extensions_framework/__init__.py: 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.
Doug Hammond
doughammond at hamsterfight.co.uk
Fri Feb 11 17:35:27 CET 2011
Revision: 1583
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=1583
Author: dougal2
Date: 2011-02-11 16:35:26 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/py/scripts/addons/modules/extensions_framework/__init__.py
Modified: trunk/py/scripts/addons/modules/extensions_framework/__init__.py
===================================================================
--- trunk/py/scripts/addons/modules/extensions_framework/__init__.py 2011-02-11 15:00:28 UTC (rev 1582)
+++ trunk/py/scripts/addons/modules/extensions_framework/__init__.py 2011-02-11 16:35:26 UTC (rev 1583)
@@ -120,6 +120,10 @@
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 @@
'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 @@
"""
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:
More information about the Bf-extensions-cvs
mailing list