pub struct RanimPreviewApp {Show 40 fields
cmd_rx: Receiver<RanimPreviewAppCmd>,
pub cmd_tx: Sender<RanimPreviewAppCmd>,
title: String,
clear_color: Color,
scene_constructor: Arc<dyn SceneConstructor>,
scene_config: SceneConfig,
resolution: Resolution,
evaluator: SceneEvaluator,
need_eval: bool,
last_sec: f64,
store: RenderFrame,
timeline_state: TimelineState,
playback_engine: PlaybackEngine,
renderer: Option<Renderer>,
render_textures: Option<RenderTextures>,
texture_id: Option<TextureId>,
depth_texture_id: Option<TextureId>,
view_mode: ViewMode,
wgpu_ctx: Option<WgpuContext>,
last_render_time: Option<Duration>,
last_eval_time: Option<Duration>,
depth_visual_pipeline: Option<DepthVisualPipeline>,
depth_visual_texture: Option<Texture>,
depth_visual_view: Option<TextureView>,
resolution_dirty: bool,
export_dialog_open: bool,
export_config: Output,
export_progress_rx: Option<Receiver<ExportProgress>>,
export_current_frame: u64,
export_total_frames: u64,
playback_speed: f64,
looping: bool,
profiler_open: bool,
gpu_pass_times: Vec<(String, f64)>,
cpu_spans: Vec<(String, f64)>,
upload_stats: BTreeMap<&'static str, UploadStats>,
progress_samples: Vec<Option<ProgressSample>>,
progress_total_sec: f64,
profiler_metric: ProfilerMetric,
profiler_stacked: bool,
}preview only.Fields§
§cmd_rx: Receiver<RanimPreviewAppCmd>§cmd_tx: Sender<RanimPreviewAppCmd>§title: String§clear_color: Color§scene_constructor: Arc<dyn SceneConstructor>§scene_config: SceneConfig§resolution: Resolution§evaluator: SceneEvaluator§need_eval: bool§last_sec: f64§store: RenderFrame§timeline_state: TimelineState§playback_engine: PlaybackEngine§renderer: Option<Renderer>§render_textures: Option<RenderTextures>§texture_id: Option<TextureId>§depth_texture_id: Option<TextureId>§view_mode: ViewMode§wgpu_ctx: Option<WgpuContext>§last_render_time: Option<Duration>§last_eval_time: Option<Duration>§depth_visual_pipeline: Option<DepthVisualPipeline>§depth_visual_texture: Option<Texture>§depth_visual_view: Option<TextureView>§resolution_dirty: bool§export_dialog_open: boolrender and non-target_family=wasm only.export_config: Output§export_progress_rx: Option<Receiver<ExportProgress>>render and non-target_family=wasm only.export_current_frame: u64render and non-target_family=wasm only.export_total_frames: u64render and non-target_family=wasm only.playback_speed: f64§looping: bool§profiler_open: bool§gpu_pass_times: Vec<(String, f64)>Last rendered frame’s GPU pass times in μs, flattened from the wgpu-profiler scope tree. Empty when GPU timers are unavailable.
cpu_spans: Vec<(String, f64)>CPU spans of the last rendered frame (ms), drained from
cpu_probe.
upload_stats: BTreeMap<&'static str, UploadStats>Last rendered frame’s per-buffer upload stats (drained each frame).
progress_samples: Vec<Option<ProgressSample>>Profiling samples indexed by timeline position (one bucket per logic frame); playing or seeking updates the bucket at the rendered position, so the chart shows performance across scene progress.
progress_total_sec: f64§profiler_metric: ProfilerMetric§profiler_stacked: boolWhether stackable chart metrics render stacked (per-pass colors) instead of a plain total.
Implementations§
Source§impl RanimPreviewApp
impl RanimPreviewApp
pub fn new( scene_constructor: impl SceneConstructor + 'static, title: String, scene_config: SceneConfig, ) -> Self
Sourcepub fn set_clear_color_str(&mut self, color: &str)
pub fn set_clear_color_str(&mut self, color: &str)
Set clear color str
Sourcepub fn set_clear_color(&mut self, color: Color)
pub fn set_clear_color(&mut self, color: Color)
Set clear color
Sourcepub fn set_resolution(&mut self, resolution: Resolution)
pub fn set_resolution(&mut self, resolution: Resolution)
Set preview resolution
Sourcefn calculate_oit_layers(
&self,
ctx: &WgpuContext,
width: u32,
height: u32,
) -> usize
fn calculate_oit_layers( &self, ctx: &WgpuContext, width: u32, height: u32, ) -> usize
Calculate OIT layers based on resolution to stay within GPU buffer limits
fn handle_events(&mut self)
fn prepare_renderer(&mut self, frame: &Frame)
fn is_playing(&self) -> bool
Sourcefn scrub_to(&mut self, sec: f64)
fn scrub_to(&mut self, sec: f64)
Move the playhead, keeping the active clock consistent with it.
Sourcefn tick_playback(&mut self) -> bool
fn tick_playback(&mut self) -> bool
Read the playing clock into the playhead and handle end-of-scene (loop or stop). Returns whether the UI should keep repainting.
fn render_animation(&mut self)
fn start_export(&mut self, ctx: Context)
render and non-target_family=wasm only.Trait Implementations§
Source§impl App for RanimPreviewApp
impl App for RanimPreviewApp
Source§fn ui(&mut self, ui: &mut Ui, frame: &mut Frame)
fn ui(&mut self, ui: &mut Ui, frame: &mut Frame)
§fn logic(&mut self, ctx: &Context, frame: &mut Frame)
fn logic(&mut self, ctx: &Context, frame: &mut Frame)
Self::ui],
and additionally also called when the UI is hidden, but [egui::Context::request_repaint] was called. Read more§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
§fn on_exit(&mut self)
fn on_exit(&mut self)
glow only.Self::save]. Read more§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Self::save]§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
gl.clearColor. Read more§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
§fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
Self::ui]. Read moreAuto Trait Implementations§
impl !Freeze for RanimPreviewApp
impl !RefUnwindSafe for RanimPreviewApp
impl !Send for RanimPreviewApp
impl !Sync for RanimPreviewApp
impl !Unpin for RanimPreviewApp
impl !UnsafeUnpin for RanimPreviewApp
impl !UnwindSafe for RanimPreviewApp
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> TransformedExt for T
impl<T> TransformedExt for T
Source§fn transformed<G>(self, transform: G) -> Transformed<Self, G>
fn transformed<G>(self, transform: G) -> Transformed<Self, G>
self wrapped with transform stored exactly as G.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more