Install
pfx-scene is a Rust library. It needs a stable Rust toolchain (edition 2024) and nothing else: no system library, no GPU and no C compiler. It builds and is tested the same way on Linux, Windows and macOS.
Add it to a project
Section titled “Add it to a project”The crate is published on GitHub and pinned by tag. In your Cargo.toml, on any of the three systems:
[dependencies]pfx-scene = { git = "https://github.com/gmrdad82/pfx-scene", tag = "v1.0.1" }Then use pfx_scene::… in your code. Every tag is on the releases page.
Try the demo
Section titled “Try the demo”The repository holds a demo project in examples/demo and four small programs on the API. Clone it and check the demo:
git clone https://github.com/gmrdad82/pfx-scenecd pfx-scenecargo run --release --example scene-check -- examples/demoscenes/room.scene.toml: 6 objects, 2 prefab placements, 3 bodies, 1 light, 2 materialsno errorsThe same commands work in PowerShell on Windows and in a terminal on Linux or macOS. The other programs are scene-tree, scene-write and scene-bench; the guides use each of them.
Quick start
Section titled “Quick start”The shortest useful program opens a project, prints every finding and resolves its scene:
use std::path::Path;
fn main() { let project = pfx_scene::Project::open(Path::new("my-game")).unwrap(); for diagnostic in project.check() { println!("{diagnostic}"); } let scene = project.scene(Path::new("scenes/room.scene.toml")).unwrap(); println!("{} objects", scene.objects.len());}my-game is a folder with a project.toml. Lay out a project says what goes in it, and Check a project shows what the findings look like.