Fix keyframe rounding issue
This commit is contained in:
parent
d1684d8fb3
commit
8c4e191e63
@ -816,7 +816,7 @@ class BoneAnimator extends GeneralAnimator {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
fillValues(keyframe, values, allow_expression) {
|
||||
fillValues(keyframe, values, allow_expression, round = true) {
|
||||
|
||||
if (values instanceof Array) {
|
||||
keyframe.extend({
|
||||
@ -840,12 +840,14 @@ class BoneAnimator extends GeneralAnimator {
|
||||
var ref = this.interpolate(keyframe.channel, allow_expression)
|
||||
Timeline.time = original_time;
|
||||
if (ref) {
|
||||
let e = 1e2
|
||||
ref.forEach((r, i) => {
|
||||
if (!isNaN(r)) {
|
||||
ref[i] = Math.round(parseFloat(r)*e)/e
|
||||
}
|
||||
})
|
||||
if (round) {
|
||||
let e = keyframe.channel == 'scale' ? 1e4 : 1e2
|
||||
ref.forEach((r, i) => {
|
||||
if (!isNaN(r)) {
|
||||
ref[i] = Math.round(parseFloat(r)*e)/e
|
||||
}
|
||||
})
|
||||
}
|
||||
keyframe.extend({
|
||||
data_points: [{
|
||||
x: ref[0],
|
||||
|
@ -652,7 +652,7 @@ BARS.defineActions(function() {
|
||||
Timeline.selected.forEach((kf) => {
|
||||
if (kf.animator.fillValues) {
|
||||
Timeline.time = kf.time;
|
||||
kf.animator.fillValues(kf, null, false);
|
||||
kf.animator.fillValues(kf, null, false, false);
|
||||
}
|
||||
})
|
||||
Timeline.time = time_before;
|
||||
|
Loading…
x
Reference in New Issue
Block a user