Assign a hotkey to a command to go to a specific frame?

Hello friends, if I’m in the wrong category please tell me and I’ll fix it as best I can.

In Max I could grab a snippet of code and make it a user macro. Then I could apply a keyboard shortcut to it.

In blender I am wondering how I would do this.

For instance, I want to assign a command to go to frame 12. In the info window I see;

bpy.context.scene.frame_current = 12

From there, I’m not getting much success. Anybody know how to do this? Much appreciated.

For such simple one liners you could do the following:

  • Open a new area in your workspace and change its edftor type to “python console”
  • Then copy and paste that line you have and press enter
  • To repeat it press cursor up on your keyboard and enter

pythonconsole

A macrorecorder is not there by default. You might check this one out:

But I never tried it myself.

Debuk, thanks very much for the helpful reply. Appreciate ya.

What I ended up doing was: I used the AlwaysOnTop addon, opened a new window, set it to timeline, sized it way down as small as possible, then zoomed in to the timeline so far that I just have to click in it and I’m at frame 12. That way I don’t have to move my eyes around the window and only need one click. Down and dirty, but it works.