Improve export for non-linear keyframes

This commit is contained in:
JannisX11 2021-01-11 14:46:48 +01:00
parent 431e3462a9
commit 97df68f2d5
2 changed files with 3 additions and 10 deletions

View File

@ -1421,7 +1421,7 @@ const Animator = {
if (source.pre) {
points.push(getKeyframeDataPoints(source.pre)[0])
}
if (source.post) {
if (source.post && !(source.pre instanceof Array && source.post instanceof Array && source.post.equals(source.pre))) {
points.push(getKeyframeDataPoints(source.post)[0])
}
return points;

View File

@ -220,15 +220,8 @@ class Keyframe {
}
compileBedrockKeyframe() {
if (this.transform) {
if (this.data_points.length == 1) {
if (this.interpolation == 'linear') {
return this.getArray();
} else {
return {
post: this.getArray(),
lerp_mode: this.interpolation,
}
}
if (this.data_points.length == 1 && this.interpolation == 'linear') {
return this.getArray();
} else {
return {
pre: this.getArray(0),