mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Added comprehensive test models and scripts for skeletal animation features: Skeletal Animation Test Models (models/): - skelanim-empty.usda: Edge case with no animation data - skelanim-mixed.usda: Mixed static and time-sampled (incomplete skeleton binding) - skelanim-rotation-only.usda: Only rotation channels animated - skelanim-single-joint.usda: Single joint animation - skelanim-static.usda: Static values only (incomplete skeleton binding) - skelanim-timesampled.usda: Time-sampled values (incomplete skeleton binding) Synthetic Skin Test Models (models/): - synthetic-skin-8influences.usda: 8 influences per vertex test - synthetic-skin-16influences.usda: 16 influences per vertex test - synthetic-skin-32influences.usda: 32 influences per vertex test Test Scripts (web/js/): - test-anim-debug.js: Animation debugging utility - test-16influences.js: Test 16 influences per vertex - test-all-bone-reduction.js: Bone reduction testing - test-boundaries.js: Boundary condition tests - test-digit-limits.js: Digit parsing limits - test-malicious.js: Malicious input handling - test-number-parsing.js: Number parsing validation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.6 KiB
JavaScript
45 lines
1.6 KiB
JavaScript
import { TinyUSDZLoader } from './src/tinyusdz/TinyUSDZLoader.js';
|
|
|
|
async function main() {
|
|
const loader = new TinyUSDZLoader();
|
|
await loader.init({ useMemory64: false });
|
|
|
|
const usd = await new Promise((resolve, reject) => {
|
|
loader.load('../../models/skintest-blender.usda', resolve, null, reject);
|
|
});
|
|
|
|
console.log('\n=== Animation Debug Info ===');
|
|
const numAnims = usd.numAnimations();
|
|
console.log(`Total animations: ${numAnims}`);
|
|
|
|
for (let i = 0; i < numAnims; i++) {
|
|
const animInfo = usd.getAnimationInfo(i);
|
|
console.log(`\nAnimation ${i}:`);
|
|
console.log(' animInfo:', JSON.stringify(animInfo, null, 2));
|
|
|
|
const anim = usd.getAnimation(i);
|
|
console.log(' anim.channels:', anim.channels ? anim.channels.length : 0);
|
|
console.log(' anim.samplers:', anim.samplers ? anim.samplers.length : 0);
|
|
|
|
if (anim.channels && anim.channels.length > 0) {
|
|
console.log('\n First few channels:');
|
|
for (let j = 0; j < Math.min(3, anim.channels.length); j++) {
|
|
console.log(` Channel ${j}:`, JSON.stringify(anim.channels[j], null, 2));
|
|
}
|
|
}
|
|
|
|
if (anim.samplers && anim.samplers.length > 0) {
|
|
console.log('\n First sampler:');
|
|
const sampler = anim.samplers[0];
|
|
console.log(` times.length: ${sampler.times ? sampler.times.length : 0}`);
|
|
console.log(` values.length: ${sampler.values ? sampler.values.length : 0}`);
|
|
if (sampler.times && sampler.times.length > 0) {
|
|
console.log(` First time: ${sampler.times[0]}`);
|
|
console.log(` First values: [${sampler.values.slice(0, 3).join(', ')}]`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
main().catch(console.error);
|