diff options
author | Fabian Fricke <frigi.f@googlemail.com> | 2010-07-31 03:07:26 +0400 |
---|---|---|
committer | Fabian Fricke <frigi.f@googlemail.com> | 2010-07-31 03:07:26 +0400 |
commit | 4d512d3124a5db1d6ccb7ea2cbfdb6dcbd8d50da (patch) | |
tree | 5b340d23ab9af12e1946b0693516d6a6d9ed5abe | |
parent | 50579a2cf8f4bdfbe625f1e617c2bedf891ddaf8 (diff) |
Fixed the freezing and drawing issues for now, runs fine again.
-rw-r--r-- | space_view3d_panel_measure.py | 22 |
1 files changed, 12 insertions, 10 deletions
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) |