~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to doc/python_api/examples/bpy.types.Operator.5.py

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        elif event.type == 'LEFTMOUSE':  # Confirm
41
41
            return {'FINISHED'}
42
42
        elif event.type in ('RIGHTMOUSE', 'ESC'):  # Cancel
 
43
            context.object.location.x = self.init_loc_x
43
44
            return {'CANCELLED'}
44
45
 
45
46
        return {'RUNNING_MODAL'}
46
47
 
47
48
    def invoke(self, context, event):
 
49
        self.init_loc_x = context.object.location.x
48
50
        self.value = event.mouse_x
49
51
        self.execute(context)
50
52
 
51
 
        print(context.window_manager.modal_handler_add(self))
 
53
        context.window_manager.modal_handler_add(self)
52
54
        return {'RUNNING_MODAL'}
53
55
 
54
56