Inochi2D-rs

crates.io docs.rs License Join the XMPP chat at inochi2d@muc.linkmauve.fr

A pure Rust implementation of Inochi2D, the realtime 2D puppet animation framework.

This is currently done using serde_json for parsing, as well as GLFW and glow for the rendering, using OpenGL ES 2.0.

How to use

Clone the repository:

% git clone https://git.linkmauve.fr/inochi2d.git

Build:

% cargo build --release

Run:

% cargo run --release <puppet.inp>

You can find two example puppets in Inochi2D’s example models.

WebGL support using Web Assembly

You will need to enable the wasm32-unknown-unknown target (for instance using rustup):

% rustup target add wasm32-unknown-unknown

Then install wasm-bindgen (also available in ArchLinux):

% cargo install wasm-bindgen

Then you can build the wasm file and its assorted helper JS file:

% cargo build --target=wasm32-unknown-unknown --lib --release --no-default-features
% wasm-bindgen target/wasm32-unknown-unknown/release/inochi2d.wasm --target=web --out-dir=pkg

Everything you need will be in the pkg/ directory. You can now import the JS file from your own scripts, check the example bootstrap.js included here.

TODO

Demo

Warning: Chromium doesn’t support JS modules, try the text/html version of this demo if you use this browser, or use Firefox.

Format:

Model: