David Catuhe 7 年之前
父节点
当前提交
6240058161

文件差异内容过多而无法显示
+ 10445 - 10414
Playground/babylon.d.txt


文件差异内容过多而无法显示
+ 18186 - 18156
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 25 - 25
dist/preview release/babylon.js


+ 40 - 5
dist/preview release/babylon.max.js

@@ -46304,6 +46304,33 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    /**
+     * Class used to override all child animations of a given target
+     */
+    var AnimationPropertiesOverride = /** @class */ (function () {
+        function AnimationPropertiesOverride() {
+            /**
+             * Gets or sets a value indicating if animation blending must be used
+             */
+            this.enableBlending = false;
+            /**
+             * Gets or sets the blending speed to use when enableBlending is true
+             */
+            this.blendingSpeed = 0.01;
+            /**
+             * Gets or sets the default loop mode to use
+             */
+            this.loopMode = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
+        }
+        return AnimationPropertiesOverride;
+    }());
+    BABYLON.AnimationPropertiesOverride = AnimationPropertiesOverride;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.animationPropertiesOverride.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var AnimationRange = /** @class */ (function () {
     var AnimationRange = /** @class */ (function () {
         function AnimationRange(name, from, to) {
         function AnimationRange(name, from, to) {
             this.name = name;
             this.name = name;
@@ -47337,7 +47364,9 @@ var BABYLON;
                 destination = this._target;
                 destination = this._target;
             }
             }
             // Blending
             // Blending
-            if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
+            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+            if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                 if (!this._originalBlendValue) {
                     if (destination[path].clone) {
                     if (destination[path].clone) {
                         this._originalBlendValue = destination[path].clone();
                         this._originalBlendValue = destination[path].clone();
@@ -47360,7 +47389,7 @@ var BABYLON;
                 else {
                 else {
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                 }
                 }
-                this._blendingFactor += this._animation.blendingSpeed;
+                this._blendingFactor += blendingSpeed;
             }
             }
             else {
             else {
                 destination[path] = currentValue;
                 destination[path] = currentValue;
@@ -47369,6 +47398,12 @@ var BABYLON;
                 this._target.markAsDirty(this._animation.targetProperty);
                 this._target.markAsDirty(this._animation.targetProperty);
             }
             }
         };
         };
+        RuntimeAnimation.prototype._getCorrectLoopMode = function () {
+            if (this._target && this._target.animationPropertiesOverride) {
+                return this._target.loopMode;
+            }
+            return this._animation.loopMode;
+        };
         RuntimeAnimation.prototype.goToFrame = function (frame) {
         RuntimeAnimation.prototype.goToFrame = function (frame) {
             var keys = this._animation.getKeys();
             var keys = this._animation.getKeys();
             if (frame < keys[0].frame) {
             if (frame < keys[0].frame) {
@@ -47377,7 +47412,7 @@ var BABYLON;
             else if (frame > keys[keys.length - 1].frame) {
             else if (frame > keys[keys.length - 1].frame) {
                 frame = keys[keys.length - 1].frame;
                 frame = keys[keys.length - 1].frame;
             }
             }
-            var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
+            var currentValue = this._interpolate(frame, 0, this._getCorrectLoopMode());
             this.setValue(currentValue);
             this.setValue(currentValue);
         };
         };
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
@@ -47428,7 +47463,7 @@ var BABYLON;
             }
             }
             else {
             else {
                 // Get max value if required
                 // Get max value if required
-                if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
+                if (this._getCorrectLoopMode() !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
                     var keyOffset = to.toString() + from.toString();
                     var keyOffset = to.toString() + from.toString();
                     if (!this._offsetsCache[keyOffset]) {
                     if (!this._offsetsCache[keyOffset]) {
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
@@ -47493,7 +47528,7 @@ var BABYLON;
             // Compute value
             // Compute value
             var repeatCount = (ratio / range) >> 0;
             var repeatCount = (ratio / range) >> 0;
             var currentFrame = returnValue ? from + ratio % range : to;
             var currentFrame = returnValue ? from + ratio % range : to;
-            var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
+            var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue);
             // Set value
             // Set value
             this.setValue(currentValue);
             this.setValue(currentValue);
             // Check events
             // Check events

文件差异内容过多而无法显示
+ 26 - 26
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 14466 - 14436
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


文件差异内容过多而无法显示
+ 25 - 25
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 40 - 5
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -46304,6 +46304,33 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    /**
+     * Class used to override all child animations of a given target
+     */
+    var AnimationPropertiesOverride = /** @class */ (function () {
+        function AnimationPropertiesOverride() {
+            /**
+             * Gets or sets a value indicating if animation blending must be used
+             */
+            this.enableBlending = false;
+            /**
+             * Gets or sets the blending speed to use when enableBlending is true
+             */
+            this.blendingSpeed = 0.01;
+            /**
+             * Gets or sets the default loop mode to use
+             */
+            this.loopMode = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
+        }
+        return AnimationPropertiesOverride;
+    }());
+    BABYLON.AnimationPropertiesOverride = AnimationPropertiesOverride;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.animationPropertiesOverride.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var AnimationRange = /** @class */ (function () {
     var AnimationRange = /** @class */ (function () {
         function AnimationRange(name, from, to) {
         function AnimationRange(name, from, to) {
             this.name = name;
             this.name = name;
@@ -47337,7 +47364,9 @@ var BABYLON;
                 destination = this._target;
                 destination = this._target;
             }
             }
             // Blending
             // Blending
-            if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
+            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+            if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                 if (!this._originalBlendValue) {
                     if (destination[path].clone) {
                     if (destination[path].clone) {
                         this._originalBlendValue = destination[path].clone();
                         this._originalBlendValue = destination[path].clone();
@@ -47360,7 +47389,7 @@ var BABYLON;
                 else {
                 else {
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                 }
                 }
-                this._blendingFactor += this._animation.blendingSpeed;
+                this._blendingFactor += blendingSpeed;
             }
             }
             else {
             else {
                 destination[path] = currentValue;
                 destination[path] = currentValue;
@@ -47369,6 +47398,12 @@ var BABYLON;
                 this._target.markAsDirty(this._animation.targetProperty);
                 this._target.markAsDirty(this._animation.targetProperty);
             }
             }
         };
         };
+        RuntimeAnimation.prototype._getCorrectLoopMode = function () {
+            if (this._target && this._target.animationPropertiesOverride) {
+                return this._target.loopMode;
+            }
+            return this._animation.loopMode;
+        };
         RuntimeAnimation.prototype.goToFrame = function (frame) {
         RuntimeAnimation.prototype.goToFrame = function (frame) {
             var keys = this._animation.getKeys();
             var keys = this._animation.getKeys();
             if (frame < keys[0].frame) {
             if (frame < keys[0].frame) {
@@ -47377,7 +47412,7 @@ var BABYLON;
             else if (frame > keys[keys.length - 1].frame) {
             else if (frame > keys[keys.length - 1].frame) {
                 frame = keys[keys.length - 1].frame;
                 frame = keys[keys.length - 1].frame;
             }
             }
-            var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
+            var currentValue = this._interpolate(frame, 0, this._getCorrectLoopMode());
             this.setValue(currentValue);
             this.setValue(currentValue);
         };
         };
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
@@ -47428,7 +47463,7 @@ var BABYLON;
             }
             }
             else {
             else {
                 // Get max value if required
                 // Get max value if required
-                if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
+                if (this._getCorrectLoopMode() !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
                     var keyOffset = to.toString() + from.toString();
                     var keyOffset = to.toString() + from.toString();
                     if (!this._offsetsCache[keyOffset]) {
                     if (!this._offsetsCache[keyOffset]) {
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
@@ -47493,7 +47528,7 @@ var BABYLON;
             // Compute value
             // Compute value
             var repeatCount = (ratio / range) >> 0;
             var repeatCount = (ratio / range) >> 0;
             var currentFrame = returnValue ? from + ratio % range : to;
             var currentFrame = returnValue ? from + ratio % range : to;
-            var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
+            var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue);
             // Set value
             // Set value
             this.setValue(currentValue);
             this.setValue(currentValue);
             // Check events
             // Check events

文件差异内容过多而无法显示
+ 42 - 7
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


文件差异内容过多而无法显示
+ 42 - 7
dist/preview release/es6.js


+ 1 - 0
dist/preview release/gui/babylon.gui.d.ts

@@ -187,6 +187,7 @@ declare module BABYLON.GUI {
         private _transformMatrix;
         private _transformMatrix;
         protected _invertTransformMatrix: Matrix2D;
         protected _invertTransformMatrix: Matrix2D;
         protected _transformedPosition: Vector2;
         protected _transformedPosition: Vector2;
+        private _onlyMeasureMode;
         private _isMatrixDirty;
         private _isMatrixDirty;
         private _cachedOffsetX;
         private _cachedOffsetX;
         private _cachedOffsetY;
         private _cachedOffsetY;

+ 15 - 3
dist/preview release/gui/babylon.gui.js

@@ -377,8 +377,8 @@ var BABYLON;
                 var engine = scene.getEngine();
                 var engine = scene.getEngine();
                 var textureSize = this.getSize();
                 var textureSize = this.getSize();
                 if (this._isFullscreen) {
                 if (this._isFullscreen) {
-                    x = x * ((textureSize.width / this._renderScale) / engine.getRenderWidth());
-                    y = y * ((textureSize.height / this._renderScale) / engine.getRenderHeight());
+                    x = x * (textureSize.width / engine.getRenderWidth());
+                    y = y * (textureSize.height / engine.getRenderHeight());
                 }
                 }
                 if (this._capturingControl[pointerId]) {
                 if (this._capturingControl[pointerId]) {
                     this._capturingControl[pointerId]._processObservables(type, x, y, pointerId, buttonIndex);
                     this._capturingControl[pointerId]._processObservables(type, x, y, pointerId, buttonIndex);
@@ -888,6 +888,7 @@ var BABYLON;
                 this._transformMatrix = GUI.Matrix2D.Identity();
                 this._transformMatrix = GUI.Matrix2D.Identity();
                 this._invertTransformMatrix = GUI.Matrix2D.Identity();
                 this._invertTransformMatrix = GUI.Matrix2D.Identity();
                 this._transformedPosition = BABYLON.Vector2.Zero();
                 this._transformedPosition = BABYLON.Vector2.Zero();
+                this._onlyMeasureMode = false;
                 this._isMatrixDirty = true;
                 this._isMatrixDirty = true;
                 this._isVisible = true;
                 this._isVisible = true;
                 this._fontSet = false;
                 this._fontSet = false;
@@ -1450,7 +1451,9 @@ var BABYLON;
             };
             };
             Control.prototype.linkWithMesh = function (mesh) {
             Control.prototype.linkWithMesh = function (mesh) {
                 if (!this._host || this._root && this._root !== this._host._rootContainer) {
                 if (!this._host || this._root && this._root !== this._host._rootContainer) {
-                    BABYLON.Tools.Error("Cannot link a control to a mesh if the control is not at root level");
+                    if (mesh) {
+                        BABYLON.Tools.Error("Cannot link a control to a mesh if the control is not at root level");
+                    }
                     return;
                     return;
                 }
                 }
                 var index = this._host._linkedControls.indexOf(this);
                 var index = this._host._linkedControls.indexOf(this);
@@ -1461,9 +1464,13 @@ var BABYLON;
                     }
                     }
                     return;
                     return;
                 }
                 }
+                else if (!mesh) {
+                    return;
+                }
                 this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
                 this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
                 this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
                 this.verticalAlignment = BABYLON.GUI.Control.VERTICAL_ALIGNMENT_TOP;
                 this._linkedMesh = mesh;
                 this._linkedMesh = mesh;
+                this._onlyMeasureMode = true;
                 this._host._linkedControls.push(this);
                 this._host._linkedControls.push(this);
             };
             };
             Control.prototype._moveToProjectedPosition = function (projectedPosition) {
             Control.prototype._moveToProjectedPosition = function (projectedPosition) {
@@ -1565,6 +1572,10 @@ var BABYLON;
                 }
                 }
                 // Transform
                 // Transform
                 this._transform(context);
                 this._transform(context);
+                if (this._onlyMeasureMode) {
+                    this._onlyMeasureMode = false;
+                    return false; // We do not want rendering for this frame as they are measure dependant information that need to be gathered
+                }
                 // Clip
                 // Clip
                 this._clip(context);
                 this._clip(context);
                 context.clip();
                 context.clip();
@@ -2029,6 +2040,7 @@ var BABYLON;
                     this._children.splice(index, 1);
                     this._children.splice(index, 1);
                     control.parent = null;
                     control.parent = null;
                 }
                 }
+                control.linkWithMesh(null);
                 this._markAsDirty();
                 this._markAsDirty();
                 return this;
                 return this;
             };
             };

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 1 - 0
dist/preview release/gui/babylon.gui.module.d.ts

@@ -193,6 +193,7 @@ declare module BABYLON.GUI {
         private _transformMatrix;
         private _transformMatrix;
         protected _invertTransformMatrix: Matrix2D;
         protected _invertTransformMatrix: Matrix2D;
         protected _transformedPosition: Vector2;
         protected _transformedPosition: Vector2;
+        private _onlyMeasureMode;
         private _isMatrixDirty;
         private _isMatrixDirty;
         private _cachedOffsetX;
         private _cachedOffsetX;
         private _cachedOffsetY;
         private _cachedOffsetY;

文件差异内容过多而无法显示
+ 25 - 25
dist/preview release/viewer/babylon.viewer.js


+ 40 - 5
dist/preview release/viewer/babylon.viewer.max.js

@@ -46387,6 +46387,33 @@ var BABYLON;
 
 
 var BABYLON;
 var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
+    /**
+     * Class used to override all child animations of a given target
+     */
+    var AnimationPropertiesOverride = /** @class */ (function () {
+        function AnimationPropertiesOverride() {
+            /**
+             * Gets or sets a value indicating if animation blending must be used
+             */
+            this.enableBlending = false;
+            /**
+             * Gets or sets the blending speed to use when enableBlending is true
+             */
+            this.blendingSpeed = 0.01;
+            /**
+             * Gets or sets the default loop mode to use
+             */
+            this.loopMode = BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE;
+        }
+        return AnimationPropertiesOverride;
+    }());
+    BABYLON.AnimationPropertiesOverride = AnimationPropertiesOverride;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.animationPropertiesOverride.js.map
+
+var BABYLON;
+(function (BABYLON) {
     var AnimationRange = /** @class */ (function () {
     var AnimationRange = /** @class */ (function () {
         function AnimationRange(name, from, to) {
         function AnimationRange(name, from, to) {
             this.name = name;
             this.name = name;
@@ -47420,7 +47447,9 @@ var BABYLON;
                 destination = this._target;
                 destination = this._target;
             }
             }
             // Blending
             // Blending
-            if (this._animation.enableBlending && this._blendingFactor <= 1.0) {
+            var enableBlending = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.enableBlending : this._animation.enableBlending;
+            var blendingSpeed = this._target && this._target.animationPropertiesOverride ? this._target.animationPropertiesOverride.blendingSpeed : this._animation.blendingSpeed;
+            if (enableBlending && this._blendingFactor <= 1.0) {
                 if (!this._originalBlendValue) {
                 if (!this._originalBlendValue) {
                     if (destination[path].clone) {
                     if (destination[path].clone) {
                         this._originalBlendValue = destination[path].clone();
                         this._originalBlendValue = destination[path].clone();
@@ -47443,7 +47472,7 @@ var BABYLON;
                 else {
                 else {
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                     destination[path] = this._originalBlendValue * (1.0 - this._blendingFactor) + this._blendingFactor * currentValue;
                 }
                 }
-                this._blendingFactor += this._animation.blendingSpeed;
+                this._blendingFactor += blendingSpeed;
             }
             }
             else {
             else {
                 destination[path] = currentValue;
                 destination[path] = currentValue;
@@ -47452,6 +47481,12 @@ var BABYLON;
                 this._target.markAsDirty(this._animation.targetProperty);
                 this._target.markAsDirty(this._animation.targetProperty);
             }
             }
         };
         };
+        RuntimeAnimation.prototype._getCorrectLoopMode = function () {
+            if (this._target && this._target.animationPropertiesOverride) {
+                return this._target.loopMode;
+            }
+            return this._animation.loopMode;
+        };
         RuntimeAnimation.prototype.goToFrame = function (frame) {
         RuntimeAnimation.prototype.goToFrame = function (frame) {
             var keys = this._animation.getKeys();
             var keys = this._animation.getKeys();
             if (frame < keys[0].frame) {
             if (frame < keys[0].frame) {
@@ -47460,7 +47495,7 @@ var BABYLON;
             else if (frame > keys[keys.length - 1].frame) {
             else if (frame > keys[keys.length - 1].frame) {
                 frame = keys[keys.length - 1].frame;
                 frame = keys[keys.length - 1].frame;
             }
             }
-            var currentValue = this._interpolate(frame, 0, this._animation.loopMode);
+            var currentValue = this._interpolate(frame, 0, this._getCorrectLoopMode());
             this.setValue(currentValue);
             this.setValue(currentValue);
         };
         };
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
         RuntimeAnimation.prototype._prepareForSpeedRatioChange = function (newSpeedRatio) {
@@ -47511,7 +47546,7 @@ var BABYLON;
             }
             }
             else {
             else {
                 // Get max value if required
                 // Get max value if required
-                if (this._animation.loopMode !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
+                if (this._getCorrectLoopMode() !== BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE) {
                     var keyOffset = to.toString() + from.toString();
                     var keyOffset = to.toString() + from.toString();
                     if (!this._offsetsCache[keyOffset]) {
                     if (!this._offsetsCache[keyOffset]) {
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
                         var fromValue = this._interpolate(from, 0, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
@@ -47576,7 +47611,7 @@ var BABYLON;
             // Compute value
             // Compute value
             var repeatCount = (ratio / range) >> 0;
             var repeatCount = (ratio / range) >> 0;
             var currentFrame = returnValue ? from + ratio % range : to;
             var currentFrame = returnValue ? from + ratio % range : to;
-            var currentValue = this._interpolate(currentFrame, repeatCount, this._animation.loopMode, offsetValue, highLimitValue);
+            var currentValue = this._interpolate(currentFrame, repeatCount, this._getCorrectLoopMode(), offsetValue, highLimitValue);
             // Set value
             // Set value
             this.setValue(currentValue);
             this.setValue(currentValue);
             // Check events
             // Check events

+ 2 - 2
gui/src/advancedDynamicTexture.ts

@@ -396,8 +396,8 @@ module BABYLON.GUI {
             var textureSize = this.getSize();
             var textureSize = this.getSize();
 
 
             if (this._isFullscreen) {
             if (this._isFullscreen) {
-                x = x * ((textureSize.width / this._renderScale) / engine.getRenderWidth());
-                y = y * ((textureSize.height / this._renderScale) / engine.getRenderHeight());
+                x = x * (textureSize.width / engine.getRenderWidth());
+                y = y * (textureSize.height / engine.getRenderHeight());
             }
             }
 
 
             if (this._capturingControl[pointerId]) {
             if (this._capturingControl[pointerId]) {

+ 5 - 1
gui/src/controls/control.ts

@@ -552,7 +552,9 @@ module BABYLON.GUI {
 
 
         public linkWithMesh(mesh: Nullable<AbstractMesh>): void {
         public linkWithMesh(mesh: Nullable<AbstractMesh>): void {
             if (!this._host || this._root && this._root !== this._host._rootContainer) {
             if (!this._host || this._root && this._root !== this._host._rootContainer) {
-                Tools.Error("Cannot link a control to a mesh if the control is not at root level");
+                if (mesh) {
+                    Tools.Error("Cannot link a control to a mesh if the control is not at root level");
+                }
                 return;
                 return;
             }
             }
 
 
@@ -563,6 +565,8 @@ module BABYLON.GUI {
                     this._host._linkedControls.splice(index, 1);
                     this._host._linkedControls.splice(index, 1);
                 }
                 }
                 return;
                 return;
+            } else if (!mesh) {
+                return;
             }
             }
 
 
             this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;
             this.horizontalAlignment = BABYLON.GUI.Control.HORIZONTAL_ALIGNMENT_LEFT;

二进制
tests/validation/ReferenceImages/advancedShadows.png


+ 1 - 0
tests/validation/config.json

@@ -150,6 +150,7 @@
     },
     },
     {
     {
       "title": "Advanced shadows",
       "title": "Advanced shadows",
+      "renderCount": 2,
       "scriptToRun": "/Demos/AdvancedShadows/advancedShadows.js",
       "scriptToRun": "/Demos/AdvancedShadows/advancedShadows.js",
       "functionToCall": "CreateAdvancedShadowsTestScene",
       "functionToCall": "CreateAdvancedShadowsTestScene",
       "referenceImage": "advancedShadows.png",
       "referenceImage": "advancedShadows.png",