MCPcopy Index your code
hub / github.com/AzurIce/ranim

github.com/AzurIce/ranim @v0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.1 ↗ · + Follow
1,286 symbols 3,629 edges 128 files 380 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Ranim Logo

Ranim

<img alt="license" src="https://img.shields.io/github/license/AzurIce/ranim" />
<img alt="crates.io" src="https://img.shields.io/crates/v/ranim.svg" />
<img alt="commit" src="https://img.shields.io/github/commit-activity/m/AzurIce/ranim?color=%23ff69b4">






<img alt="build check" src="https://github.com/AzurIce/ranim/actions/workflows/build.yml/badge.svg" />
<img alg="website check" src="https://github.com/AzurIce/ranim/actions/workflows/website.yml/badge.svg" />






<img alt="stars" src="https://img.shields.io/github/stars/AzurIce/ranim?style=social">










<img alt="hello_ranim" src="https://github.com/AzurIce/ranim/raw/v0.2.1/assets/hello_ranim.gif" width="48%" />
<img alt="ranim_logo" src="https://github.com/AzurIce/ranim/raw/v0.2.1/assets/ranim_logo.gif" width="48%" />

examples/hello_ranim

examples/ranim_logo

Ranim is an animation engine crate implemented in pure rust, inspired heavily by Manim and jkjkil4/JAnim.

[!WARNING] Ranim is now WIP. It only supports some basic items and animations, the apis are unstable and may change frequently, the documentation is also not complete.

Dependencies

Runtime dependencies: - ffmpeg: encode videos Ranim will try to use ffmpeg from system's path environment variable first, if no ffmpeg is found, ranim will automatic download ffmpeg to the current working dir.

Installation

Currently, it is experimental on crates.io:

[dependencies]
ranim = "0.2.1"

You can also use from git for the latest updates:

[dependencies]
ranim = { git = "https://github.com/azurice/ranim" }

For the usage, check out the examples folder. You can run the examples with:

cargo run -p ranim-cli --release -- preview --example <example-name> # run a preview app for the example
cargo run -p ranim-cli --release -- render --example <example-name> # render the example

See Ranim Cli for more.

Ranim Cli

Ranim cli is a command line tool to help you build the animation. It enables animation previewing with hot reload through dylib.

Please notice that you can use ranim without ranim-cli, the previewing and rendering process can be achieved by simply invoking apis provided by ranim, but it may enhance your experience.

You can install it with:

cargo install ranim-cli

Or install from git:

cargo install --git https://github.com/azurice/ranim ranim-cli --locked

Or you can create a bin, and run cli from ranim_cli directly (this can make sure the version of ranim matches ranim_cli):

fn main() {
    ranim_cli::main();
}

Basic Usage: - ranim preview[ <scene_name>]: Launch a preview app and invoke cargo to build your library automatically when the source code is changed, then reload it through libloading and show it in the preview app. - ranim render[ <scene-name1> <scene_name2> ...]: Render scene's output, when no scene name is specified, render all scenes.

You can specify the package with --package and --example (just like cargo, note that your anim target should have crate-type of dylib or cdylib), and other aditional arguments you want to pass to cargo build can be passed after --.

For example:

ranim render -p render scene_a scene_b -- --release

Feature Flags

  • Default features

  • anims: re-export ranim-anims, default on.

  • items: re-export ranim-items, default on.

  • render: enable render api in cmd module

use render_scene or render_scene_output to render scene to output

  • preview: enbale preview api in cmd module

use preview_scene api to launch an preview app on a scene https://github.com/user-attachments/assets/5bf287e2-b06f-42f8-83b6-76f3775e298e - profiling: enable profiling with https://github.com/EmbarkStudios/puffin

CPU uses 127.0.0.1:8585 and GPU uses 127.0.0.1:8586

image

Contributing

See CONTRIBUTING.md for guidelines.

Design

Once the design is stablized, I may write about it.

For now, you can check out the code.

Aknowledgements

Star History

Star History Chart

Extension points exported contracts — how you extend this code

GpuResource (Interface)
A render resource. [7 implementers]
packages/ranim-render/src/resource.rs
Extract (Interface)
Extract a [`Extract::Target`] from reference. [27 implementers]
packages/ranim-core/src/lib.rs
SceneConstructor (Interface)
MARK: SceneConstructor ANCHOR: SceneConstructor A scene constructor It can be a simple fn pointer of `fn(&mut RanimScen [2 …
src/scene.rs
MorphRequirement (Interface)
ANCHOR: MorphRequirement The requirement of [`Morph`] [1 implementers]
packages/ranim-anims/src/morph.rs
OutputFormatExt (Interface)
Extension trait providing ffmpeg encoding parameters for [`OutputFormat`]. [1 implementers]
src/cmd/render/file_writer.rs
LaggedRawExt (Interface)
TODO: redesign lagged Extension trait for raw lagged animation on Vec of AnimationCells [1 implementers]
examples/regular_polygon/lib.rs
ViewRenderNodeTrait (Interface)
A Render Node that is executed per view. The main difference between this and [`super::AnyGlobalRenderNodeTrait`] is th [5 …
packages/ranim-render/src/graph/view.rs
Locate (Interface)
Locate a point. [16 implementers]
packages/ranim-core/src/anchor.rs

Core symbols most depended-on inside this repo

clone
called by 153
packages/ranim-render/src/resource.rs
iter
called by 123
packages/ranim-render/src/utils.rs
play
called by 97
packages/ranim-core/src/timeline.rs
push
called by 87
packages/ranim-render/src/utils.rs
with
called by 83
packages/ranim-core/src/traits/mod.rs
timeline_mut
called by 66
packages/ranim-core/src/lib.rs
insert
called by 62
packages/ranim-core/src/lib.rs
rgb
called by 53
packages/ranim-core/src/color/mod.rs

Shape

Method 754
Function 308
Class 153
Interface 60
Enum 11

Languages

Rust92%
TypeScript8%

Modules by API surface

book/theme/highlight.js71 symbols
packages/ranim-items/src/vitem/typst.rs47 symbols
packages/ranim-core/src/traits/mod.rs44 symbols
packages/ranim-core/src/lib.rs37 symbols
packages/ranim-render/src/utils.rs35 symbols
packages/ranim-items/src/vitem/text.rs32 symbols
packages/ranim-items/src/vitem/mod.rs32 symbols
packages/ranim-items/src/mesh/mod.rs32 symbols
packages/ranim-core/src/components/vpoint.rs32 symbols
packages/ranim-core/src/animation.rs28 symbols
packages/ranim-items/src/vitem/geometry/polygon.rs27 symbols
src/cmd/preview/mod.rs26 symbols

For agents

$ claude mcp add ranim \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact