Skip to main content

Camera Keyframe (Data Type)

One point in an apoli:modify_camera animation: a time, the camera values at that time, and how to ease toward the next point.

Fields

FieldTypeDefaultDescription
timeFloatrequiredTicks after the power turned on. Fractions are allowed.
xFloatoptionalThe camera's x offset at this time.
yFloatoptionalThe camera's y offset at this time.
zFloatoptionalThe camera's z offset at this time.
pitchFloatoptionalThe camera's pitch at this time, in degrees.
yawFloatoptionalThe camera's yaw at this time, in degrees.
rollFloatoptionalThe camera's roll at this time, in degrees.
fovFloatoptionalThe camera's field of view multiplier at this time.
easingEasinglinearHow the values move from this keyframe to the next one.

Every field you leave out is left free. Each value has its own track, built only from the keyframes that set it, so one keyframe list can move the camera on four keyframes and roll it on two, and a value with no keyframes at all keeps the value set on the power.

Easing

easing shapes the stretch after the keyframe it is on, so the last keyframe's easing is never used.

  • Any curve from Easing, such as ease_in_out_sine, ease_out_back or ease_out_bounce.
  • step (also hold or constant) jumps straight to the next keyframe's value when its time comes.
  • catmullrom (also smooth) passes a curve through the neighbouring keyframes too, so a camera path bends smoothly through every point instead of turning sharply at each one. Use it on every keyframe of the path.

Angles aren't wrapped. A yaw that goes from 0 to 360 turns one full circle, and from 0 to 720 turns two.

Example

"keyframes": [
  { "time": 0, "z": -2, "roll": 0 },
  { "time": 20, "z": -8, "easing": "ease_out_cubic" },
  { "time": 40, "z": -8, "roll": 20, "easing": "step" }
]

The camera pulls back from two to eight blocks over the first second, slowing as it goes, then snaps to a 20° roll at two seconds.