瀏覽代碼

Better animationPropertiesOverride support

David Catuhe 7 年之前
父節點
當前提交
a3ebcd5d54

File diff suppressed because it is too large
+ 5199 - 5194
Playground/babylon.d.txt


File diff suppressed because it is too large
+ 12791 - 12786
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 20 - 20
dist/preview release/babylon.js


+ 74 - 25
dist/preview release/babylon.max.js

@@ -15409,6 +15409,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
             * @type {BABYLON.Observable}
@@ -15460,6 +15461,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string
@@ -59459,41 +59473,66 @@ var BABYLON;
                     exact: constraints.deviceId,
                 };
             }
-            navigator.getUserMedia =
-                navigator.getUserMedia ||
-                    navigator.webkitGetUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.msGetUserMedia;
             window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-            if (navigator.getUserMedia) {
-                navigator.getUserMedia({
-                    video: {
-                        deviceId: constraintsDeviceId,
-                        width: {
-                            min: (constraints && constraints.minWidth) || 256,
-                            max: (constraints && constraints.maxWidth) || 640,
-                        },
-                        height: {
-                            min: (constraints && constraints.minHeight) || 256,
-                            max: (constraints && constraints.maxHeight) || 480,
-                        },
-                    },
-                }, function (stream) {
+            if (navigator.mediaDevices) {
+                navigator.mediaDevices.getUserMedia({ video: constraints })
+                    .then(function (stream) {
                     if (video.mozSrcObject !== undefined) {
                         // hack for Firefox < 19
                         video.mozSrcObject = stream;
                     }
                     else {
-                        video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        video.srcObject = stream;
                     }
+                    var onPlaying = function () {
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                        video.removeEventListener("playing", onPlaying);
+                    };
+                    video.addEventListener("playing", onPlaying);
                     video.play();
-                    if (onReady) {
-                        onReady(new VideoTexture("video", video, scene, true, true));
-                    }
-                }, function (e) {
-                    BABYLON.Tools.Error(e.name);
+                })
+                    .catch(function (err) {
+                    BABYLON.Tools.Error(err.name);
                 });
             }
+            else {
+                navigator.getUserMedia =
+                    navigator.getUserMedia ||
+                        navigator.webkitGetUserMedia ||
+                        navigator.mozGetUserMedia ||
+                        navigator.msGetUserMedia;
+                if (navigator.getUserMedia) {
+                    navigator.getUserMedia({
+                        video: {
+                            deviceId: constraintsDeviceId,
+                            width: {
+                                min: (constraints && constraints.minWidth) || 256,
+                                max: (constraints && constraints.maxWidth) || 640,
+                            },
+                            height: {
+                                min: (constraints && constraints.minHeight) || 256,
+                                max: (constraints && constraints.maxHeight) || 480,
+                            },
+                        },
+                    }, function (stream) {
+                        if (video.mozSrcObject !== undefined) {
+                            // hack for Firefox < 19
+                            video.mozSrcObject = stream;
+                        }
+                        else {
+                            video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        }
+                        video.play();
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                    }, function (e) {
+                        BABYLON.Tools.Error(e.name);
+                    });
+                }
+            }
         };
         return VideoTexture;
     }(BABYLON.Texture));
@@ -71185,6 +71224,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Bone.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets the animation properties override
+             */
+            get: function () {
+                return this._skeleton.animationPropertiesOverride;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) {
             if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; }

File diff suppressed because it is too large
+ 20 - 20
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 18178 - 18173
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff suppressed because it is too large
+ 22 - 22
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 88 - 31
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -15409,6 +15409,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
             * @type {BABYLON.Observable}
@@ -15460,6 +15461,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string
@@ -58770,41 +58784,66 @@ var BABYLON;
                     exact: constraints.deviceId,
                 };
             }
-            navigator.getUserMedia =
-                navigator.getUserMedia ||
-                    navigator.webkitGetUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.msGetUserMedia;
             window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-            if (navigator.getUserMedia) {
-                navigator.getUserMedia({
-                    video: {
-                        deviceId: constraintsDeviceId,
-                        width: {
-                            min: (constraints && constraints.minWidth) || 256,
-                            max: (constraints && constraints.maxWidth) || 640,
-                        },
-                        height: {
-                            min: (constraints && constraints.minHeight) || 256,
-                            max: (constraints && constraints.maxHeight) || 480,
-                        },
-                    },
-                }, function (stream) {
+            if (navigator.mediaDevices) {
+                navigator.mediaDevices.getUserMedia({ video: constraints })
+                    .then(function (stream) {
                     if (video.mozSrcObject !== undefined) {
                         // hack for Firefox < 19
                         video.mozSrcObject = stream;
                     }
                     else {
-                        video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        video.srcObject = stream;
                     }
+                    var onPlaying = function () {
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                        video.removeEventListener("playing", onPlaying);
+                    };
+                    video.addEventListener("playing", onPlaying);
                     video.play();
-                    if (onReady) {
-                        onReady(new VideoTexture("video", video, scene, true, true));
-                    }
-                }, function (e) {
-                    BABYLON.Tools.Error(e.name);
+                })
+                    .catch(function (err) {
+                    BABYLON.Tools.Error(err.name);
                 });
             }
+            else {
+                navigator.getUserMedia =
+                    navigator.getUserMedia ||
+                        navigator.webkitGetUserMedia ||
+                        navigator.mozGetUserMedia ||
+                        navigator.msGetUserMedia;
+                if (navigator.getUserMedia) {
+                    navigator.getUserMedia({
+                        video: {
+                            deviceId: constraintsDeviceId,
+                            width: {
+                                min: (constraints && constraints.minWidth) || 256,
+                                max: (constraints && constraints.maxWidth) || 640,
+                            },
+                            height: {
+                                min: (constraints && constraints.minHeight) || 256,
+                                max: (constraints && constraints.maxHeight) || 480,
+                            },
+                        },
+                    }, function (stream) {
+                        if (video.mozSrcObject !== undefined) {
+                            // hack for Firefox < 19
+                            video.mozSrcObject = stream;
+                        }
+                        else {
+                            video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        }
+                        video.play();
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                    }, function (e) {
+                        BABYLON.Tools.Error(e.name);
+                    });
+                }
+            }
         };
         return VideoTexture;
     }(BABYLON.Texture));
@@ -70446,6 +70485,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Bone.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets the animation properties override
+             */
+            get: function () {
+                return this._skeleton.animationPropertiesOverride;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) {
             if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; }
@@ -94351,7 +94400,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -94360,8 +94411,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -94391,13 +94444,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

+ 88 - 31
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js

@@ -15382,6 +15382,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
             * @type {BABYLON.Observable}
@@ -15433,6 +15434,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string
@@ -58743,41 +58757,66 @@ var BABYLON;
                     exact: constraints.deviceId,
                 };
             }
-            navigator.getUserMedia =
-                navigator.getUserMedia ||
-                    navigator.webkitGetUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.msGetUserMedia;
             window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-            if (navigator.getUserMedia) {
-                navigator.getUserMedia({
-                    video: {
-                        deviceId: constraintsDeviceId,
-                        width: {
-                            min: (constraints && constraints.minWidth) || 256,
-                            max: (constraints && constraints.maxWidth) || 640,
-                        },
-                        height: {
-                            min: (constraints && constraints.minHeight) || 256,
-                            max: (constraints && constraints.maxHeight) || 480,
-                        },
-                    },
-                }, function (stream) {
+            if (navigator.mediaDevices) {
+                navigator.mediaDevices.getUserMedia({ video: constraints })
+                    .then(function (stream) {
                     if (video.mozSrcObject !== undefined) {
                         // hack for Firefox < 19
                         video.mozSrcObject = stream;
                     }
                     else {
-                        video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        video.srcObject = stream;
                     }
+                    var onPlaying = function () {
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                        video.removeEventListener("playing", onPlaying);
+                    };
+                    video.addEventListener("playing", onPlaying);
                     video.play();
-                    if (onReady) {
-                        onReady(new VideoTexture("video", video, scene, true, true));
-                    }
-                }, function (e) {
-                    BABYLON.Tools.Error(e.name);
+                })
+                    .catch(function (err) {
+                    BABYLON.Tools.Error(err.name);
                 });
             }
+            else {
+                navigator.getUserMedia =
+                    navigator.getUserMedia ||
+                        navigator.webkitGetUserMedia ||
+                        navigator.mozGetUserMedia ||
+                        navigator.msGetUserMedia;
+                if (navigator.getUserMedia) {
+                    navigator.getUserMedia({
+                        video: {
+                            deviceId: constraintsDeviceId,
+                            width: {
+                                min: (constraints && constraints.minWidth) || 256,
+                                max: (constraints && constraints.maxWidth) || 640,
+                            },
+                            height: {
+                                min: (constraints && constraints.minHeight) || 256,
+                                max: (constraints && constraints.maxHeight) || 480,
+                            },
+                        },
+                    }, function (stream) {
+                        if (video.mozSrcObject !== undefined) {
+                            // hack for Firefox < 19
+                            video.mozSrcObject = stream;
+                        }
+                        else {
+                            video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        }
+                        video.play();
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                    }, function (e) {
+                        BABYLON.Tools.Error(e.name);
+                    });
+                }
+            }
         };
         return VideoTexture;
     }(BABYLON.Texture));
@@ -70419,6 +70458,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Bone.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets the animation properties override
+             */
+            get: function () {
+                return this._skeleton.animationPropertiesOverride;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) {
             if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; }
@@ -94324,7 +94373,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -94333,8 +94384,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -94364,13 +94417,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

+ 74 - 25
dist/preview release/es6.js

@@ -15382,6 +15382,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
             * @type {BABYLON.Observable}
@@ -15433,6 +15434,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string
@@ -59432,41 +59446,66 @@ var BABYLON;
                     exact: constraints.deviceId,
                 };
             }
-            navigator.getUserMedia =
-                navigator.getUserMedia ||
-                    navigator.webkitGetUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.msGetUserMedia;
             window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-            if (navigator.getUserMedia) {
-                navigator.getUserMedia({
-                    video: {
-                        deviceId: constraintsDeviceId,
-                        width: {
-                            min: (constraints && constraints.minWidth) || 256,
-                            max: (constraints && constraints.maxWidth) || 640,
-                        },
-                        height: {
-                            min: (constraints && constraints.minHeight) || 256,
-                            max: (constraints && constraints.maxHeight) || 480,
-                        },
-                    },
-                }, function (stream) {
+            if (navigator.mediaDevices) {
+                navigator.mediaDevices.getUserMedia({ video: constraints })
+                    .then(function (stream) {
                     if (video.mozSrcObject !== undefined) {
                         // hack for Firefox < 19
                         video.mozSrcObject = stream;
                     }
                     else {
-                        video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        video.srcObject = stream;
                     }
+                    var onPlaying = function () {
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                        video.removeEventListener("playing", onPlaying);
+                    };
+                    video.addEventListener("playing", onPlaying);
                     video.play();
-                    if (onReady) {
-                        onReady(new VideoTexture("video", video, scene, true, true));
-                    }
-                }, function (e) {
-                    BABYLON.Tools.Error(e.name);
+                })
+                    .catch(function (err) {
+                    BABYLON.Tools.Error(err.name);
                 });
             }
+            else {
+                navigator.getUserMedia =
+                    navigator.getUserMedia ||
+                        navigator.webkitGetUserMedia ||
+                        navigator.mozGetUserMedia ||
+                        navigator.msGetUserMedia;
+                if (navigator.getUserMedia) {
+                    navigator.getUserMedia({
+                        video: {
+                            deviceId: constraintsDeviceId,
+                            width: {
+                                min: (constraints && constraints.minWidth) || 256,
+                                max: (constraints && constraints.maxWidth) || 640,
+                            },
+                            height: {
+                                min: (constraints && constraints.minHeight) || 256,
+                                max: (constraints && constraints.maxHeight) || 480,
+                            },
+                        },
+                    }, function (stream) {
+                        if (video.mozSrcObject !== undefined) {
+                            // hack for Firefox < 19
+                            video.mozSrcObject = stream;
+                        }
+                        else {
+                            video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        }
+                        video.play();
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                    }, function (e) {
+                        BABYLON.Tools.Error(e.name);
+                    });
+                }
+            }
         };
         return VideoTexture;
     }(BABYLON.Texture));
@@ -71158,6 +71197,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Bone.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets the animation properties override
+             */
+            get: function () {
+                return this._skeleton.animationPropertiesOverride;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) {
             if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; }

+ 14 - 6
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1963,7 +1963,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -1972,8 +1974,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -2003,13 +2007,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 14 - 6
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -4139,7 +4139,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -4148,8 +4150,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -4179,13 +4183,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

File diff suppressed because it is too large
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 14 - 6
dist/preview release/loaders/babylonjs.loaders.js

@@ -5108,7 +5108,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -5117,8 +5119,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -5148,13 +5152,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


File diff suppressed because it is too large
+ 22 - 22
dist/preview release/viewer/babylon.viewer.js


+ 88 - 31
dist/preview release/viewer/babylon.viewer.max.js

@@ -15492,6 +15492,7 @@ var BABYLON;
             /** @ignore */
             this._currentRenderId = -1;
             this._parentRenderId = -1;
+            this._animationPropertiesOverride = null;
             /**
             * An event triggered when the mesh is disposed
             * @type {BABYLON.Observable}
@@ -15543,6 +15544,19 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Node.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets or sets the animation properties override
+             */
+            get: function () {
+                return this._animationPropertiesOverride;
+            },
+            set: function (value) {
+                this._animationPropertiesOverride = value;
+            },
+            enumerable: true,
+            configurable: true
+        });
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string
@@ -59542,41 +59556,66 @@ var BABYLON;
                     exact: constraints.deviceId,
                 };
             }
-            navigator.getUserMedia =
-                navigator.getUserMedia ||
-                    navigator.webkitGetUserMedia ||
-                    navigator.mozGetUserMedia ||
-                    navigator.msGetUserMedia;
             window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
-            if (navigator.getUserMedia) {
-                navigator.getUserMedia({
-                    video: {
-                        deviceId: constraintsDeviceId,
-                        width: {
-                            min: (constraints && constraints.minWidth) || 256,
-                            max: (constraints && constraints.maxWidth) || 640,
-                        },
-                        height: {
-                            min: (constraints && constraints.minHeight) || 256,
-                            max: (constraints && constraints.maxHeight) || 480,
-                        },
-                    },
-                }, function (stream) {
+            if (navigator.mediaDevices) {
+                navigator.mediaDevices.getUserMedia({ video: constraints })
+                    .then(function (stream) {
                     if (video.mozSrcObject !== undefined) {
                         // hack for Firefox < 19
                         video.mozSrcObject = stream;
                     }
                     else {
-                        video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        video.srcObject = stream;
                     }
+                    var onPlaying = function () {
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                        video.removeEventListener("playing", onPlaying);
+                    };
+                    video.addEventListener("playing", onPlaying);
                     video.play();
-                    if (onReady) {
-                        onReady(new VideoTexture("video", video, scene, true, true));
-                    }
-                }, function (e) {
-                    BABYLON.Tools.Error(e.name);
+                })
+                    .catch(function (err) {
+                    BABYLON.Tools.Error(err.name);
                 });
             }
+            else {
+                navigator.getUserMedia =
+                    navigator.getUserMedia ||
+                        navigator.webkitGetUserMedia ||
+                        navigator.mozGetUserMedia ||
+                        navigator.msGetUserMedia;
+                if (navigator.getUserMedia) {
+                    navigator.getUserMedia({
+                        video: {
+                            deviceId: constraintsDeviceId,
+                            width: {
+                                min: (constraints && constraints.minWidth) || 256,
+                                max: (constraints && constraints.maxWidth) || 640,
+                            },
+                            height: {
+                                min: (constraints && constraints.minHeight) || 256,
+                                max: (constraints && constraints.maxHeight) || 480,
+                            },
+                        },
+                    }, function (stream) {
+                        if (video.mozSrcObject !== undefined) {
+                            // hack for Firefox < 19
+                            video.mozSrcObject = stream;
+                        }
+                        else {
+                            video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
+                        }
+                        video.play();
+                        if (onReady) {
+                            onReady(new VideoTexture("video", video, scene, true, true));
+                        }
+                    }, function (e) {
+                        BABYLON.Tools.Error(e.name);
+                    });
+                }
+            }
         };
         return VideoTexture;
     }(BABYLON.Texture));
@@ -71268,6 +71307,16 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(Bone.prototype, "animationPropertiesOverride", {
+            /**
+             * Gets the animation properties override
+             */
+            get: function () {
+                return this._skeleton.animationPropertiesOverride;
+            },
+            enumerable: true,
+            configurable: true
+        });
         // Methods
         Bone.prototype.updateMatrix = function (matrix, updateDifferenceMatrix) {
             if (updateDifferenceMatrix === void 0) { updateDifferenceMatrix = true; }
@@ -111095,7 +111144,9 @@ var BABYLON;
                             var nodeLOD = nodeLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingNodeLOD = nodeLOD;
-                                _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadNodeSignals[nodeLOD._index]) {
+                                    _this._loadNodeSignals[nodeLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadNodeAsync("#/nodes/" + nodeLOD._index, nodeLOD).then(function () {
                                 if (indexLOD !== 0) {
@@ -111104,8 +111155,10 @@ var BABYLON;
                                 }
                                 if (indexLOD !== nodeLODs.length - 1) {
                                     var nodeIndex = nodeLODs[indexLOD + 1]._index;
-                                    _this._loadNodeSignals[nodeIndex].resolve();
-                                    delete _this._loadNodeSignals[nodeIndex];
+                                    if (_this._loadNodeSignals[nodeIndex]) {
+                                        _this._loadNodeSignals[nodeIndex].resolve();
+                                        delete _this._loadNodeSignals[nodeIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {
@@ -111135,13 +111188,17 @@ var BABYLON;
                             var materialLOD = materialLODs[indexLOD];
                             if (indexLOD !== 0) {
                                 _this._loadingMaterialLOD = materialLOD;
-                                _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                if (!_this._loadMaterialSignals[materialLOD._index]) {
+                                    _this._loadMaterialSignals[materialLOD._index] = new BABYLON.Deferred();
+                                }
                             }
                             var promise = _this._loader._loadMaterialAsync("#/materials/" + materialLOD._index, materialLOD, babylonMesh).then(function () {
                                 if (indexLOD !== materialLODs.length - 1) {
                                     var materialIndex = materialLODs[indexLOD + 1]._index;
-                                    _this._loadMaterialSignals[materialIndex].resolve();
-                                    delete _this._loadMaterialSignals[materialIndex];
+                                    if (_this._loadMaterialSignals[materialIndex]) {
+                                        _this._loadMaterialSignals[materialIndex].resolve();
+                                        delete _this._loadMaterialSignals[materialIndex];
+                                    }
                                 }
                             });
                             if (indexLOD === 0) {

+ 7 - 0
src/Bones/babylon.bone.ts

@@ -147,6 +147,13 @@
         public set scaling(newScaling: Vector3) {
             this.setScale(newScaling.x, newScaling.y, newScaling.z);
         }
+        
+        /**
+         * Gets the animation properties override
+         */
+        public get animationPropertiesOverride(): AnimationPropertiesOverride {
+            return this._skeleton.animationPropertiesOverride;
+        }
 
         // Methods
         public updateMatrix(matrix: Matrix, updateDifferenceMatrix = true): void {

+ 14 - 5
src/babylon.node.ts

@@ -70,11 +70,6 @@
         private _children: Node[];
 
         /**
-         * Gets or sets the animation properties override
-         */
-        public animationPropertiesOverride: AnimationPropertiesOverride;
-
-        /**
          * Gets a boolean indicating if the node has been disposed
          * @returns true if the node was disposed
          */
@@ -114,6 +109,20 @@
             return this._parentNode;
         }
 
+        
+        private _animationPropertiesOverride: Nullable<AnimationPropertiesOverride> = null;
+
+        /**
+         * Gets or sets the animation properties override
+         */
+        public get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride> {
+            return this._animationPropertiesOverride;
+        }
+
+        public set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>) {
+            this._animationPropertiesOverride = value;
+        }
+
         /**
          * Gets a string idenfifying the name of the class
          * @returns "Node" string