Repository navigation
CLI: rename the binary to crust, add render and ls <kind> subcommands - #212
Conversation
The package stays `crust-render`; a `[[bin]]` target names the executable `crust`. Clap's command name, the `--log-file` file name, the scripts that invoke `target/release/...`, and the docs and site follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL
`crust render [flags]` is the previous behaviour; the render flags now belong to it, while `-l` and `--log-file` are global. `crust ls camera -i <scene>` (alias `cameras`) prints the stage's cameras, one prim path per line on stdout, with the log on stderr so the list can be piped. The listing is `Scene::usd_cameras` in crust-core: the import's own walk (same streaming chunks, `prune_reason`, invisible subtrees walked, instances and PointInstancers not entered) reading only the camera schema, so it lists exactly the paths `--camera` accepts. A test pins that and renders through every path it lists. Scripts, docs, the user site and the cli spec call `crust render` now; bench_ab.sh detects a binary from before the subcommand so old and new builds can still be compared. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL
`crust ls <KIND> -i <scene>` replaces the `ls camera` subcommand: KIND is a clap value enum (camera | light | material, plurals accepted), and a new kind is one variant away. crust-core's `Scene::usd_cameras` becomes `Scene::list_usd(path, ListKind)`. Each kind follows the import's own rules: cameras as before; lights pruned as geometry is (an invisible light lights nothing), never from a prototype or beneath a PointInstancer; materials wherever a binding can reach, only inactive subtrees and instance prototypes left out. The test now also checks the listed lights against the import's light list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL
PR Summary by QodoRename CLI to crust and add render and USD listing commands
AI Description
Diagram
High-Level Assessment
Files changed (42)
|
Code Review by Qodo
1.
|
- `Scene::list_usd` lists each path once. A chunk's population mask keeps the masked prim's ancestors, so a stage's sole top-level prim was walked, and listed, once per streamed chunk. Tested with a camera as the sole top-level prim of four children; without the fix it is listed four times. - `--log-file` is a `render` flag again rather than a global one. Its directory is optional, so `crust --log-file render ...` took `render` as the directory, and `crust ls --log-file camera` would take the kind. `-l` stays global, as it always takes a value. - `ls light` lists a light whatever its values: whether the import accepts it (a zero radius, a collapsing transform) depends on the time code, which a listing does not evaluate. Documented on `ListKind::Light`, in the spec and on the CLI page, and pinned by a zero-radius light in the test. - The test also pins that a USD layer renamed `.obj` is refused: openusd resolves the format from the extension before reading the file. - Two recipes missed by the rename: the Moana traversal-stats command still named `crust-render`, and the HDR sample's continued command lacked `render`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL
A minor bump: the CLI's command line changes (the `crust` binary, the `render` and `ls` subcommands). Also the docs site's landing-page version badge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL
Summary
Binary renamed to
crust. The package stayscrust-render, so-p crust-render, the crate directory andCargo.lockare unchanged. A[[bin]] name = "crust"target sets the executable name, and the clap command name is set explicitly.--log-filenow writescrust-<UTC stamp>.log.Subcommands (breaking change for command lines).
crust render [flags]behaves like the old barecrust-render [flags]: every render flag belongs to it,--log-fileincluded, and without-iit still renders the procedural scene.-l/--levelis global and can go before or after the subcommand.--log-filestays arenderflag. Its directory is optional, so before a subcommand name orls's KIND it would take that word as the directory.crust -i scene.usda, is now a usage error.crust ls <KIND> -i <scene>.KINDis a clap value enum:camera,lightormaterial, with the plurals also accepted. It prints one absolute prim path per line on stdout, each path once. The log goes to stderr, so the list can be piped, for examplefor cam in $(crust ls camera -i shot.usda); do crust render … --camera "$cam"; done.The listing lives in crust-core as
Scene::list_usd(path, ListKind)(usd_import/listing.rs). It follows the importer's own rules, so the list matches what a render would use:prune_reason. It reads only the listed schema and builds nothing.--cameraaccepts. A camera under an invisible parent is listed, because the render still walks there for cameras. Cameras inside instances or under aPointInstancerare left out.Materiala binding can reach. Only materials under inactive parents or inside instances are left out.docs/architecture.md§ Invariants now lists the importer walk and this listing walk as a pair that must change together.Scripts and docs.
crust render/cargo run --release -- render: scripts,docs/, the openspec CLI spec and design record, the README, CLAUDE.md, the user site, and the sample comments.bench_ab.shchecks whether each binary has therendersubcommand, so it can still compare a build from before this PR against a new one.lssection.Not changed: the
softwareheader written into EXR and TIFF files still readscrust-render <version>.Testing
cargo test --workspace --no-fail-fast: 1413 passed, 0 failed.cargo clippy --workspace --all-targets -D warningsandcargo fmt --checkare clean.list_usd_lists_what_a_render_usesuses a stage with cameras, lights and materials under invisible, inactive,classand proxy parents, in an instance, and under aPointInstancer, plus a zero-radius light..obj, which must be refused.-lbefore and after the subcommand,--log-filerefused outsiderender, every kind and its plural, and an unknown kind. A clapdebug_assertchecks the command definition.crust renderon the Cornell box,crust ls camera|light|material, a stage path that doesn't exist (exit 1), and the old command-line form (usage error).scripts/check_images.sh record/checkreports every scene bit-identical, exceptKitchen_set, whose assets aren't in the environment.scripts/bench_ab.shran a binary from before this PR against the new one.#lsanchor.🤖 Generated with Claude Code
https://claude.ai/code/session_012dHmaZERNCXcMkLmHQypdL