Merging r50625 through r51896 from trunk into soc-2011-tomato

Merging just in case we'll want to develop some experimental stuff
This commit is contained in:
Sergey Sharybin
2012-11-05 19:42:27 +00:00
parent 0bf6007e3b
commit 18326d852b
2477 changed files with 80826 additions and 56797 deletions

View File

@@ -26,8 +26,8 @@ class CustomDrawOperator(bpy.types.Operator):
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.fileselect_add(self)
return {'RUNNING_MODAL'}
wm = context.window_manager
return wm.invoke_props_dialog(self)
def draw(self, context):
layout = self.layout

View File

@@ -40,15 +40,17 @@ class ModalOperator(bpy.types.Operator):
elif event.type == 'LEFTMOUSE': # Confirm
return {'FINISHED'}
elif event.type in ('RIGHTMOUSE', 'ESC'): # Cancel
context.object.location.x = self.init_loc_x
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def invoke(self, context, event):
self.init_loc_x = context.object.location.x
self.value = event.mouse_x
self.execute(context)
print(context.window_manager.modal_handler_add(self))
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}