mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
This commit adds comprehensive skeletal animation support for USD files: WASM Binding Enhancements (web/binding.cc): - Add numSkeletons() to get skeleton count - Add getSkeleton(id) for hierarchical skeleton data - Add getAllSkeletons() to retrieve all skeletons - Add getSkeletonJointsFlat(id) for optimized flat format - Expose joint hierarchy, bind/rest transforms, and metadata Three.js Helper Library (web/js/src/tinyusdz/USDSkeletalHelper.js): - createThreeSkeletonFromUSD() - Convert USD skeleton to THREE.Skeleton - createThreeAnimationClip() - Convert USD animation to THREE.AnimationClip - createSkinnedMeshFromUSD() - All-in-one helper for skinned mesh creation - playAnimation() - Simplified animation playback - Full matrix conversion, quaternion handling, and time remapping Demo Integration (web/js/skining-anim.js): - Integrate USDSkeletalHelper with toggle option (USE_SKELETAL_HELPER) - Support both simplified helper approach and advanced custom implementation - Add comprehensive documentation explaining both approaches - Fix file loading to use parse() API instead of Blob URLs - Change default test file to CesiumMan.usdz Inspection Tools: - Add --help and --dump-timesamples to tydra_to_renderscene (C++ tool) - Enhance skinning-info.js to display skeleton hierarchy and keyframes - Fix Node.js file loading using fs.readFileSync instead of fetch() Documentation: - SKELETAL_ANIMATION_API.md (602 lines) - Complete API reference - SKELETAL_ANIMATION_IMPLEMENTATION.md (621 lines) - Implementation guide - Standalone example: web/js/examples/threejs-skeletal-example.html Tested with CesiumMan.usdz (19 joints, 48-second animation). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>