I'm using a script to enter edit mode and select a component selection based on a hotkey press.
it works fine when I paste the code in the text editor and run it from there, but on restart the addon looks loaded in the addon section yet the command doesn't seem to be available and the hotkeys don't work.
I've also tried pasting the file in the startup directory with no luck.
how can I make this available everytime I run blender without manually running the code?
bl_info = {
"name": "Edit mode with face select", "author": "G",
# "version": (1, 0), "blender": (2, 75, 0),
"location": "blender", "category": "Object",
"description": "Enter edit mode and set selection type .",
}
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=False)
bpy.ops.mesh.select_mode(type='FACE')
return {'FINISHED'}
class EditSelectOperator2(bpy.types.Operator):
bl_idname = 'object.edit_vert_select'
bl_label = 'Enter edit mode and set vertex 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=False)
bpy.ops.mesh.select_mode(type='VERT')
return {'FINISHED'}
class EditSelectOperator3(bpy.types.Operator):
bl_idname = 'object.edit_edge_select'
bl_label = 'Enter edit mode and set edge 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=False)
bpy.ops.mesh.select_mode(type='EDGE')
return {'FINISHED'}
def register():
bpy.utils.register_class(EditSelectOperator)
bpy.utils.register_class(EditSelectOperator2)
bpy.utils.register_class(EditSelectOperator3)
def unregister():
bpy.utils.unregister_class(EditSelectOperator)
bpy.utils.unregister_class(EditSelectOperator2)
bpy.utils.unregister_class(EditSelectOperator3)
if __name__ == "__main__":
register()
also on a side note is there a better way to achieve entering edit mode and component selection at the same time?