Files
tinyusdz/web/demo/public/assets/hierarchical-node-animation.usdc
Syoyo Fujita a4f42e29fc Fix PropertyBinding UUID syntax for Three.js AnimationMixer
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>
2025-10-30 08:20:06 +09:00

6.6 KiB