Skip to contents

Set how the camera path plays: interpolation, easing, speed of automatic transitions, loop and autoplay.

Usage

cellucid_camera_path_playback_set(
  viewer,
  autoplay,
  easing,
  loop,
  position_interpolation,
  rotation_interpolation,
  speed
)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

autoplay

Start playing as soon as the path has two keyframes. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

easing

How each transition speeds up and slows down. One of "linear", "ease-in-out", "ease-in", "ease-out". Left out unless given (the viewer then chooses as its own control does).

loop

Play the path again from its start when it ends. TRUE or FALSE. Left out unless given (the viewer then chooses as its own control does).

position_interpolation

How positions between keyframes are drawn. One of "catmull-rom", "linear", "bezier". Left out unless given (the viewer then chooses as its own control does).

rotation_interpolation

How the view direction turns between keyframes. One of "slerp", "linear". Left out unless given (the viewer then chooses as its own control does).

speed

Speed of automatic transitions, 1 (very slow) to 100 (very fast). A whole number (at least 1, at most 100). Left out unless given (the viewer then chooses as its own control does).

Value

A cellucid_action_request, at once and invisibly: the action is sent now, or when the viewer's channel opens. cellucid_action_result(request) returns its outcome (what it did, as names, counts and ids), or NULL when it had nothing to report; request$step is the history step it made.

Details

The viewer's action camera-path.playback.set (Camera path). It changes what the viewer shows: one step of the viewer's history, labelled as R's, undone like any other. The state it can change: camera-path.

See also

cellucid_act() sends any action by its type, and cellucid_action_result() collects its answer.

Examples

if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
  data("pbmc_small", package = "SeuratObject")
  viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
  request <- cellucid_camera_path_playback_set(viewer)
  print(request)
  # cellucid_action_result(request) waits for its outcome.
  cellucid_stop(viewer)
}