Skip to content
Snippets Groups Projects
Commit a4e3ed6e authored by Martin Buerbaum's avatar Martin Buerbaum
Browse files

* Version 0.7.4 - Fixed the add_modal_handler and callback_add code.

* Thanks to jesterKing for pointing that out :-)
parent bcd75f3b
Branches
Tags
No related merge requests found
...@@ -44,6 +44,8 @@ It's very helpful to use one or two "Empty" objects with ...@@ -44,6 +44,8 @@ It's very helpful to use one or two "Empty" objects with
"Snap during transform" enabled for fast measurement. "Snap during transform" enabled for fast measurement.
Version history: Version history:
v0.7.4 - Fixed the add_modal_handler and callback_add code.
Thanks to jesterKing for pointing that out :-)
v0.7.3.1 - Fixed bug that made all lines in Blender stippled :-) v0.7.3.1 - Fixed bug that made all lines in Blender stippled :-)
v0.7.3 - Added display of delta x/y/z value in 3d view. v0.7.3 - Added display of delta x/y/z value in 3d view.
* Inspired by warpi's patch here: * Inspired by warpi's patch here:
...@@ -155,8 +157,7 @@ bl_addon_info = { ...@@ -155,8 +157,7 @@ bl_addon_info = {
'blender': (2, 5, 3), 'blender': (2, 5, 3),
'location': 'View3D > Properties > Measure', 'location': 'View3D > Properties > Measure',
'description': 'Measure distances between objects', 'description': 'Measure distances between objects',
'warning': 'Need maintenance, it can make weird stuff in the UI!',\ 'warning': '', # Used for warning icon and text in addons panel.
# Used for warning icon and text in addons panel.
'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/' \ 'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/' \
'Scripts/3D_interaction/Panel_Measure', 'Scripts/3D_interaction/Panel_Measure',
'tracker_url': 'https://projects.blender.org/tracker/index.php?'\ 'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
...@@ -600,17 +601,17 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator): ...@@ -600,17 +601,17 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator):
# Add the region OpenGL drawing callback # Add the region OpenGL drawing callback
for WINregion in context.area.regions: for WINregion in context.area.regions:
if WINregion.type == 'WINDOW': if WINregion.type == 'WINDOW':
break context.manager.add_modal_handler(self)
self._handle = WINregion.callback_add(
draw_measurements_callback,
(self, context),
'POST_PIXEL')
context.manager.add_modal_handler(self) print("Measure panel display callback added")
self._handle = WINregion.callback_add(
draw_measurements_callback,
(self, context),
'POST_PIXEL')
print("Measure panel display callback added") return {'RUNNING_MODAL'}
return {'RUNNING_MODAL'} return {'CANCELLED'}
else: else:
self.report({'WARNING'}, "View3D not found, cannot run operator") self.report({'WARNING'}, "View3D not found, cannot run operator")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment