소스 검색

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

Temechon 10 년 전
부모
커밋
47d6ab115f
2개의 변경된 파일6개의 추가작업 그리고 3개의 파일을 삭제
  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 () {
         Animation.prototype.clone = function () {
             var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
             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;
             return clone;
         };
         };
         Animation.prototype.setKeys = function (values) {
         Animation.prototype.setKeys = function (values) {

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

@@ -122,8 +122,9 @@
 
 
         public clone(): Animation {
         public clone(): Animation {
             var clone = new Animation(this.name, this.targetPropertyPath.join("."), this.framePerSecond, this.dataType, this.loopMode);
             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;
             return clone;
         }
         }