Example #1
0
    def invoke(self, context, event):

        if context.selected_objects:
            self.current = None
            self.mouse_drag = False  #this might be a good property for the PieMenu isntead of the Operator?  Brainstorm on that.
            current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps[
                'Object Non-modal'].keymap_items['view3d.mode_menu'].type
            # generate menu content
            self.menu = menu_init(
                PieMenu(
                    context,
                    x=event.mouse_region_x,
                    y=event.mouse_region_y,
                    keybind=
                    current_keybind,  #TODO:  Should this come from some other place, not in the file...how would the user change it.
                    layout_radius=80,
                    text_size=11,
                    text_dpi=72,
                    center_radius_squared=225,
                    max_radius_squared=62500  #22500
                ))

            context.window_manager.modal_handler_add(self)
            pmu.callback_register(self, context)
            return {'RUNNING_MODAL'}
        else:
            return {'CANCELLED'}
Example #2
0
    def invoke(self, context, event):
        self.current = None
        if bpy.context.mode == 'EDIT_MESH':
            current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps[
                'Mesh'].keymap_items['view3d.proportional_menu'].type
        else:
            current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps[
                'Object Mode'].keymap_items['view3d.proportional_menu'].type
        # generate menu content
        self.menu = menu_init(
            PieMenu(
                context,
                x=event.mouse_region_x,
                y=event.mouse_region_y,
                keybind=current_keybind,
                layout_radius=80,
                text_size=11,
                text_dpi=72,
                center_radius_squared=225,
                max_radius_squared=62500  #22500
            ))

        context.window_manager.modal_handler_add(self)
        pmu.callback_register(self, context)
        return {'RUNNING_MODAL'}
Example #3
0
    def invoke(self, context, event):
        self.current = None
        current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['Sculpt'].keymap_items['view3d.strokes_menu'].type
        # generate menu content
        self.menu = menu_init(PieMenu(context, x=event.mouse_region_x,
                                      y=event.mouse_region_y,
                                      keybind = current_keybind,
                                      layout_radius=80,
                                      text_size=11,
                                      text_dpi=72,
                                      center_radius_squared=225,
                                      max_radius_squared=62500#22500
                                      ))
 
        context.window_manager.modal_handler_add(self)
        pmu.callback_register(self,context)
        return {'RUNNING_MODAL'}
Example #4
0
    def invoke(self, context, event):
        self.current = None
        current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['Sculpt'].keymap_items['view3d.brush_control'].type
        # generate menu content
        self.menu = menu_init(PieMenu(context, x=event.mouse_region_x,
                                      y=event.mouse_region_y,
                                      keybind = default_keybind,
                                      layout_radius=50,
                                      text_size=11,
                                      text_dpi=72,
                                      center_radius_squared=225,
                                      max_radius_squared=62500#22500
                                      ))
 
        context.window_manager.modal_handler_add(self)
        pmu.callback_register(self,context)
        return {'RUNNING_MODAL'}
Example #5
0
    def invoke(self, context, event):
        self.current = None

        # generate menu content
        current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['3D View'].keymap_items['view3d.view_menu'].type
        self.menu = menu_init(PieMenu(x=event.mouse_region_x,
                                      y=event.mouse_region_y,
                                      keybind = current_keybind,
                                      layout_radius=80,
                                      text_size=11,
                                      text_dpi=72,
                                      center_radius_squared=225,
                                      max_radius_squared=62500#22500
                                      ))
 
        context.window_manager.modal_handler_add(self)
        #self.menu.layout(2*math.pi)  commented out to preserve hand set layouts
        pmu.callback_register(self,context)
        return {'RUNNING_MODAL'}
    def invoke(self, context, event):
        self.current = None
        if bpy.context.mode == 'EDIT_MESH':
            current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['Mesh'].keymap_items['view3d.proportional_menu'].type
        else:
            current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['Object Mode'].keymap_items['view3d.proportional_menu'].type
        # generate menu content
        self.menu = menu_init(PieMenu(x=event.mouse_region_x,
                                      y=event.mouse_region_y,
                                      keybind=current_keybind,
                                      layout_radius=80,
                                      text_size=11,
                                      text_dpi=72,
                                      center_radius_squared=225,
                                      max_radius_squared=62500#22500
                                      ))
 
        context.window_manager.modal_handler_add(self)
        pmu.callback_register(self,context)
        return {'RUNNING_MODAL'}
Example #7
0
 def invoke(self, context, event):
     
     if context.selected_objects:
         self.current = None
         self.mouse_drag = False  #this might be a good property for the PieMenu isntead of the Operator?  Brainstorm on that.
         current_keybind = bpy.context.window_manager.keyconfigs.user.keymaps['Object Non-modal'].keymap_items['view3d.mode_menu'].type
         # generate menu content
         self.menu = menu_init(PieMenu(context, x=event.mouse_region_x,
                                       y=event.mouse_region_y,
                                       keybind = current_keybind, #TODO:  Should this come from some other place, not in the file...how would the user change it.
                                       layout_radius=80,
                                       text_size=11,
                                       text_dpi=72,
                                       center_radius_squared=225,
                                       max_radius_squared=62500#22500
                                       ))
  
         context.window_manager.modal_handler_add(self)
         pmu.callback_register(self,context)
         return {'RUNNING_MODAL'}
     else:
         return{'CANCELLED'}