7 Commits

Author SHA1 Message Date
Syoyo Fujita
16ecaa3a53 Add comprehensive timeSamples evaluation tests ensuring OpenUSD compatibility
This commit adds extensive testing and documentation for TinyUSDZ's timeSamples
evaluation to ensure compatibility with OpenUSD's behavior.

## Added Tests
- Single timeSample behavior (held constant for all times)
- Default value vs timeSamples coexistence
- Multiple timeSamples with linear interpolation
- Attribute::get() API with various time codes
- Held vs linear interpolation modes
- Edge cases and boundary conditions

## Key Behaviors Verified
- Default values and time samples exist in separate value spaces
- TimeCode::Default() always returns the default value (e.g., 7,8,9)
- Numeric time codes use time samples with interpolation
- Values are held constant before/after sample range (no extrapolation)
- Linear interpolation between samples when multiple samples exist

## Documentation
- doc/timesamples.md: Complete guide with Python test scripts and insights
- doc/timesamples-tinyusdz-tests.md: Test results and verification summary
- OpenUSD test scripts demonstrating expected behavior

All 896 test assertions pass, confirming TinyUSDZ correctly implements OpenUSD's
timeSamples evaluation semantics.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 02:23:31 +09:00
Syoyo Fujita
1838ece7ff add path sort and crate encoding experience. 2025-11-02 08:24:17 +09:00
Syoyo Fujita
2fde3956cd Fix whitespace: add newline and remove trailing spaces
- aousd/setup_env.sh: Add missing newline at end of file
- src/value-types.hh: Remove trailing whitespace

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 08:13:08 +09:00
Syoyo Fujita
69e5426ac6 Add OpenUSD Crate format analysis and C++ examples
Comprehensive documentation and working C++ examples for OpenUSD's
Crate (USDC binary) format implementation.

Documentation (crate-impl.md, 1249 lines):
- Complete binary format specification with diagrams
- File layout: Bootstrap, Value Data, Structural Sections, TOC
- Key data structures: ValueRep (8 bytes), Spec, Field, TimeSamples
- Type system: All 60 supported types documented
- Reading implementation: 3 ByteStream backends (mmap/pread/asset)
- Writing implementation: Packing, deduplication, async I/O
- Compression: Integer/float/LZ4 algorithms detailed
- Deduplication: 3-level system (structural/per-type/time arrays)
- Version history: 13 versions (0.0.1 to 0.13.0)
- Optimizations: Zero-copy arrays, parallel construction, etc.
- Performance: Read/write speeds, memory usage, file sizes
- Security: Bounds checking, recursion protection, validation

C++ Examples (aousd/crate/):
Three working programs demonstrating OpenUSD C++ API:

1. crate_reader (157 KB)
   - Read .usdc/.usda files
   - Traverse prim hierarchy
   - Display attributes and TimeSamples
   - Works with any USD file

2. crate_writer (329 KB)
   - Create animated USD scenes
   - Write TimeSamples for animation
   - Animated transforms and colors
   - Simple and complex scene modes

3. crate_internal_api (169 KB)
   - Inspect binary format (magic, version, TOC)
   - Analyze TimeSamples (uniform/non-uniform sampling)
   - Compare format sizes (ASCII vs binary)
   - Low-level format introspection

Build Systems:
- Makefile: Simple, fast Unix builds
- CMake: Cross-platform, IDE integration
- build.sh: Convenience wrapper script
- Both monolithic and standard USD linking
- Links against no-python OpenUSD builds

Documentation:
- README.md: Complete build/usage instructions
- EXAMPLES_OUTPUT.md: Actual program outputs
- Full API usage examples
- Troubleshooting guide

Verified Working:
- Compiles with C++17
- Links against libusd_ms.so (monolithic)
- Creates/reads .usdc files successfully
- Binary format inspection working
- TimeSamples encoding/decoding functional

File sizes: ~660 KB total (all 3 programs)
Binary compression: 50-60% smaller than ASCII

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 06:37:26 +09:00
Syoyo Fujita
fb0a9e9619 Add no-Python build variants for OpenUSD
Adds two new C++-only build variants without Python bindings:
- Standard no-python build (43 modular libraries, 320 MB)
- Monolithic no-python build (single libusd_ms.so, 417 MB)

These builds are ideal for:
- Pure C++ applications without Python dependencies
- Embedded systems with limited resources
- Server-side processing deployments
- Production environments requiring minimal footprint

New scripts:
- setup_openusd_nopython.sh - Build standard C++-only variant
- setup_openusd_nopython_monolithic.sh - Build monolithic C++-only variant
- setup_env_nopython.sh - Environment setup (auto-generated)
- setup_env_nopython_monolithic.sh - Environment setup (auto-generated)

Documentation:
- Updated aousd/README.md with all four build variants
- Added README_BUILD_COMPARISON.md for detailed comparison

All four OpenUSD build variants now available:
1. Standard (with Python, 45+ libs, with tools)
2. Monolithic (with Python, 1 lib, with tools)
3. No-Python Standard (C++-only, 43 libs, library-only)
4. No-Python Monolithic (C++-only, 1 lib, library-only)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 01:47:18 +09:00
Syoyo Fujita
f7c2a4fc00 add monolithic build variant of OpenUSD build script. 2025-10-31 23:19:46 +09:00
Syoyo Fujita
c57788af01 Add OpenUSD comparison environment setup
Created a comprehensive environment for comparing TinyUSDZ with OpenUSD:

- Setup scripts for building OpenUSD with Python bindings using clang-20
- Python comparison script (compare_usd_example.py) for testing both libraries
- C++ build examples using both Makefile and CMake
- Example C++ code that loads USD files with both libraries
- Comprehensive documentation for setup and usage

The environment allows side-by-side comparison of USD file parsing,
metadata extraction, and scene traversal between TinyUSDZ and OpenUSD.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 04:38:10 +09:00