[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27168] trunk/blender/release/scripts: store vars in py operators in the instance rather then the operator classes .

Campbell Barton ideasman42 at gmail.com
Sat Feb 27 15:54:45 CET 2010


Revision: 27168
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27168
Author:   campbellbarton
Date:     2010-02-27 15:54:45 +0100 (Sat, 27 Feb 2010)

Log Message:
-----------
store vars in py operators in the instance rather then the operator classes.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/rna_prop_ui.py
    trunk/blender/release/scripts/op/wm.py

Modified: trunk/blender/release/scripts/modules/rna_prop_ui.py
===================================================================
--- trunk/blender/release/scripts/modules/rna_prop_ui.py	2010-02-27 14:44:46 UTC (rev 27167)
+++ trunk/blender/release/scripts/modules/rna_prop_ui.py	2010-02-27 14:54:45 UTC (rev 27168)
@@ -164,10 +164,6 @@
     max = rna_max
     description = StringProperty(name="Tip", default="")
 
-    # the class instance is not persistant, need to store in the class
-    # not ideal but changes as the op runs.
-    _last_prop = ['']
-
     def execute(self, context):
         path = self.properties.path
         value = self.properties.value
@@ -209,7 +205,7 @@
 
     def invoke(self, context, event):
 
-        self._last_prop[:] = [self.properties.property]
+        self._last_prop = [self.properties.property]
 
         item = eval("context.%s" % self.properties.path)
 

Modified: trunk/blender/release/scripts/op/wm.py
===================================================================
--- trunk/blender/release/scripts/op/wm.py	2010-02-27 14:44:46 UTC (rev 27167)
+++ trunk/blender/release/scripts/op/wm.py	2010-02-27 14:54:45 UTC (rev 27168)
@@ -308,14 +308,11 @@
     invert = BoolProperty(default=False, description="Invert the mouse input")
     initial_x = IntProperty(options={'HIDDEN'})
 
-    _values = {}
-
     def _values_store(self, context):
         path_iter = self.properties.path_iter
         path_item = self.properties.path_item
 
-        self._values.clear()
-        values = self._values
+        self._values = values = {}
 
         for item in getattr(context, path_iter):
             try:





More information about the Bf-blender-cvs mailing list