[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [874] trunk/py/scripts/addons/ space_view3d_panel_measure.py: Fixed the freezing and drawing issues for now, runs fine again.

Fabian Fricke frigi.f at googlemail.com
Sat Jul 31 01:07:26 CEST 2010


Revision: 874
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=874
Author:   frigi
Date:     2010-07-31 01:07:26 +0200 (Sat, 31 Jul 2010)

Log Message:
-----------
Fixed the freezing and drawing issues for now, runs fine again.

Modified Paths:
--------------
    trunk/py/scripts/addons/space_view3d_panel_measure.py

Modified: trunk/py/scripts/addons/space_view3d_panel_measure.py
===================================================================
--- trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-07-30 18:37:36 UTC (rev 873)
+++ trunk/py/scripts/addons/space_view3d_panel_measure.py	2010-07-30 23:07:26 UTC (rev 874)
@@ -658,11 +658,19 @@
     def draw_header(self, context):
         layout = self.layout
         sce = context.scene
+        
+        # Force a redraw.
+        # This prevents the lines still be drawn after
+        # disabling the "measure_panel_draw" checkbox.
+        # @todo Better solution?
+        context.area.tag_redraw()
+        
+        # auto-execution on startup (adds the callback)
+        sce.BoolProperty(attr="measure_panel_init", default=1)  
+        if sce.measure_panel_init:
+            bpy.ops.view3d.display_measurements()
+            sce.measure_panel_init = 0
 
-        # Execute operator (this adds the callback)
-        # if it wasn't done yet.
-        bpy.ops.view3d.display_measurements()
-
         # Define property for the draw setting.
         sce.BoolProperty(
             attr="measure_panel_draw",
@@ -683,12 +691,6 @@
         layout = self.layout
         sce = context.scene
 
-        # Force a redraw.
-        # This prevents the lines still be drawn after
-        # disabling the "measure_panel_draw" checkbox.
-        # @todo Better solution?
-        context.area.tag_redraw()
-
         # Get a single selected object (or nothing).
         obj = getSingleObject(context)
 




More information about the Bf-extensions-cvs mailing list