Easiest way to assign 5 commands to 1 key for a n00b

Hi,
what is the shortest path to achieve this?
As I’m trying to meet deadlines, I’m only interesting just for this, to assign several commands to one hot key.
Is this possible to achieve in a matter of minutes?

So …no one knows how to do this ???

Well this is not to hard. Take a look how to create an operator. In the text editor you have some predefined templates.

Here is the simple operator template modified. This one moves and rotates the cube a bit:

import bpy



def main(context):
    for ob in context.scene.objects:
        print(ob)




class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"


    @classmethod
    def poll(cls, context):
        return context.active_object is not None


    def execute(self, context):
        bpy.ops.transform.translate(value=(3, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)
        bpy.ops.transform.rotate(value=-0.62, axis=(0.428336, 0.683207, -0.591402), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
        print("my Operator!")
        return {'FINISHED'}




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




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




if __name__ == "__main__":
    register()


    # test call
    bpy.ops.object.simple_operator()

Now go into your Preferences and take a look how keybindings are done. Now make a key binding to your operator “object.simple_operator”. Thats it.

Thanks, but I tried the above script on the Scripting layout and it didn’t work -too many errors.
A related working example (or existing script) would help a lot.

the question is what commands?!

import bpy



def main(context):
    bpy.ops.transform.rotate(value=0.785398, axis=(1, 0, 0), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), release_confirm=False)
    bpy.ops.transform.translate(value=(0, 0, 1.5), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)
    bpy.ops.transform.resize(value=(1.5, 1.5, 1.5), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1, snap=False, snap_target='CLOSEST', snap_point=(0, 0, 0), snap_align=False, snap_normal=(0, 0, 0), texture_space=False, release_confirm=False)




class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"


    @classmethod
    def poll(cls, context):
        return context.area.type == 'VIEW_3D'


    def execute(self, context):
        main(context)
        return {'FINISHED'}




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




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




if __name__ == "__main__":
    register()

That will call 3 ops, it should rather use low-level API but ok. This works from spacebar menu over 3d view or if your mouse is over that view and you use a hotkey (you can bind it in the user prefs > input)

Thanks CoDEmanX, I’ll get back to this at a later time as I’m too busy these days and this will take me some time to figure it out completely.