0
$\begingroup$

I use this addon to jump straight to cycle select between vertex, edges and faces on 2.79, instead of selecting the object, tab, edit mode, selection filter and (vertex). But what do I need to change to upgrade it for 2.8? Please help. Thanks.

bl_info = {
'name': 'Direct Jump Selection',
'author': '-',
'version': (0, 0, 2),
'blender': (2, 80, 0),
'location': 'Blender'
'description': 'Enter edit mode and cycle selection type to face/vertex/edge',
'wiki_url': '',
'tracker_url': '',
'category': 'Object'}

import bpy

class EditSelectOperator(bpy.types.Operator):
    bl_idname = 'object.edit_face_select'
    bl_label = 'Enter edit mode and set face selection.'

    def execute(self, context):
        if context.object.mode != 'EDIT':
            # if we aren't in edit mode goto edit and set face select
            bpy.ops.object.mode_set(mode='EDIT', toggle=True)
            bpy.ops.mesh.select_mode(type='VERT')
            bpy.ops.mesh.select_all(action='DESELECT')
        else:
            # if we are editing cycle through selection modes
            sel_mode = context.tool_settings.mesh_select_mode
            if sel_mode[0]: # vertex
                bpy.ops.mesh.select_mode(type='EDGE')
            elif sel_mode[1]: # edge
                bpy.ops.mesh.select_mode(type='FACE')
            else: # face
                bpy.ops.mesh.select_mode(type='VERT')
        return {'FINISHED'}


def register():
    bpy.utils.register_class(EditSelectOperator)

def unregister():
    bpy.utils.unregister_class(EditSelectOperator)

if __name__ == "__main__":
    register()
$\endgroup$
  • 1
    $\begingroup$ Works for fine for me if I add the missing comma behind 'location': 'Blender'. Are you having a particular problem? The operator doesn't follow the naming convention, but that's all that I've noticed. BTW the industry compatible keymap has shortcuts for this on 1,2 and 3 keys. $\endgroup$ – Robert Gützkow Aug 7 '19 at 22:00
  • $\begingroup$ yeah, you still have to go to edit mode to get "1", "2", "3" working. Not an immediate jump. You mention it is working on your side? did you assigned a particular shortcut? I assigned it onto "4" but nothing is happening. $\endgroup$ – Pierre Schiller Aug 7 '19 at 22:08
  • $\begingroup$ Hi. Thanks. Yes, I do know. Too many keys. This is why I thought maybe this addon could solve immediate jump from object context. If you hover my profile pic on the answer you get insights to what I do ;) $\endgroup$ – Pierre Schiller Aug 7 '19 at 22:10
  • $\begingroup$ Alright, you'd have to press TAB and 1, 2 or 3. I was just mentioning it in case you didn't know. It works for me, 4 is already assigned to other shortcuts though. $\endgroup$ – Robert Gützkow Aug 7 '19 at 22:15
  • $\begingroup$ Assigning it to a shortcut that is unused, something like SHIFT+ALT+O, works fine. $\endgroup$ – Robert Gützkow Aug 7 '19 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.