Expand description
Ranim is an animation engine written in rust based on wgpu, inspired by 3b1b/manim and jkjkil4/JAnim.
A project binary registers its scenes and hands control to the command line interface:
ⓘ
use ranim::prelude::*;
#[scene]
fn hello(r: &mut RanimScene) { /* ... */ }
fn main() {
// cargo run -- preview | output | render hello | inspect scenes
let mut app = App::new();
app.add_scenes([hello::scene()]);
run_cli(app.build());
}Plugins organize larger projects and custom render configurations:
use ranim::{App, Plugin, Resource};
/// Project resources must implement bevy's `Resource`.
#[derive(Resource)]
struct ProjectConfig(u32);
struct ProjectPlugin;
impl Plugin for ProjectPlugin {
fn build(&self, app: &mut bevy_app::App) {
app.insert_resource(ProjectConfig(42));
}
}
let mut app = App::new();
app.add_plugins(ProjectPlugin);
assert_eq!(app.world().resource::<ProjectConfig>().0, 42);§Coordinate System
Ranim’s coordinate system is right-handed coordinate:
+Y
|
|
+----- +X
/
+ZRe-exports§
pub use app::AppExt;pub use app::Output;pub use app::OutputFormat;pub use app::RanimApp;pub use app::RanimAppExt;pub use app::Scene;pub use app::SceneConfig;pub use app::SceneConstructor;pub use app::Scenes;pub use ranim_anims as anims;animspub use ranim_core as core;pub use ranim_items as items;itemspub use ranim_render as render;renderpub use core::glam;
Modules§
- app
- The project application: scenes, plugins, and resources Project configuration and scene registration for Ranim.
- cmd
- Commands like preview and render
- color
- Color utilities.
- prelude
- The preludes
- utils
- Utils
Macros§
- lagged
- Construct an
AnimLaggedwith a stagger ratio, pushing each animation in order. - seq
- Construct an
AnimSequenceby playing each animation in order. - stack
- Construct an
AnimStackby pushing each animation at the same origin.
Structs§
- App
Appis the primary API for writing user applications. It automates the setup of a standard lifecycle and provides interface glue for plugins.- Ranim
Scene - Animation definition builder passed to scene constructors.
Traits§
- Plugin
- A collection of Bevy app logic and configuration.
- Resource
- A type that can be inserted into a
Worldas a singleton.