From aab79b3d3202ed092c848567ec7f94b8bfa9d0eb Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Wed, 28 Oct 2020 22:09:16 +0100 Subject: [PATCH] Fix issue with keyframe order in bedrock exports --- js/animations/animation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/animations/animation.js b/js/animations/animation.js index c144c571..b2850dc9 100644 --- a/js/animations/animation.js +++ b/js/animations/animation.js @@ -171,11 +171,11 @@ class Animation { bone_tag[channel] = channels[channel][timecodes[0]][0]; } } else { - timecodes.sort().forEach((time) => { + timecodes.sort((a, b) => parseFloat(a) - parseFloat(b)).forEach((timecode) => { if (!bone_tag[channel]) { bone_tag[channel] = {} } - bone_tag[channel][time] = channels[channel][time] + bone_tag[channel][timecode] = channels[channel][timecode]; }) } }