pyo3_bindgen

pyo3_bindgen generates Rust FFI bindings to Python modules via PyO3, preserving type annotations and docstrings. BLR, a Rust interface for Blender, uses it in practice: it authors Blender scenes from Rust through bindings generated from Blender’s Python API. Its showcase presents native Blender renders of those scenes: a textured prism, Geometry Nodes results at 1 m and 2 m heights, and an eight-frame camera turntable.

Blender scenes authored in Rust

The interactive viewer is not available on this site. The image above shows native Blender renders from the BLR showcase.

The showcase

The showcase viewer lets you choose a scene recipe, switch between the 1 m and 2 m Geometry Nodes heights, and use playback or the timeline to inspect individual turntable frames. A separate 3D view loads a prepared GLB on request. These controls select precomputed native results; Blender and binding generation do not run in the browser.

From Blender’s schema to Rust

BLR uses pyo3_bindgen to turn Blender’s captured Python API schema into a typed Rust boundary through PyO3. A schema provider captures Blender 5.2’s RNA API as versioned SchemaIr; pyo3_bindgen reads that external representation and emits raw bindings. For Blender 5.2, the generated bindings cover 215 classes and 427 enums from BLR’s audited API surface. Operators remain dynamic calls.

BLR adds the application layer: typed objects and math, scene and project lifecycle, import/export, and node-graph helpers. Native Blender recipes use that layer to create editable .blend scenes, export GLB models, and render preview images with Blender Cycles on the CPU. The turntable recipe saves its scene and eight frames. Raw PyO3 and Blender access remain available where needed.

Scope and limits

The showcase is a worked example for both projects: pyo3_bindgen generates the typed boundary from a captured schema, and BLR uses it to author Blender scenes through its domain-specific Rust layer. Generated bindings reflect the captured schema and its available type information; they do not make Python calls faster by themselves. Blender still has to be available as a matching Python runtime when BLR runs.

BLR’s development branch targets Blender 5.2; the published 0.1.0 release uses an earlier API, and the Rust API remains pre-1.0. The showcase reflects the development branch, not a released, stable API.