Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Help position root track work for mixamo animations

Scott Petrovicac791d695163
diff --git a/src/index.html b/src/index.html
index c7c8b41..e675e22 100644
--- a/src/index.html
+++ b/src/index.html
@@ -101,7 +101,7 @@
<!-- add number input for changing scale of skeleton-->
<div style="display: flex; flex-direction: row; justify-content: space-evenly; align-items: center;">
- <input type="number" id="scale-input" name="scale-input" value="-1" min="-90" max="90" step="1.0">
+ <input type="number" id="scale-input" name="scale-input" value="-3" min="-90" max="90" step="1.0">
<span class="suffix-unit">%</span>
<button id="scale-skeleton-button" class="secondary-button" >Scale</button>
</div>
@@ -122,7 +122,7 @@
<!-- checkbox for enabling weight skin debug mode -->
<div style="display: flex; flex-direction: row">
- <input type="checkbox" id="debug-skinning-checkbox" checked >
+ <input type="checkbox" id="debug-skinning-checkbox" >
<label for="debug-skinning-checkbox">Debug Skinning</label>
</div>
diff --git a/src/lib/processes/StepAnimationsListing.ts b/src/lib/processes/StepAnimationsListing.ts
index b964d61..0ce9bf1 100644
--- a/src/lib/processes/StepAnimationsListing.ts
+++ b/src/lib/processes/StepAnimationsListing.ts
@@ -292,10 +292,13 @@ export class StepAnimationsListing extends EventTarget
{
track.name = MixamoToSimpleMapping[mixamo_bone_name] + '.' + keyframe_type;
-
- // TODO: if track is a position track, we need to scale everything based off
- // how much we imported the model at. Otherwise the position movement will be multiplied
-
+ // if we are a position track, we need to set to divide by 100
+ if(keyframe_type === 'position')
+ {
+ (track.values as Float32Array).forEach((value, index) => {
+ track.values[index] = value / 200
+ })
+ }
}
})
@@ -381,7 +384,7 @@ export class StepAnimationsListing extends EventTarget
return new AnimationClip(animation_clip.name, animation_clip.duration, filteredTracks);
});
- return filtered_tracks
+ return animation_clips
}
private deep_clone_animation_clips(animation_clips)