Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Stop any currently playing animations in the listing if we go back to bone mapping

Scott Petrovic384c738ca125
diff --git a/src/retarget/RetargetAnimationListing.ts b/src/retarget/RetargetAnimationListing.ts
index 92334fc..c10c110 100644
--- a/src/retarget/RetargetAnimationListing.ts
+++ b/src/retarget/RetargetAnimationListing.ts
@@ -65,6 +65,16 @@ export class RetargetAnimationListing extends EventTarget {
public stop_preview (): void {
this.is_animations_active = false
+
+ // Stop all active animations in the mixer
+ // this is really important if we go back to the bone mapping
+ // this makes sure to stop any running animations in listing
+ if (this.animation_mixer !== null) {
+ this.animation_mixer.stopAllAction()
+ }
+
+ // Clear the animation player UI
+ this.animation_player.clear_animation()
}
public load_and_apply_default_animation_to_skinned_mesh (): void {