Anim: Time jump operator
Adds a new operator that jumps time by a given number of frames or seconds, forward or backward. Surprisingly, it was lacking in Blender, and prompted many users (including me) to create extensions. This PR adds two properties: `time_jump_unit` for choosing whether to jump by frames or seconds and `time_jump_delta` property that defines by how many frames or seconds the operator should jump, as well as an actual operator that changes the current frame (`screen.time_jump`). `time_jump_delta` is a float that gives users the ability to jump by half a second, for example, or by subframes. Default is set to 1 second, which translates to as many frames jump as frame rate / frame base. The operator is intentionally not bound by frame range, and can go in negative frames as well. This is very important because it's extremely common to set frame range to the current workload, but wish to see animation beyond that. Operators are added in the new footer for animation editors alongside with pop-up menu where properties can be changed. Shortcuts are also added: Ctrl+Left/Right Arrow, which was surprisingly free in Blender. Now timeline controls are: - **Right Arrow**: Next Frame - **Ctrl + Right Arrow**: Jump Forward (by default also Next Second) - **Shift + Right Arrow**: Jump to End Pull Request: https://projects.blender.org/blender/blender/pulls/140677
This commit is contained in:
committed by
Nathan Vegdahl
parent
7c52aa1250
commit
f145e1f7e2
@@ -3705,6 +3705,10 @@ def km_frames(params):
|
||||
{"properties": [("end", True)]}),
|
||||
("screen.frame_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "shift": True, "repeat": True},
|
||||
{"properties": [("end", False)]}),
|
||||
("screen.time_jump", {"type": 'RIGHT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
|
||||
{"properties": [("backward", False)]}),
|
||||
("screen.time_jump", {"type": 'LEFT_ARROW', "value": 'PRESS', "ctrl": True, "repeat": True},
|
||||
{"properties": [("backward", True)]}),
|
||||
("screen.keyframe_jump", {"type": 'UP_ARROW', "value": 'PRESS', "repeat": True},
|
||||
{"properties": [("next", False)]}),
|
||||
("screen.keyframe_jump", {"type": 'DOWN_ARROW', "value": 'PRESS', "repeat": True},
|
||||
|
||||
@@ -97,6 +97,12 @@ def playback_controls(layout, context):
|
||||
row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True
|
||||
row.operator("screen.frame_jump", text="", icon='FF').end = True
|
||||
|
||||
# Time jump
|
||||
row = layout.row(align=True)
|
||||
row.operator("screen.time_jump", text="", icon='FRAME_PREV').backward = True
|
||||
row.operator("screen.time_jump", text="", icon='FRAME_NEXT').backward = False
|
||||
row.popover(panel="TIME_PT_jump", text="")
|
||||
|
||||
if tool_settings:
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "use_snap_playhead", text="")
|
||||
@@ -289,12 +295,30 @@ class TIME_PT_auto_keyframing(TimelinePanelButtons, Panel):
|
||||
col.prop(tool_settings, "use_record_with_nla", text="Layered Recording")
|
||||
|
||||
|
||||
class TIME_PT_jump(TimelinePanelButtons, Panel):
|
||||
bl_label = "Time Jump"
|
||||
bl_options = {'HIDE_HEADER'}
|
||||
bl_region_type = 'HEADER'
|
||||
bl_ui_units_x = 10
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
|
||||
scene = context.scene
|
||||
|
||||
layout.prop(scene, "time_jump_unit", expand=True, text="Jump Unit")
|
||||
layout.prop(scene, "time_jump_delta", text="Delta")
|
||||
|
||||
|
||||
###################################
|
||||
|
||||
classes = (
|
||||
TIME_PT_playback,
|
||||
TIME_PT_keyframing_settings,
|
||||
TIME_PT_auto_keyframing,
|
||||
TIME_PT_jump,
|
||||
TIME_PT_playhead_snapping,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user