I want to be able to cycle through the frames I set markers on (I have cameras bound to each marker so these are usually the first frame in a shot). Is there a hot-key for this?
3 Answers
Jumping between markers has now been included in trunk as of r60881 with CtrlShift+←/→ (left/right arrows)
-
4$\begingroup$ Note that this was reverted, and is no longer in master. developer.blender.org/… $\endgroup$– gandalf3 ♦Sep 21, 2014 at 0:18
-
1$\begingroup$ This is not there in blender 2.7 and 2.8 b. probably removed $\endgroup$– ashwinSep 21, 2016 at 17:14
-
1
While @gandalf3's solution worked, I found it a little awkward to set up (user preferences that rely on scripts that need to be in your project, if I understood correctly), and I found that there's now a built-in shortcut adding feature on the menu:
- In the timeline viewport menu, click Marker
- Right-click on "Jump to Previous Marker"
- Click on "Add Shortcut"
- Hover over the pop-up "A" box, so that it turns into "Press a Key"
- Hit your target combination, eg "Alt-Left"
- (repeat for "Jump to Next")
I might be missing something the scripts in @gandalf3's answer provide, please let me know if so!
-
3
-
2$\begingroup$ Great! However, I managed to left-click (mouse) while in the "Press a Key" dialog. Now the shortcut is set to left mouse button and I can't set it again... $\endgroup$– birgerspMar 27, 2017 at 8:49
AFAIK, there is currently no shortcut in 2.68 to do this. (there was in 2.4x) However, you can create your own operator to do this using blenders python API:
I am not very experienced in python, but I came up with two scripts for jumping to the next and previous markers: (pardon my bad python)
Jump_to_next.py:
import bpy
#jump to next marker
class MoveOperator(bpy.types.Operator):
bl_idname = "marker.jump_to_next"
bl_label = "Jump to next marker"
def execute(self, context):
frm=0
frm_close=0
frm_first = bpy.context.scene.frame_end
def switchcam():
if markname:
if camname != markname:
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for space in area.spaces:
if space.type == 'VIEW_3D':
if space.region_3d.view_perspective == 'CAMERA':
override = {'window': bpy.context.window, 'screen': bpy.context.screen, 'area': area, 'scene': bpy.context.scene, 'region': bpy.context.region, 'space': space}
bpy.ops.view3d.viewnumpad(override, type='CAMERA')
bpy.ops.view3d.viewnumpad(override, type='CAMERA')
else:
print ("not in camera view")
else:
print ("space is not a 3D view")
else:
print ("area is not a VIEW_3D")
else:
print ("camera bound to next marker is already active")
else:
print ("marker is not bound to a camera")
# get some vars:
now = bpy.context.scene.frame_current
cam = bpy.context.scene.camera
if cam:
camname = cam.name
frm_close = bpy.context.scene.frame_end
# Loop through markers and test how close to the current frame they are:
for TimelineMarker in bpy.context.scene.timeline_markers:
frm = TimelineMarker.frame
if frm > now:
if frm < frm_close:
frm_close = frm
markname = TimelineMarker.camera
if markname:
markname = TimelineMarker.camera.name
if frm < frm_first:
frm_first = frm
#Test if there is a marker that met requirements:
if frm_close != bpy.context.scene.frame_end:
#set scene frame to the frame of closest marker:
bpy.context.scene.frame_set(frm_close)
switchcam()
else:
if frm_first != bpy.context.scene.frame_end:
self.report({'INFO'}, 'No more markers to jump to in this direction, skipping to first')
bpy.context.scene.frame_set(frm_first)
else:
self.report({'WARNING'}, 'No markers found')
return {'FINISHED'}
bpy.utils.register_class(MoveOperator)
Jump_to_prev.py:
import bpy
#jump to previous marker
class MoveOperator(bpy.types.Operator):
bl_idname = "marker.jump_to_prev"
bl_label = "Jump to previous marker"
def execute(self, context):
frm=0
frm_close=0
frm_first=0
def switchcam():
if markname:
if camname != markname:
for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
for space in area.spaces:
if space.type == 'VIEW_3D':
if space.region_3d.view_perspective == 'CAMERA':
override = {'window': bpy.context.window, 'screen': bpy.context.screen, 'area': area, 'scene': bpy.context.scene, 'region': bpy.context.region, 'space': space}
bpy.ops.view3d.viewnumpad(override, type='CAMERA')
bpy.ops.view3d.viewnumpad(override, type='CAMERA')
else:
print ("not in camera view")
else:
print ("space is not a 3D view")
else:
print ("area is not a VIEW_3D")
else:
print ("camera bound to next marker is already active")
else:
print ("marker is not bound to a camera")
# get some vars:
now = bpy.context.scene.frame_current
cam = bpy.context.scene.camera
if cam:
camname = cam.name
# Loop through markers and test how close to the current frame they are:
for TimelineMarker in bpy.context.scene.timeline_markers:
frm = TimelineMarker.frame
if frm < now:
if frm > frm_close:
frm_close = frm
markname = TimelineMarker.camera
if markname:
markname = TimelineMarker.camera.name
if frm > frm_first:
frm_first = frm
#Test if there is a marker that met requirements:
if frm_close != 0:
#set scene frame to the frame of closest marker:
bpy.context.scene.frame_set(frm_close)
switchcam()
else:
if frm_first != 0:
self.report({'INFO'}, 'No more markers to jump to in this direction, skipping to last')
bpy.context.scene.frame_set(frm_first)
else:
self.report({'WARNING'}, 'No markers found')
return {'FINISHED'}
bpy.utils.register_class(MoveOperator)
You can make these into shortcuts by
Paste into the text editor and check the Register option in the header:
In User Preferences (CtrlAltU)> Input, scroll down to the context you want to use the shortcut in (e.g. Timeline), expand it and click Add new.
Type in the operator name (
marker.jump_to_next
ormarker.jump_to_prev
) and set the shortcut to whatever you want (e.g. Page Up):Save the default .blend. (CtrlU) This is necessary to save the python script so the operator
marker.jump_to_next
exists. Be careful when saving the default .blend, this will save information such as geometry, screen layout, User preferences, etc.
Note that you will have to do steps 1-3 twice, once for each operator. (jump_to_next
and jump_to_prev
)
-
$\begingroup$ Awesome. This works great. Only thing I did differently was I set the hot-key up under the Screen (Global) section so it works everywhere. Now just need to get this into Blender trunk! $\endgroup$ Oct 13, 2013 at 2:45
-
$\begingroup$ One more request actually. Normally when you switch markers and you're in camera view, it also switches to the active camera for that marker, but this script doesn't seem to be doing that. $\endgroup$ Oct 13, 2013 at 3:09
-
$\begingroup$ @Consideringthepickle Does it switch now? $\endgroup$– gandalf3 ♦Oct 14, 2013 at 3:09
-
2$\begingroup$ I created a little addon for someone on IRC a while ago doing exactly this. It is also bad code: dropbox.com/s/jvzlcnobfw6hebc/marker_jumping.py Hotkeys: ',' and '.' for Previous and Next marker. $\endgroup$ Oct 15, 2013 at 13:07
-
1$\begingroup$ @Consideringthepickle I fixed that bug again, (hopefully for real) and made it loop back to the first/last marker. I also reported the camera draw bug on the tracker. There are still some issues when using multiple 3D views, I'll see if I can work some of those out.. $\endgroup$– gandalf3 ♦Oct 15, 2013 at 20:50
Pgup
andPgdown
) however, this doesn't work in 2.68. $\endgroup$