From 4d512d3124a5db1d6ccb7ea2cbfdb6dcbd8d50da Mon Sep 17 00:00:00 2001 From: Fabian Fricke Date: Fri, 30 Jul 2010 23:07:26 +0000 Subject: Fixed the freezing and drawing issues for now, runs fine again. --- space_view3d_panel_measure.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'space_view3d_panel_measure.py') diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py index 7b509499..f7588365 100644 --- a/space_view3d_panel_measure.py +++ b/space_view3d_panel_measure.py @@ -658,10 +658,18 @@ class VIEW3D_PT_measure(bpy.types.Panel): def draw_header(self, context): layout = self.layout sce = context.scene - - # Execute operator (this adds the callback) - # if it wasn't done yet. - bpy.ops.view3d.display_measurements() + + # 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 # Define property for the draw setting. sce.BoolProperty( @@ -683,12 +691,6 @@ class VIEW3D_PT_measure(bpy.types.Panel): 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) -- cgit v1.2.3