Sub topic 12
Retiming and copying animation
This chapter assumes you can insert keyframes, select them in the Dope Sheet, and tell channels from keyframes. It also assumes you know the Timeline's current-frame marker, which is the playhead. Here you will change when keyframes happen (retiming) and reuse keyframes you already made (copying).
What retiming changes
A keyframe stores a value at a frame. Retiming changes the frame and leaves the value alone. The motion's shape stays the same, but it happens earlier, later, faster or slower.
In the Dope Sheet, retiming means moving keyframe diamonds left or right. Moving a key never edits its value. You can retime one key, a few keys, a whole channel, or every channel at once.
Moving keyframes
Select the keyframes, then press G to grab them. Move the mouse and click to confirm, or press Esc or right-click to cancel. You can also type a number. G, 10, Enter moves the selection 10 frames later, and G, -5, Enter moves it 5 frames earlier.
You can also click and drag a selected key. Dragging is quick, but typing a number is exact.
Two details matter in practice:
- By default, transforms in the Dope Sheet snap to whole frames. Hold Ctrl during the move to toggle snapping for that move. Fractional keyframes are legal but make later editing harder. Use them only when you want sub-frame timing.
- Moving keys past the scene's frame end does not delete them. They are still stored, but they will not play. Check the frame range if a moved key seems to vanish from playback.
Retiming a section
To delay everything after a certain moment, put the playhead on that frame and select the keys after it. Use Select > After Current Frame (shortcut ]). Select > Before Current Frame (shortcut [) does the opposite. Then press G and move the selection.
This opens a gap in the animation. Keys before the playhead stay where they are, and everything after shifts later. To close a gap, grab the same selection and move it earlier.
Make sure the right channels are visible first. The Dope Sheet only edits keys in channels it displays. If Only Show Selected is on, keys on unselected objects are hidden and are not moved.
Scaling keyframes in time
Press S to scale the selected keys. In the Dope Sheet, scaling is horizontal and its pivot is the current frame. Keys farther from the playhead move more than keys close to it.
- Scale by
2to double the spacing, so the animation takes twice as long and plays at half speed. - Scale by
0.5to halve the spacing, so the animation plays at double speed. - A key sitting exactly on the playhead does not move.
For a whole animation that starts at frame 1, put the playhead on frame 1 before scaling. Otherwise the start shifts as well as the duration. Starting from frame 1, a move from frames 1–24 scaled by 2 becomes frames 1–47, because the key at frame 24 is 23 frames from the pivot and moves to 47.
With snapping on, scaled keys round to whole frames. Several keys that were close together can then land on the same frame, and you lose some timing detail. If that is a problem, scale with snapping off and fix the keys afterward.
Duplicating keyframes
Shift+D duplicates the selected keyframes and starts a grab at once. Move the copies to a new frame and click to confirm. The originals stay in place, and the copies are selected.
Duplicating is the quickest way to repeat a motion on the same channels. For example, if frames 1–12 contain one bounce, select those keys and duplicate them to frame 13 to get a second bounce. For a seamless loop, make sure the last key of the first cycle and the first key of the next cycle do not both land on the same frame with different values.
Copying and pasting between channels and objects
Use Ctrl+C to copy the selected keys, move the playhead, and press Ctrl+V to paste. The copies are placed relative to the playhead and appear on the matching channels of the selected objects.
Matching is by channel. Pasting location keys onto an object works if that object has location channels shown and selected. If channels do not match, Blender can fall back to the selected channels. If nothing is pasted, check which channels are selected.
Pasting offers options in the Adjust Last Operation panel. These are the ones you will use most:
| Option | Values | Effect |
|---|---|---|
| Frame Offset | Frame Start, Frame End, Frame Relative, No Offset | Where the pasted keys land. Frame Start puts the first copied key on the playhead. No Offset keeps the original frame numbers. |
| Value Offset | No Offset, Cursor Value, Current Frame Value, Right Key, Left Key | Shifts the pasted values so the motion starts from a new place. This is useful for continuing a movement from where an object now is. |
| Type of Merge | Mix, Overwrite All, Overwrite Frame Range, Overwrite Entire Range | How pasted keys combine with keys already in the target channels. |
Ctrl+Shift+V pastes flipped. It swaps left and right, for example in channels of mirrored bones named with .L and .R. That is useful for characters and not for most simple objects.
Reusing a whole action
Copying keys duplicates data. If you want two objects to share the same animation, assign the same action to both in the Action Editor. Edits to the action then show on both objects. The next chapters cover actions in detail. For now, remember the difference: copy-paste gives each object an independent copy, and a shared action keeps one set of keys.
Retiming with Python
The same operations are available in a script. Shifting a key means changing its frame and its two handle frames together. If you move only co, the handles stay behind and the curve bends unexpectedly. This uses the F-curve access found in Blender 2.8 through 4.x.
import bpy
obj = bpy.context.active_object
action = obj.animation_data.action
offset = 10 # frames to delay the animation
for fcurve in action.fcurves:
for keyframe in fcurve.keyframe_points:
keyframe.co.x += offset
keyframe.handle_left.x += offset
keyframe.handle_right.x += offset
fcurve.update()Run it once. Running it twice delays the animation by 20 frames.
Common problems
- Keys moved by a fraction. Snapping was off, or a scale produced non-integer frames. Select the keys and use snapping, or move them and re-check the frame numbers.
- Only some objects moved. Other objects were hidden in the Dope Sheet by Only Show Selected. Turn the filter off or select those objects.
- Scaling shifted the start. The playhead was not on the pivot frame. Undo, set the playhead, and scale again.
- Paste did nothing. No matching channel was selected or visible.
Exercise
An object has location keys at frames 1, 12 and 24. You want the whole motion to take 48 frames and still start at frame 1. Where do you put the playhead, and what scale factor do you type after pressing S? Where will the last key end up?
Show answer
Put the playhead on frame 1, select all the keys, press S and type 2. The scale pivot is the playhead, so frame 1 stays fixed. The key at frame 12 moves to frame 23 and the key at frame 24 moves to frame 47. The animation now takes 46 frames from first to last key. To reach frame 48 exactly you would scale by 47/23, about 2.04, but that gives fractional frames unless snapping rounds them.
Exercise
You duplicated a bounce from frames 1–12 to start at frame 13 using Ctrl+C and Ctrl+V with Mix merge, but some old keys between frames 13 and 24 are still there. What setting do you change?
Show answer
Undo the paste and paste again, then set Type of Merge to Overwrite Entire Range in the Adjust Last Operation panel. This replaces everything in the target channels over the pasted range, so the old keys are removed.