pub struct Scene {Show 22 fields
pub duration: f64,
pub background: Option<BackgroundValue>,
pub children: Vec<Value>,
pub prepared_children: OnceLock<Arc<dyn Any + Send + Sync>>,
pub transition: Option<Transition>,
pub freeze_at: Option<f64>,
pub layout: Option<SceneLayout>,
pub animated_background: Vec<AnimatedBackground>,
pub camera: Option<Camera>,
pub shake: Option<SceneShake>,
pub world_position: Option<WorldPosition>,
pub persist: bool,
pub light: Option<SceneLight>,
pub effects: Vec<PostEffect>,
pub at: SceneStart,
pub tail: SceneTail,
pub resolved_background: ResolvedBackground,
pub resolved_time_ctx: TimeCtx,
pub resolved_timing: TimingMode,
pub resolved_snap: Option<SnapMode>,
pub vars: VarSet,
pub resolved_scenario_vars: VarSet,
}Fields§
§duration: f64§background: Option<BackgroundValue>Unified background: color string, animated entry (with optional $ref), or array.
children: Vec<Value>§prepared_children: OnceLock<Arc<dyn Any + Send + Sync>>Filled once, by whoever first deserializes children into the component
type it owns. rustmotion-core cannot name that type, so it is held
erased; Scene::prepared_children is the typed accessor.
transition: Option<Transition>§freeze_at: Option<f64>§layout: Option<SceneLayout>Flex layout for automatic layer positioning
animated_background: Vec<AnimatedBackground>Legacy animated background (kept for backward compat)
camera: Option<Camera>Virtual camera with animatable x, y, zoom, rotation.
shake: Option<SceneShake>Declarative camera shake (issue #330): a list of beat-synced
impacts, each a damped harmonic oscillator, summed and additive
over camera above — a pan and a shake ride the same frame instead
of fighting over one keyframe track. See SceneShake for the
formula and crate::engine::shake::shake_offset for the function
that evaluates it.
world_position: Option<WorldPosition>Position of this scene in the 2D world (used by world views).
persist: bool(world) Keep this scene visible after its time window ends.
light: Option<SceneLight>Direction the light comes from, shared by every style.material in
the scene. Absent means upper-left, the convention an eye reads as
“lit from above” without being told.
Declaring it once is what makes several materials look like they belong to the same frame: a per-node preset cannot agree with its neighbours about where the light is.
effects: Vec<PostEffect>Post-processing effects applied to the full frame buffer after Skia renders. Effects are additive and applied in declaration order.
at: SceneStartWhere this scene starts, on the scenario’s absolute timeline (issue
#336). at is absolute by definition — see the anchoring rule
documented once on TimePoint. Defaults to SceneStart::Auto:
immediately after the previous scene’s own window ends. Only
consulted by rustmotion’s frame-task scheduler under
Scenario.timing = "v2"; a "v1" scenario places scenes
back-to-back regardless of what this field says.
tail: SceneTailHow this scene behaves when the next scene’s transition overlaps
into it, rendering it past its own duration (issue #336, timing: "v2" only). Defaults to SceneTail::Freeze.
resolved_background: ResolvedBackgroundPost-resolution background (populated by include.rs, ignored by serde).
resolved_time_ctx: TimeCtxThe beat-grid context (bpm/beat_offset) of the Scenario this
scene was declared in — populated by Scenario’s own
Deserialize impl, before include.rs resolution ever runs, not
by include.rs itself (issue #336; see the doc on
ResolvedScenario for why). scene_start is always 0.0 here:
Scene::at is resolved with
TimePoint::resolve_absolute,
which ignores it.
resolved_timing: TimingModeThe Scenario.timing this scene was declared under. Same
populate-at-deserialize-time note as Scene::resolved_time_ctx.
resolved_snap: Option<SnapMode>The Scenario.snap this scene was declared under. Same
populate-at-deserialize-time note as Scene::resolved_time_ctx.
vars: VarSetThis scene’s own declared variables (issue #329): shadow a
same-named scenario-level variable (Scenario::vars) for
expressions evaluated inside this scene, and are themselves
invisible from any other scene — see rustmotion_core::vars::VarScope
for the shadowing rule and why that isolation needs no special-case
error handling. A variable with no animation here is a constant,
same as at the scenario level.
resolved_scenario_vars: VarSetThe enclosing Scenario::vars this scene was declared under —
populated by Scenario’s own Deserialize impl, before
include.rs resolution ever runs, not by include.rs itself. Same
populate-at-deserialize-time note as Scene::resolved_time_ctx:
ResolvedScenario carries no scenario-level fields of its own, so
anything a scene needs to remember about its enclosing Scenario
has to already be sitting on the Scene by the time include.rs —
a file no single workstream owns — merges included scenes in.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scene
impl<'de> Deserialize<'de> for Scene
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Scene
impl JsonSchema for Scene
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl !Freeze for Scene
impl !RefUnwindSafe for Scene
impl !UnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnsafeUnpin for Scene
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more