replace self.properties.foo --> self.foo

This commit is contained in:
Campbell Barton
2010-09-09 18:03:57 +00:00
parent 7bd1f9a234
commit 111965478a
20 changed files with 131 additions and 139 deletions

View File

@@ -11,14 +11,14 @@ class ModalOperator(bpy.types.Operator):
def modal(self, context, event):
if event.type == 'MOUSEMOVE':
delta = self.properties.first_mouse_x - event.mouse_x
context.object.location.x = self.properties.first_value + delta * 0.01
delta = self.first_mouse_x - event.mouse_x
context.object.location.x = self.first_value + delta * 0.01
elif event.type == 'LEFTMOUSE':
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'):
context.object.location.x = self.properties.first_value
context.object.location.x = self.first_value
return {'CANCELLED'}
return {'RUNNING_MODAL'}
@@ -26,8 +26,8 @@ class ModalOperator(bpy.types.Operator):
def invoke(self, context, event):
if context.object:
context.window_manager.add_modal_handler(self)
self.properties.first_mouse_x = event.mouse_x
self.properties.first_value = context.object.location.x
self.first_mouse_x = event.mouse_x
self.first_value = context.object.location.x
return {'RUNNING_MODAL'}
else:
self.report({'WARNING'}, "No active object, could not finish")