浏览代码

Adding markAsDirty on actions

David Catuhe 9 年之前
父节点
当前提交
6d857752e4
共有 2 个文件被更改,包括 16 次插入9 次删除
  1. 8 0
      src/Actions/babylon.directActions.ts
  2. 8 9
      src/Animations/babylon.animation.ts

+ 8 - 0
src/Actions/babylon.directActions.ts

@@ -69,6 +69,10 @@
 
 
         public execute(): void {
         public execute(): void {
             this._effectiveTarget[this._property] = this.value;
             this._effectiveTarget[this._property] = this.value;
+
+            if (this._target.markAsDirty) {
+                this._target.markAsDirty(this._property);
+            }
         }
         }
         
         
         public serialize(parent: any): any {
         public serialize(parent: any): any {
@@ -104,6 +108,10 @@
 
 
         public execute(): void {
         public execute(): void {
             this._effectiveTarget[this._property] += this.value;
             this._effectiveTarget[this._property] += this.value;
+
+            if (this._target.markAsDirty) {
+                this._target.markAsDirty(this._property);
+            }
         }
         }
         
         
         public serialize(parent: any): any {
         public serialize(parent: any): any {

+ 8 - 9
src/Animations/babylon.animation.ts

@@ -468,16 +468,15 @@
                 destination = this._target;
                 destination = this._target;
             }
             }
 
 
-            if (!this._originalBlendValue) {
-                if (destination[path].clone) {
-                    this._originalBlendValue = destination[path].clone();
-                } else {
-                    this._originalBlendValue = destination[path];
-                }
-            }
-
             // Blending
             // Blending
             if (this.enableBlending && this._blendingFactor <= 1.0) {
             if (this.enableBlending && this._blendingFactor <= 1.0) {
+                if (!this._originalBlendValue) {
+                    if (destination[path].clone) {
+                        this._originalBlendValue = destination[path].clone();
+                    } else {
+                        this._originalBlendValue = destination[path];
+                    }
+                }
 
 
                 if (this._originalBlendValue.prototype) { // Complex value
                 if (this._originalBlendValue.prototype) { // Complex value
                     
                     
@@ -498,7 +497,7 @@
             }
             }
 
 
             if (this._target.markAsDirty) {
             if (this._target.markAsDirty) {
-                this._target.markAsDirty(this.targetProperty, this._originalBlendValue);
+                this._target.markAsDirty(this.targetProperty);
             }
             }
         }
         }