This commit adds comprehensive USD metadata reading and multiple viewer enhancements: Backend changes: - Populate RenderScene.meta with USD Stage metadata (upAxis, metersPerUnit, FPS, timecodes, time ranges, autoPlay, comment, copyright) - Add getUpAxis() and getSceneMetadata() methods to WASM bindings - Extract copyright from customLayerData dictionary Animation viewer enhancements: - Fix upAxis conversion to only apply when file is Z-up (not blindly to all files) - Add Scene Metadata UI folder displaying all USD metadata - Change Speed to directly represent FPS from metadata (default 24) - Rename time labels to use TimeCode terminology (Begin/End TimeCode, Duration) - Scale default scene 10x for meter-based USD files (camera, grid, shadows, light) - Add "Fit to Scene" feature that auto-adjusts camera, grid, and shadow frustum based on bounding box - Apply metersPerUnit scaling with toggle option - Set animation time range from startTimeCode/endTimeCode metadata The viewer now properly respects USD metadata and provides better defaults for typical meter-based models. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
TinyUSDZ JS/WASM
Demo app
See demo folder.
It uses npm package of tinyusdz, so no WASM building required.
Technical note on JS/WASM version of TinyUSDZ
Please see wiki https://github.com/lighttransport/tinyusdz/wiki/WASM-and-JavaScript-module
For library developers
See js folder for JS codes.
Building WASM module
Emscripten and emcmake required. TinyUSDZ is beging built with C++20 to use C++20 coruntine to support async over JS/WASM boundary, without requiring sASYNCIFY and JSPI(JavaScript Promise Integration)
Standard WASM32 build (2GB memory limit)
$ ./bootstrap-linux.sh
$ cd build
$ make
WASM64/MEMORY64 build (8GB memory limit)
$ rm -rf build
$ emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DTINYUSDZ_WASM64=ON -Bbuild
$ cd build
$ make
Memory Limit Defaults
- WASM32 (standard): 2GB default memory limit
- WASM64 (MEMORY64): 8GB default memory limit
The JavaScript wrapper automatically uses the appropriate native default based on the build architecture.
Note: WASM64/MEMORY64 requires browsers with MEMORY64 support (Chrome 109+, Firefox 102+ with flags enabled).
wasm module(tinyusdz.js and tinyusdz.wasm) will be output to js/src/tinyusdz folder.
See also: bootstrap-examples.sh for build configuration examples.
Note
- asyncify is disabled since it increases code size ~2.5x
Code size
tinyusdz.wasm
2025/05. emsdk 4.0.8. -Oz : 1.6 MB 2025/06. emsdk 4.0.9. -Oz : 1.9 MB
zstd compression
we recommend to use zstd compression for wasm binary in the deployment.
for example, 1.9MB tinyusdz wasm can be compressed to 400KB with -19 compression level.
Prepare wasm.zstd
$ zstd -19 tinyusdz.wasm
See js/src/tinyusdz/TinyUSDZLoader.js to how to load zstd compressed wasm.
stack size
128k => ok. 64k => ok.
npm packaging
See npm folder and <tinyusdz>/.github/workflows/wasmPublish.yml for npm publish.