Skip to content

playback

Async background coroutines: vtk.js warmup and autoplay.

keyframe_increment

keyframe_increment(n_steps, n_frames=TARGET_FRAMES)

Return the step stride that spreads n_steps steps over at most n_frames keyframes.

clear_overlay

clear_overlay(state)

Clear the loading and busy flags on state and flush them to the client; returns None.

vtkjs_warmup async

vtkjs_warmup(gen, get_gen, state, path)

Load every keyframe step of path into the server-side mesh cache, then clear the overlay on state when get_gen() still equals gen.

autoplay_loop async

autoplay_loop(
    state,
    scene,
    ctrl,
    project_metadata,
    xdmf_meta,
    frame_sleep,
)

Advance state.active_step by state.step_inc through select_step with scene, ctrl, project_metadata and xdmf_meta, wrapping to step 0, every frame_sleep / state.playback_speed seconds until state.autoplay clears or a step fails.