mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
This commit fixes the PropertyBinding error that occurred when playing USD animations.
**Root Cause:**
- Three.js PropertyBinding expects UUID-based track names in the format `<uuid>.<property>`
- The code was incorrectly using `.uuid[<uuid>].<property>` format which PropertyBinding doesn't support
- PropertyBinding resolves nodes by checking `childNode.name === nodeName || childNode.uuid === nodeName`
**Changes Made:**
1. **Animation track UUID syntax** (track-based and channel-based):
- Changed from: `.uuid[${targetUUID}].position`
- Changed to: `${targetUUID}.position`
- Applied to position, quaternion, and scale tracks
2. **UUID validation and lookup logic**:
- Changed from regex matching `.uuid[...]`
- Changed to: `track.name.split('.')[0]` to extract UUID from first part
- Applied to track validation and object lookup code
3. **AnimationMixer attachment**:
- Added `usdContentNode` global variable to store actual USD root node
- Mixer now created on `usdContentNode` (threeNode) instead of `usdSceneRoot`
- Ensures mixer root matches the root used for animation extraction
4. **Additional improvements**:
- Enhanced shadow map quality (2048x2048 resolution)
- Shadow camera frustum scaling with scene scale to prevent artifacts
- Bounding box visualization feature for animated objects
- Improved animation track name matching (exact match then prefix match)
- Scene graph tree UI with per-object animation controls
**Result:**
- ✅ PropertyBinding successfully resolves all UUID-based animation tracks
- ✅ Timeline slider updates all animated objects correctly
- ✅ Per-object animation toggles work in Scene Graph UI
- ✅ Hierarchical node animations work properly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
6.6 KiB
6.6 KiB