|
@@ -347,8 +347,9 @@ Object.assign( KeyframeTrack.prototype, {
|
|
|
// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
|
|
|
optimize: function () {
|
|
|
|
|
|
- var times = this.times,
|
|
|
- values = this.values,
|
|
|
+ // times or values may be shared with other tracks, so overwriting is unsafe
|
|
|
+ var times = AnimationUtils.arraySlice( this.times ),
|
|
|
+ values = AnimationUtils.arraySlice( this.values ),
|
|
|
stride = this.getValueSize(),
|
|
|
|
|
|
smoothInterpolation = this.getInterpolation() === InterpolateSmooth,
|
|
@@ -443,6 +444,11 @@ Object.assign( KeyframeTrack.prototype, {
|
|
|
this.times = AnimationUtils.arraySlice( times, 0, writeIndex );
|
|
|
this.values = AnimationUtils.arraySlice( values, 0, writeIndex * stride );
|
|
|
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.times = times;
|
|
|
+ this.values = values;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return this;
|