Selaa lähdekoodia

Fix bug when an animation was cloned before setting its keys.

Temechon 10 vuotta sitten
vanhempi
commit
47d6ab115f
2 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 3 1
      src/Animations/babylon.animation.js
  2. 3 2
      src/Animations/babylon.animation.ts

+ 3 - 1
src/Animations/babylon.animation.js

@@ -96,7 +96,9 @@ var BABYLON;
         };
         Animation.prototype.clone = function () {
             var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
-            clone.setKeys(this._keys);
+            if (this._keys) {
+                clone.setKeys(this._keys);
+            }
             return clone;
         };
         Animation.prototype.setKeys = function (values) {

+ 3 - 2
src/Animations/babylon.animation.ts

@@ -122,8 +122,9 @@
 
         public clone(): Animation {
             var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
-
-            clone.setKeys(this._keys);
+            if (this._keys) {
+                clone.setKeys(this._keys);
+            }
 
             return clone;
         }