David Catuhe 7 лет назад
Родитель
Сommit
8bd9d43748
35 измененных файлов с 24442 добавлено и 23929 удалено
  1. 6257 6240
      Playground/babylon.d.txt
  2. 17300 17260
      dist/preview release/babylon.d.ts
  3. 49 49
      dist/preview release/babylon.js
  4. 77 14
      dist/preview release/babylon.max.js
  5. 50 50
      dist/preview release/babylon.worker.js
  6. 77 14
      dist/preview release/es6.js
  7. 4 4
      dist/preview release/gui/babylon.gui.min.js
  8. 4 4
      dist/preview release/inspector/babylon.inspector.bundle.js
  9. 7 0
      dist/preview release/inspector/babylon.inspector.d.ts
  10. 54 0
      dist/preview release/inspector/babylon.inspector.js
  11. 4 4
      dist/preview release/inspector/babylon.inspector.min.js
  12. 3 8
      dist/preview release/loaders/babylon.glTF1FileLoader.d.ts
  13. 7 21
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  14. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  15. 11 8
      dist/preview release/loaders/babylon.glTF2FileLoader.d.ts
  16. 83 28
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  17. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  18. 12 9
      dist/preview release/loaders/babylon.glTFFileLoader.d.ts
  19. 89 34
      dist/preview release/loaders/babylon.glTFFileLoader.js
  20. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  21. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  22. 89 34
      dist/preview release/loaders/babylonjs.loaders.js
  23. 3 3
      dist/preview release/loaders/babylonjs.loaders.min.js
  24. 12 9
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  25. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  26. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  27. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  28. 3 3
      dist/preview release/materialsLibrary/babylonjs.materials.min.js
  29. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  30. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  31. 1 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  32. 1 1
      dist/preview release/serializers/babylon.glTF2Serializer.min.js
  33. 1 1
      dist/preview release/serializers/babylonjs.serializers.min.js
  34. 58 58
      dist/preview release/viewer/babylon.viewer.js
  35. 173 59
      dist/preview release/viewer/babylon.viewer.max.js

Разница между файлами не показана из-за своего большого размера
+ 6257 - 6240
Playground/babylon.d.txt


Разница между файлами не показана из-за своего большого размера
+ 17300 - 17260
dist/preview release/babylon.d.ts


Разница между файлами не показана из-за своего большого размера
+ 49 - 49
dist/preview release/babylon.js


+ 77 - 14
dist/preview release/babylon.max.js

@@ -11270,7 +11270,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.2";
+                return "3.2.0-beta.3";
             },
             enumerable: true,
             configurable: true
@@ -23759,7 +23759,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeAnimation = function (toRemove) {
             var index = this.animations.indexOf(toRemove);
             if (index !== -1) {
@@ -23767,7 +23766,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given animation group from this scene.
+         * @param toRemove The animation group to remove
+         * @returns The index of the removed animation group
+         */
+        Scene.prototype.removeAnimationGroup = function (toRemove) {
+            var index = this.animationGroups.indexOf(toRemove);
+            if (index !== -1) {
+                this.animationGroups.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.removeMultiMaterial = function (toRemove) {
             var index = this.multiMaterials.indexOf(toRemove);
             if (index !== -1) {
@@ -23775,7 +23785,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeMaterial = function (toRemove) {
             var index = this.materials.indexOf(toRemove);
             if (index !== -1) {
@@ -23783,7 +23792,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeLensFlareSystem = function (toRemove) {
             var index = this.lensFlareSystems.indexOf(toRemove);
             if (index !== -1) {
@@ -23791,7 +23799,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeActionManager = function (toRemove) {
             var index = this._actionManagers.indexOf(toRemove);
             if (index !== -1) {
@@ -23799,7 +23806,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given texture from this scene.
+         * @param toRemove The texture to remove
+         * @returns The index of the removed texture
+         */
+        Scene.prototype.removeTexture = function (toRemove) {
+            var index = this.textures.indexOf(toRemove);
+            if (index !== -1) {
+                this.textures.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.addLight = function (newLight) {
             this.lights.push(newLight);
             this.sortLightsByPriority();
@@ -23831,6 +23849,13 @@ var BABYLON;
         Scene.prototype.addAnimation = function (newAnimation) {
             this.animations.push(newAnimation);
         };
+        /**
+         * Adds the given animation group to this scene.
+         * @param newAnimationGroup The animation group to add
+         */
+        Scene.prototype.addAnimationGroup = function (newAnimationGroup) {
+            this.animationGroups.push(newAnimationGroup);
+        };
         Scene.prototype.addMultiMaterial = function (newMultiMaterial) {
             this.multiMaterials.push(newMultiMaterial);
         };
@@ -23850,6 +23875,13 @@ var BABYLON;
             this._actionManagers.push(newActionManager);
         };
         /**
+         * Adds the given texture to this scene.
+         * @param newTexture The texture to add
+         */
+        Scene.prototype.addTexture = function (newTexture) {
+            this.textures.push(newTexture);
+        };
+        /**
          * Switch active camera
          * @param {Camera} newCamera - new active camera
          * @param {boolean} attachControl - call attachControl for the new active camera (default: true)
@@ -26003,6 +26035,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups to keep.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials to keep.
              */
             this.multiMaterials = new Array();
@@ -26038,6 +26074,10 @@ var BABYLON;
              * Sounds to keep.
              */
             this.sounds = new Array();
+            /**
+             * Textures to keep.
+             */
+            this.textures = new Array();
         }
         return KeepAssets;
     }());
@@ -26077,6 +26117,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups populated in the container.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials populated in the container.
              */
             this.multiMaterials = new Array();
@@ -26112,6 +26156,10 @@ var BABYLON;
              * Sounds populated in the container.
              */
             this.sounds = new Array();
+            /**
+             * Textures populated in the container.
+             */
+            this.textures = new Array();
             this.scene = scene;
         }
         /**
@@ -26137,6 +26185,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.addAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.addAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.addMultiMaterial(o);
             });
@@ -26163,6 +26214,9 @@ var BABYLON;
                 o.autoplay = true;
                 _this.scene.mainSoundTrack.AddSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.addTexture;
+            });
         };
         /**
          * Removes all the assets in the container from the scene
@@ -26187,6 +26241,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.removeAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.removeAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.removeMultiMaterial(o);
             });
@@ -26213,6 +26270,9 @@ var BABYLON;
                 o.autoplay = false;
                 _this.scene.mainSoundTrack.RemoveSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.removeTexture(o);
+            });
         };
         AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) {
             for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) {
@@ -26244,6 +26304,7 @@ var BABYLON;
             this._moveAssets(this.scene.materials, this.materials, keepAssets.materials);
             this._moveAssets(this.scene._actionManagers, this.actionManagers, keepAssets.actionManagers);
             this._moveAssets(this.scene.animations, this.animations, keepAssets.animations);
+            this._moveAssets(this.scene.animationGroups, this.animationGroups, keepAssets.animationGroups);
             this._moveAssets(this.scene.lensFlareSystems, this.lensFlareSystems, keepAssets.lensFlareSystems);
             this._moveAssets(this.scene.lights, this.lights, keepAssets.lights);
             this._moveAssets(this.scene.morphTargetManagers, this.morphTargetManagers, keepAssets.morphTargetManagers);
@@ -26252,6 +26313,7 @@ var BABYLON;
             this._moveAssets(this.scene.particleSystems, this.particleSystems, keepAssets.particleSystems);
             this._moveAssets(this.scene.mainSoundTrack.soundCollection, this.sounds, keepAssets.sounds);
             this._moveAssets(this.scene.transformNodes, this.transformNodes, keepAssets.transformNodes);
+            this._moveAssets(this.scene.textures, this.textures, keepAssets.textures);
             this.removeAllFromScene();
         };
         return AssetContainer;
@@ -63189,11 +63251,11 @@ var BABYLON;
                     errorHandler("Error in onProgress callback", e);
                 }
             } : undefined;
-            var successHandler = function (meshes, particleSystems, skeletons) {
+            var successHandler = function (meshes, particleSystems, skeletons, animationGroups) {
                 scene.importedMeshesFiles.push(rootUrl + sceneFilename);
                 if (onSuccess) {
                     try {
-                        onSuccess(meshes, particleSystems, skeletons);
+                        onSuccess(meshes, particleSystems, skeletons, animationGroups);
                     }
                     catch (e) {
                         errorHandler("Error in onSuccess callback", e);
@@ -63219,13 +63281,13 @@ var BABYLON;
                         return;
                     }
                     scene.loadingPluginName = plugin.name;
-                    successHandler(meshes, particleSystems, skeletons);
+                    successHandler(meshes, particleSystems, skeletons, []);
                 }
                 else {
                     var asyncedPlugin = plugin;
                     asyncedPlugin.importMeshAsync(meshNames, scene, data, rootUrl, progressHandler).then(function (result) {
                         scene.loadingPluginName = plugin.name;
-                        successHandler(result.meshes, result.particleSystems, result.skeletons);
+                        successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups);
                     }).catch(function (error) {
                         errorHandler(error.message, error);
                     });
@@ -63240,17 +63302,18 @@ var BABYLON;
         * @param scene the instance of BABYLON.Scene to append to
         * @param onProgress a callback with a progress event for each file being loaded
         * @param pluginExtension the extension used to determine the plugin
-        * @returns The loaded list of imported meshes, particleSystems, and skeletons
+        * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
         */
         SceneLoader.ImportMeshAsync = function (meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension) {
             if (onProgress === void 0) { onProgress = null; }
             if (pluginExtension === void 0) { pluginExtension = null; }
             return new Promise(function (resolve, reject) {
-                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons) {
+                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons, animationGroups) {
                     resolve({
                         meshes: meshes,
                         particleSystems: particleSystems,
-                        skeletons: skeletons
+                        skeletons: skeletons,
+                        animationGroups: animationGroups
                     });
                 }, onProgress, function (scene, message, exception) {
                     reject(exception || new Error(message));

Разница между файлами не показана из-за своего большого размера
+ 50 - 50
dist/preview release/babylon.worker.js


+ 77 - 14
dist/preview release/es6.js

@@ -11237,7 +11237,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.2";
+                return "3.2.0-beta.3";
             },
             enumerable: true,
             configurable: true
@@ -23726,7 +23726,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeAnimation = function (toRemove) {
             var index = this.animations.indexOf(toRemove);
             if (index !== -1) {
@@ -23734,7 +23733,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given animation group from this scene.
+         * @param toRemove The animation group to remove
+         * @returns The index of the removed animation group
+         */
+        Scene.prototype.removeAnimationGroup = function (toRemove) {
+            var index = this.animationGroups.indexOf(toRemove);
+            if (index !== -1) {
+                this.animationGroups.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.removeMultiMaterial = function (toRemove) {
             var index = this.multiMaterials.indexOf(toRemove);
             if (index !== -1) {
@@ -23742,7 +23752,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeMaterial = function (toRemove) {
             var index = this.materials.indexOf(toRemove);
             if (index !== -1) {
@@ -23750,7 +23759,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeLensFlareSystem = function (toRemove) {
             var index = this.lensFlareSystems.indexOf(toRemove);
             if (index !== -1) {
@@ -23758,7 +23766,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeActionManager = function (toRemove) {
             var index = this._actionManagers.indexOf(toRemove);
             if (index !== -1) {
@@ -23766,7 +23773,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given texture from this scene.
+         * @param toRemove The texture to remove
+         * @returns The index of the removed texture
+         */
+        Scene.prototype.removeTexture = function (toRemove) {
+            var index = this.textures.indexOf(toRemove);
+            if (index !== -1) {
+                this.textures.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.addLight = function (newLight) {
             this.lights.push(newLight);
             this.sortLightsByPriority();
@@ -23798,6 +23816,13 @@ var BABYLON;
         Scene.prototype.addAnimation = function (newAnimation) {
             this.animations.push(newAnimation);
         };
+        /**
+         * Adds the given animation group to this scene.
+         * @param newAnimationGroup The animation group to add
+         */
+        Scene.prototype.addAnimationGroup = function (newAnimationGroup) {
+            this.animationGroups.push(newAnimationGroup);
+        };
         Scene.prototype.addMultiMaterial = function (newMultiMaterial) {
             this.multiMaterials.push(newMultiMaterial);
         };
@@ -23817,6 +23842,13 @@ var BABYLON;
             this._actionManagers.push(newActionManager);
         };
         /**
+         * Adds the given texture to this scene.
+         * @param newTexture The texture to add
+         */
+        Scene.prototype.addTexture = function (newTexture) {
+            this.textures.push(newTexture);
+        };
+        /**
          * Switch active camera
          * @param {Camera} newCamera - new active camera
          * @param {boolean} attachControl - call attachControl for the new active camera (default: true)
@@ -25970,6 +26002,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups to keep.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials to keep.
              */
             this.multiMaterials = new Array();
@@ -26005,6 +26041,10 @@ var BABYLON;
              * Sounds to keep.
              */
             this.sounds = new Array();
+            /**
+             * Textures to keep.
+             */
+            this.textures = new Array();
         }
         return KeepAssets;
     }());
@@ -26044,6 +26084,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups populated in the container.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials populated in the container.
              */
             this.multiMaterials = new Array();
@@ -26079,6 +26123,10 @@ var BABYLON;
              * Sounds populated in the container.
              */
             this.sounds = new Array();
+            /**
+             * Textures populated in the container.
+             */
+            this.textures = new Array();
             this.scene = scene;
         }
         /**
@@ -26104,6 +26152,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.addAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.addAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.addMultiMaterial(o);
             });
@@ -26130,6 +26181,9 @@ var BABYLON;
                 o.autoplay = true;
                 _this.scene.mainSoundTrack.AddSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.addTexture;
+            });
         };
         /**
          * Removes all the assets in the container from the scene
@@ -26154,6 +26208,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.removeAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.removeAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.removeMultiMaterial(o);
             });
@@ -26180,6 +26237,9 @@ var BABYLON;
                 o.autoplay = false;
                 _this.scene.mainSoundTrack.RemoveSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.removeTexture(o);
+            });
         };
         AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) {
             for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) {
@@ -26211,6 +26271,7 @@ var BABYLON;
             this._moveAssets(this.scene.materials, this.materials, keepAssets.materials);
             this._moveAssets(this.scene._actionManagers, this.actionManagers, keepAssets.actionManagers);
             this._moveAssets(this.scene.animations, this.animations, keepAssets.animations);
+            this._moveAssets(this.scene.animationGroups, this.animationGroups, keepAssets.animationGroups);
             this._moveAssets(this.scene.lensFlareSystems, this.lensFlareSystems, keepAssets.lensFlareSystems);
             this._moveAssets(this.scene.lights, this.lights, keepAssets.lights);
             this._moveAssets(this.scene.morphTargetManagers, this.morphTargetManagers, keepAssets.morphTargetManagers);
@@ -26219,6 +26280,7 @@ var BABYLON;
             this._moveAssets(this.scene.particleSystems, this.particleSystems, keepAssets.particleSystems);
             this._moveAssets(this.scene.mainSoundTrack.soundCollection, this.sounds, keepAssets.sounds);
             this._moveAssets(this.scene.transformNodes, this.transformNodes, keepAssets.transformNodes);
+            this._moveAssets(this.scene.textures, this.textures, keepAssets.textures);
             this.removeAllFromScene();
         };
         return AssetContainer;
@@ -63156,11 +63218,11 @@ var BABYLON;
                     errorHandler("Error in onProgress callback", e);
                 }
             } : undefined;
-            var successHandler = function (meshes, particleSystems, skeletons) {
+            var successHandler = function (meshes, particleSystems, skeletons, animationGroups) {
                 scene.importedMeshesFiles.push(rootUrl + sceneFilename);
                 if (onSuccess) {
                     try {
-                        onSuccess(meshes, particleSystems, skeletons);
+                        onSuccess(meshes, particleSystems, skeletons, animationGroups);
                     }
                     catch (e) {
                         errorHandler("Error in onSuccess callback", e);
@@ -63186,13 +63248,13 @@ var BABYLON;
                         return;
                     }
                     scene.loadingPluginName = plugin.name;
-                    successHandler(meshes, particleSystems, skeletons);
+                    successHandler(meshes, particleSystems, skeletons, []);
                 }
                 else {
                     var asyncedPlugin = plugin;
                     asyncedPlugin.importMeshAsync(meshNames, scene, data, rootUrl, progressHandler).then(function (result) {
                         scene.loadingPluginName = plugin.name;
-                        successHandler(result.meshes, result.particleSystems, result.skeletons);
+                        successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups);
                     }).catch(function (error) {
                         errorHandler(error.message, error);
                     });
@@ -63207,17 +63269,18 @@ var BABYLON;
         * @param scene the instance of BABYLON.Scene to append to
         * @param onProgress a callback with a progress event for each file being loaded
         * @param pluginExtension the extension used to determine the plugin
-        * @returns The loaded list of imported meshes, particleSystems, and skeletons
+        * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
         */
         SceneLoader.ImportMeshAsync = function (meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension) {
             if (onProgress === void 0) { onProgress = null; }
             if (pluginExtension === void 0) { pluginExtension = null; }
             return new Promise(function (resolve, reject) {
-                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons) {
+                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons, animationGroups) {
                     resolve({
                         meshes: meshes,
                         particleSystems: particleSystems,
-                        skeletons: skeletons
+                        skeletons: skeletons,
+                        animationGroups: animationGroups
                     });
                 }, onProgress, function (scene, message, exception) {
                     reject(exception || new Error(message));

Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/gui/babylon.gui.min.js


Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/inspector/babylon.inspector.bundle.js


+ 7 - 0
dist/preview release/inspector/babylon.inspector.d.ts

@@ -1165,6 +1165,13 @@ declare module INSPECTOR {
 }
 
 declare module INSPECTOR {
+    class FullscreenTool extends AbstractTool {
+        constructor(parent: HTMLElement, inspector: Inspector);
+        action(): void;
+    }
+}
+
+declare module INSPECTOR {
     class TreeItem extends BasicElement {
         private _tab;
         private _adapter;

+ 54 - 0
dist/preview release/inspector/babylon.inspector.js

@@ -3441,6 +3441,25 @@ var INSPECTOR;
                 point.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = true; _this._inspector.scene.forceWireframe = false; });
                 wireframe.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = false; _this._inspector.scene.forceWireframe = true; });
                 solid.addEventListener('click', function () { _this._inspector.scene.forcePointsCloud = false; _this._inspector.scene.forceWireframe = false; });
+                // Cameras
+                title = INSPECTOR.Helpers.CreateDiv('actions-title', _this._actions);
+                title.textContent = 'Cameras';
+                var cameraRadioButtons = [];
+                var _loop_1 = function (camera) {
+                    var cameraRadio = INSPECTOR.Helpers.CreateDiv('action-radio', this_1._actions);
+                    cameraRadio.textContent = camera.name;
+                    if (this_1._inspector.scene.activeCamera == camera) {
+                        cameraRadio.classList.add('active');
+                    }
+                    cameraRadioButtons.push(cameraRadio);
+                    cameraRadio.addEventListener('click', function () { _this._inspector.scene.switchActiveCamera(camera); });
+                };
+                var this_1 = this;
+                for (var _a = 0, _b = _this._inspector.scene.cameras; _a < _b.length; _a++) {
+                    var camera = _b[_a];
+                    _loop_1(camera);
+                }
+                _this._generateRadioAction(cameraRadioButtons);
                 // Textures
                 title = INSPECTOR.Helpers.CreateDiv('actions-title', _this._actions);
                 title.textContent = 'Textures channels';
@@ -4629,6 +4648,8 @@ var INSPECTOR;
             if (!this._inspector.popupMode && !INSPECTOR.Helpers.IsBrowserEdge()) {
                 this._tools.push(new INSPECTOR.PopupTool(this._div, this._inspector));
             }
+            // FullScreen
+            this._tools.push(new INSPECTOR.FullscreenTool(this._div, this._inspector));
             // Pause schedule
             this._tools.push(new INSPECTOR.PauseScheduleTool(this._div, this._inspector));
             // Pause schedule
@@ -4694,6 +4715,39 @@ var __extends = (this && this.__extends) || (function () {
 })();
 var INSPECTOR;
 (function (INSPECTOR) {
+    var FullscreenTool = /** @class */ (function (_super) {
+        __extends(FullscreenTool, _super);
+        function FullscreenTool(parent, inspector) {
+            return _super.call(this, 'fa-expand', parent, inspector, 'Open the scene in fullscreen, press Esc to exit') || this;
+        }
+        // Action : refresh the whole panel
+        FullscreenTool.prototype.action = function () {
+            var elem = document.body;
+            function requestFullScreen(element) {
+                // Supports most browsers and their versions.
+                var requestMethod = element.requestFullscreen || element.webkitRequestFullScreen;
+                requestMethod.call(element);
+            }
+            requestFullScreen(elem);
+        };
+        return FullscreenTool;
+    }(INSPECTOR.AbstractTool));
+    INSPECTOR.FullscreenTool = FullscreenTool;
+})(INSPECTOR || (INSPECTOR = {}));
+
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var INSPECTOR;
+(function (INSPECTOR) {
     var TreeItem = /** @class */ (function (_super) {
         __extends(TreeItem, _super);
         function TreeItem(tab, obj) {

Разница между файлами не показана из-за своего большого размера
+ 4 - 4
dist/preview release/inspector/babylon.inspector.min.js


+ 3 - 8
dist/preview release/loaders/babylon.glTF1FileLoader.d.ts

@@ -52,7 +52,6 @@ declare module BABYLON {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onDisposeObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
@@ -61,6 +60,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
@@ -116,12 +116,6 @@ declare module BABYLON {
         private _onMaterialLoadedObserver;
         onMaterialLoaded: (material: Material) => void;
         /**
-         * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-         */
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
-        private _onAnimationGroupLoadedObserver;
-        onAnimationGroupLoaded: (animationGroup: AnimationGroup) => void;
-        /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
          * For assets with LODs, raised when all of the LODs are complete.
          * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -162,6 +156,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
@@ -581,7 +576,6 @@ declare module BABYLON.GLTF1 {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         state: Nullable<GLTFLoaderState>;
@@ -591,6 +585,7 @@ declare module BABYLON.GLTF1 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;

+ 7 - 21
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -78,10 +78,6 @@ var BABYLON;
              */
             this.onMaterialLoadedObservable = new BABYLON.Observable();
             /**
-             * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-             */
-            this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
-            /**
              * Raised when the asset is completely loaded, immediately before the loader is disposed.
              * For assets with LODs, raised when all of the LODs are complete.
              * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -144,16 +140,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(GLTFFileLoader.prototype, "onAnimationGroupLoaded", {
-            set: function (callback) {
-                if (this._onAnimationGroupLoadedObserver) {
-                    this.onAnimationGroupLoadedObservable.remove(this._onAnimationGroupLoadedObserver);
-                }
-                this._onAnimationGroupLoadedObserver = this.onAnimationGroupLoadedObservable.add(callback);
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -246,6 +232,7 @@ var BABYLON;
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                     Array.prototype.push.apply(container.skeletons, result.skeletons);
+                    Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                     container.removeAllFromScene();
                     return container;
                 });
@@ -307,7 +294,6 @@ var BABYLON;
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
             loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onAnimationGroupLoadedObservable.add(function (animationGroup) { return _this.onAnimationGroupLoadedObservable.notifyObservers(animationGroup); });
             loader.onCompleteObservable.add(function () {
                 _this.onMeshLoadedObservable.clear();
                 _this.onTextureLoadedObservable.clear();
@@ -1872,7 +1858,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.state = null;
@@ -1927,12 +1912,12 @@ var BABYLON;
                             importMaterials(gltfRuntime);
                             postLoad(gltfRuntime);
                             if (!BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                                onSuccess(meshes, [], skeletons);
+                                onSuccess(meshes, skeletons);
                             }
                         });
                     }, onProgress);
                     if (BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                        onSuccess(meshes, [], skeletons);
+                        onSuccess(meshes, skeletons);
                     }
                 }, onError);
                 return true;
@@ -1940,11 +1925,12 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
-                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, particleSystems, skeletons) {
+                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, skeletons) {
                         resolve({
                             meshes: meshes,
-                            particleSystems: particleSystems,
-                            skeletons: skeletons
+                            particleSystems: [],
+                            skeletons: skeletons,
+                            animationGroups: []
                         });
                     }, onProgress, function (message) {
                         reject(new Error(message));

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


+ 11 - 8
dist/preview release/loaders/babylon.glTF2FileLoader.d.ts

@@ -52,7 +52,6 @@ declare module BABYLON {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onDisposeObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
@@ -61,6 +60,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
@@ -116,12 +116,6 @@ declare module BABYLON {
         private _onMaterialLoadedObserver;
         onMaterialLoaded: (material: Material) => void;
         /**
-         * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-         */
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
-        private _onAnimationGroupLoadedObserver;
-        onAnimationGroupLoaded: (animationGroup: AnimationGroup) => void;
-        /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
          * For assets with LODs, raised when all of the LODs are complete.
          * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -162,6 +156,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
@@ -190,6 +185,13 @@ declare module BABYLON.GLTF2 {
     class ArrayItem {
         static Assign(values?: IArrayItem[]): void;
     }
+    class AnimationMultiTarget {
+        subTargets: any[];
+        position: Vector3;
+        rotationQuaternion: Quaternion;
+        scaling: Vector3;
+        influence: number;
+    }
 }
 
 
@@ -310,7 +312,6 @@ declare module BABYLON.GLTF2 {
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         readonly onMaterialLoadedObservable: Observable<Material>;
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         readonly onCompleteObservable: Observable<IGLTFLoader>;
         readonly state: Nullable<GLTFLoaderState>;
@@ -319,6 +320,7 @@ declare module BABYLON.GLTF2 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
@@ -332,6 +334,7 @@ declare module BABYLON.GLTF2 {
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
+        private _getAnimationGroups();
         private _startAnimations();
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);

+ 83 - 28
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -78,10 +78,6 @@ var BABYLON;
              */
             this.onMaterialLoadedObservable = new BABYLON.Observable();
             /**
-             * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-             */
-            this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
-            /**
              * Raised when the asset is completely loaded, immediately before the loader is disposed.
              * For assets with LODs, raised when all of the LODs are complete.
              * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -144,16 +140,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(GLTFFileLoader.prototype, "onAnimationGroupLoaded", {
-            set: function (callback) {
-                if (this._onAnimationGroupLoadedObserver) {
-                    this.onAnimationGroupLoadedObservable.remove(this._onAnimationGroupLoadedObserver);
-                }
-                this._onAnimationGroupLoadedObserver = this.onAnimationGroupLoadedObservable.add(callback);
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -246,6 +232,7 @@ var BABYLON;
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                     Array.prototype.push.apply(container.skeletons, result.skeletons);
+                    Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                     container.removeAllFromScene();
                     return container;
                 });
@@ -307,7 +294,6 @@ var BABYLON;
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
             loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onAnimationGroupLoadedObservable.add(function (animationGroup) { return _this.onAnimationGroupLoadedObservable.notifyObservers(animationGroup); });
             loader.onCompleteObservable.add(function () {
                 _this.onMeshLoadedObservable.clear();
                 _this.onTextureLoadedObservable.clear();
@@ -496,6 +482,53 @@ var BABYLON;
             return ArrayItem;
         }());
         GLTF2.ArrayItem = ArrayItem;
+        var AnimationMultiTarget = /** @class */ (function () {
+            function AnimationMultiTarget() {
+                this.subTargets = new Array();
+            }
+            Object.defineProperty(AnimationMultiTarget.prototype, "position", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.position = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "rotationQuaternion", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.rotationQuaternion = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "scaling", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.scaling = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "influence", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.influence = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            return AnimationMultiTarget;
+        }());
+        GLTF2.AnimationMultiTarget = AnimationMultiTarget;
     })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
 })(BABYLON || (BABYLON = {}));
 
@@ -531,7 +564,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
             }
@@ -588,6 +620,7 @@ var BABYLON;
                             meshes: _this._getMeshes(),
                             particleSystems: [],
                             skeletons: _this._getSkeletons(),
+                            animationGroups: _this._getAnimationGroups()
                         };
                     });
                 });
@@ -808,25 +841,37 @@ var BABYLON;
                 }
                 return skeletons;
             };
-            GLTFLoader.prototype._startAnimations = function () {
+            GLTFLoader.prototype._getAnimationGroups = function () {
+                var animationGroups = new Array();
                 var animations = this._gltf.animations;
-                if (!animations) {
-                    return;
+                if (animations) {
+                    for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
+                        var animation = animations_1[_i];
+                        if (animation._babylonAnimationGroup) {
+                            animationGroups.push(animation._babylonAnimationGroup);
+                        }
+                    }
                 }
+                return animationGroups;
+            };
+            GLTFLoader.prototype._startAnimations = function () {
                 switch (this.animationStartMode) {
                     case BABYLON.GLTFLoaderAnimationStartMode.NONE: {
                         // do nothing
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.FIRST: {
-                        var animation = animations[0];
-                        animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        if (babylonAnimationGroups.length !== 0) {
+                            babylonAnimationGroups[0].start(true);
+                        }
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.ALL: {
-                        for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
-                            var animation = animations_1[_i];
-                            animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        for (var _i = 0, babylonAnimationGroups_1 = babylonAnimationGroups; _i < babylonAnimationGroups_1.length; _i++) {
+                            var babylonAnimationGroup = babylonAnimationGroups_1[_i];
+                            babylonAnimationGroup.start(true);
                         }
                         break;
                     }
@@ -1116,6 +1161,8 @@ var BABYLON;
                     _this._forEachPrimitive(node, function (babylonMesh) {
                         babylonMesh.skeleton = skin._babylonSkeleton;
                     });
+                    // Ignore the TRS of skinned nodes.
+                    // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
                     node._babylonMesh.parent = _this._rootBabylonMesh;
                     node._babylonMesh.position = BABYLON.Vector3.Zero();
                     node._babylonMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
@@ -1205,7 +1252,6 @@ var BABYLON;
                     var channel = _a[_i];
                     promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
                 }
-                this.onAnimationGroupLoadedObservable.notifyObservers(babylonAnimationGroup);
                 return Promise.all(promises).then(function () {
                     babylonAnimationGroup.normalize();
                 });
@@ -1213,7 +1259,12 @@ var BABYLON;
             GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
                 var _this = this;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
-                if (!targetNode._babylonMesh || targetNode.skin != undefined) {
+                if (!targetNode._babylonMesh) {
+                    return Promise.resolve();
+                }
+                // Ignore animations targeting TRS of skinned nodes.
+                // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
+                if (targetNode.skin != undefined && channel.target.path !== "weights" /* WEIGHTS */) {
                     return Promise.resolve();
                 }
                 var sampler = GLTFLoader._GetProperty(context + "/sampler", animation.samplers, channel.sampler);
@@ -1324,10 +1375,12 @@ var BABYLON;
                                 value: key.value[targetIndex],
                                 outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined
                             }); }));
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             _this._forEachPrimitive(targetNode, function (babylonMesh) {
                                 var morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, morphTarget);
+                                multiTarget.subTargets.push(morphTarget);
                             });
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         };
                         for (var targetIndex = 0; targetIndex < targetNode._numMorphTargets; targetIndex++) {
                             _loop_1(targetIndex);
@@ -1338,10 +1391,12 @@ var BABYLON;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
                         if (targetNode._babylonAnimationTargets) {
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
                                 var target = _a[_i];
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, target);
+                                multiTarget.subTargets.push(target);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 12 - 9
dist/preview release/loaders/babylon.glTFFileLoader.d.ts

@@ -52,7 +52,6 @@ declare module BABYLON {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onDisposeObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
@@ -61,6 +60,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
@@ -116,12 +116,6 @@ declare module BABYLON {
         private _onMaterialLoadedObserver;
         onMaterialLoaded: (material: Material) => void;
         /**
-         * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-         */
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
-        private _onAnimationGroupLoadedObserver;
-        onAnimationGroupLoaded: (animationGroup: AnimationGroup) => void;
-        /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
          * For assets with LODs, raised when all of the LODs are complete.
          * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -162,6 +156,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
@@ -581,7 +576,6 @@ declare module BABYLON.GLTF1 {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         state: Nullable<GLTFLoaderState>;
@@ -591,6 +585,7 @@ declare module BABYLON.GLTF1 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
@@ -746,6 +741,13 @@ declare module BABYLON.GLTF2 {
     class ArrayItem {
         static Assign(values?: IArrayItem[]): void;
     }
+    class AnimationMultiTarget {
+        subTargets: any[];
+        position: Vector3;
+        rotationQuaternion: Quaternion;
+        scaling: Vector3;
+        influence: number;
+    }
 }
 
 
@@ -866,7 +868,6 @@ declare module BABYLON.GLTF2 {
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         readonly onMaterialLoadedObservable: Observable<Material>;
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         readonly onCompleteObservable: Observable<IGLTFLoader>;
         readonly state: Nullable<GLTFLoaderState>;
@@ -875,6 +876,7 @@ declare module BABYLON.GLTF2 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
@@ -888,6 +890,7 @@ declare module BABYLON.GLTF2 {
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
+        private _getAnimationGroups();
         private _startAnimations();
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);

+ 89 - 34
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -78,10 +78,6 @@ var BABYLON;
              */
             this.onMaterialLoadedObservable = new BABYLON.Observable();
             /**
-             * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-             */
-            this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
-            /**
              * Raised when the asset is completely loaded, immediately before the loader is disposed.
              * For assets with LODs, raised when all of the LODs are complete.
              * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -144,16 +140,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(GLTFFileLoader.prototype, "onAnimationGroupLoaded", {
-            set: function (callback) {
-                if (this._onAnimationGroupLoadedObserver) {
-                    this.onAnimationGroupLoadedObservable.remove(this._onAnimationGroupLoadedObserver);
-                }
-                this._onAnimationGroupLoadedObserver = this.onAnimationGroupLoadedObservable.add(callback);
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -246,6 +232,7 @@ var BABYLON;
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                     Array.prototype.push.apply(container.skeletons, result.skeletons);
+                    Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                     container.removeAllFromScene();
                     return container;
                 });
@@ -307,7 +294,6 @@ var BABYLON;
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
             loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onAnimationGroupLoadedObservable.add(function (animationGroup) { return _this.onAnimationGroupLoadedObservable.notifyObservers(animationGroup); });
             loader.onCompleteObservable.add(function () {
                 _this.onMeshLoadedObservable.clear();
                 _this.onTextureLoadedObservable.clear();
@@ -1872,7 +1858,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.state = null;
@@ -1927,12 +1912,12 @@ var BABYLON;
                             importMaterials(gltfRuntime);
                             postLoad(gltfRuntime);
                             if (!BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                                onSuccess(meshes, [], skeletons);
+                                onSuccess(meshes, skeletons);
                             }
                         });
                     }, onProgress);
                     if (BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                        onSuccess(meshes, [], skeletons);
+                        onSuccess(meshes, skeletons);
                     }
                 }, onError);
                 return true;
@@ -1940,11 +1925,12 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
-                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, particleSystems, skeletons) {
+                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, skeletons) {
                         resolve({
                             meshes: meshes,
-                            particleSystems: particleSystems,
-                            skeletons: skeletons
+                            particleSystems: [],
+                            skeletons: skeletons,
+                            animationGroups: []
                         });
                     }, onProgress, function (message) {
                         reject(new Error(message));
@@ -2694,6 +2680,53 @@ var BABYLON;
             return ArrayItem;
         }());
         GLTF2.ArrayItem = ArrayItem;
+        var AnimationMultiTarget = /** @class */ (function () {
+            function AnimationMultiTarget() {
+                this.subTargets = new Array();
+            }
+            Object.defineProperty(AnimationMultiTarget.prototype, "position", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.position = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "rotationQuaternion", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.rotationQuaternion = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "scaling", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.scaling = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "influence", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.influence = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            return AnimationMultiTarget;
+        }());
+        GLTF2.AnimationMultiTarget = AnimationMultiTarget;
     })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
 })(BABYLON || (BABYLON = {}));
 
@@ -2729,7 +2762,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
             }
@@ -2786,6 +2818,7 @@ var BABYLON;
                             meshes: _this._getMeshes(),
                             particleSystems: [],
                             skeletons: _this._getSkeletons(),
+                            animationGroups: _this._getAnimationGroups()
                         };
                     });
                 });
@@ -3006,25 +3039,37 @@ var BABYLON;
                 }
                 return skeletons;
             };
-            GLTFLoader.prototype._startAnimations = function () {
+            GLTFLoader.prototype._getAnimationGroups = function () {
+                var animationGroups = new Array();
                 var animations = this._gltf.animations;
-                if (!animations) {
-                    return;
+                if (animations) {
+                    for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
+                        var animation = animations_1[_i];
+                        if (animation._babylonAnimationGroup) {
+                            animationGroups.push(animation._babylonAnimationGroup);
+                        }
+                    }
                 }
+                return animationGroups;
+            };
+            GLTFLoader.prototype._startAnimations = function () {
                 switch (this.animationStartMode) {
                     case BABYLON.GLTFLoaderAnimationStartMode.NONE: {
                         // do nothing
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.FIRST: {
-                        var animation = animations[0];
-                        animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        if (babylonAnimationGroups.length !== 0) {
+                            babylonAnimationGroups[0].start(true);
+                        }
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.ALL: {
-                        for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
-                            var animation = animations_1[_i];
-                            animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        for (var _i = 0, babylonAnimationGroups_1 = babylonAnimationGroups; _i < babylonAnimationGroups_1.length; _i++) {
+                            var babylonAnimationGroup = babylonAnimationGroups_1[_i];
+                            babylonAnimationGroup.start(true);
                         }
                         break;
                     }
@@ -3314,6 +3359,8 @@ var BABYLON;
                     _this._forEachPrimitive(node, function (babylonMesh) {
                         babylonMesh.skeleton = skin._babylonSkeleton;
                     });
+                    // Ignore the TRS of skinned nodes.
+                    // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
                     node._babylonMesh.parent = _this._rootBabylonMesh;
                     node._babylonMesh.position = BABYLON.Vector3.Zero();
                     node._babylonMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
@@ -3403,7 +3450,6 @@ var BABYLON;
                     var channel = _a[_i];
                     promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
                 }
-                this.onAnimationGroupLoadedObservable.notifyObservers(babylonAnimationGroup);
                 return Promise.all(promises).then(function () {
                     babylonAnimationGroup.normalize();
                 });
@@ -3411,7 +3457,12 @@ var BABYLON;
             GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
                 var _this = this;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
-                if (!targetNode._babylonMesh || targetNode.skin != undefined) {
+                if (!targetNode._babylonMesh) {
+                    return Promise.resolve();
+                }
+                // Ignore animations targeting TRS of skinned nodes.
+                // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
+                if (targetNode.skin != undefined && channel.target.path !== "weights" /* WEIGHTS */) {
                     return Promise.resolve();
                 }
                 var sampler = GLTFLoader._GetProperty(context + "/sampler", animation.samplers, channel.sampler);
@@ -3522,10 +3573,12 @@ var BABYLON;
                                 value: key.value[targetIndex],
                                 outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined
                             }); }));
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             _this._forEachPrimitive(targetNode, function (babylonMesh) {
                                 var morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, morphTarget);
+                                multiTarget.subTargets.push(morphTarget);
                             });
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         };
                         for (var targetIndex = 0; targetIndex < targetNode._numMorphTargets; targetIndex++) {
                             _loop_1(targetIndex);
@@ -3536,10 +3589,12 @@ var BABYLON;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
                         if (targetNode._babylonAnimationTargets) {
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
                                 var target = _a[_i];
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, target);
+                                multiTarget.subTargets.push(target);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


+ 89 - 34
dist/preview release/loaders/babylonjs.loaders.js

@@ -1075,10 +1075,6 @@ var BABYLON;
              */
             this.onMaterialLoadedObservable = new BABYLON.Observable();
             /**
-             * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-             */
-            this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
-            /**
              * Raised when the asset is completely loaded, immediately before the loader is disposed.
              * For assets with LODs, raised when all of the LODs are complete.
              * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -1141,16 +1137,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(GLTFFileLoader.prototype, "onAnimationGroupLoaded", {
-            set: function (callback) {
-                if (this._onAnimationGroupLoadedObserver) {
-                    this.onAnimationGroupLoadedObservable.remove(this._onAnimationGroupLoadedObserver);
-                }
-                this._onAnimationGroupLoadedObserver = this.onAnimationGroupLoadedObservable.add(callback);
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -1243,6 +1229,7 @@ var BABYLON;
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                     Array.prototype.push.apply(container.skeletons, result.skeletons);
+                    Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                     container.removeAllFromScene();
                     return container;
                 });
@@ -1304,7 +1291,6 @@ var BABYLON;
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
             loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onAnimationGroupLoadedObservable.add(function (animationGroup) { return _this.onAnimationGroupLoadedObservable.notifyObservers(animationGroup); });
             loader.onCompleteObservable.add(function () {
                 _this.onMeshLoadedObservable.clear();
                 _this.onTextureLoadedObservable.clear();
@@ -2869,7 +2855,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.state = null;
@@ -2924,12 +2909,12 @@ var BABYLON;
                             importMaterials(gltfRuntime);
                             postLoad(gltfRuntime);
                             if (!BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                                onSuccess(meshes, [], skeletons);
+                                onSuccess(meshes, skeletons);
                             }
                         });
                     }, onProgress);
                     if (BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                        onSuccess(meshes, [], skeletons);
+                        onSuccess(meshes, skeletons);
                     }
                 }, onError);
                 return true;
@@ -2937,11 +2922,12 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
-                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, particleSystems, skeletons) {
+                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, skeletons) {
                         resolve({
                             meshes: meshes,
-                            particleSystems: particleSystems,
-                            skeletons: skeletons
+                            particleSystems: [],
+                            skeletons: skeletons,
+                            animationGroups: []
                         });
                     }, onProgress, function (message) {
                         reject(new Error(message));
@@ -3673,6 +3659,53 @@ var BABYLON;
             return ArrayItem;
         }());
         GLTF2.ArrayItem = ArrayItem;
+        var AnimationMultiTarget = /** @class */ (function () {
+            function AnimationMultiTarget() {
+                this.subTargets = new Array();
+            }
+            Object.defineProperty(AnimationMultiTarget.prototype, "position", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.position = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "rotationQuaternion", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.rotationQuaternion = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "scaling", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.scaling = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "influence", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.influence = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            return AnimationMultiTarget;
+        }());
+        GLTF2.AnimationMultiTarget = AnimationMultiTarget;
     })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
 })(BABYLON || (BABYLON = {}));
 
@@ -3708,7 +3741,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
             }
@@ -3765,6 +3797,7 @@ var BABYLON;
                             meshes: _this._getMeshes(),
                             particleSystems: [],
                             skeletons: _this._getSkeletons(),
+                            animationGroups: _this._getAnimationGroups()
                         };
                     });
                 });
@@ -3985,25 +4018,37 @@ var BABYLON;
                 }
                 return skeletons;
             };
-            GLTFLoader.prototype._startAnimations = function () {
+            GLTFLoader.prototype._getAnimationGroups = function () {
+                var animationGroups = new Array();
                 var animations = this._gltf.animations;
-                if (!animations) {
-                    return;
+                if (animations) {
+                    for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
+                        var animation = animations_1[_i];
+                        if (animation._babylonAnimationGroup) {
+                            animationGroups.push(animation._babylonAnimationGroup);
+                        }
+                    }
                 }
+                return animationGroups;
+            };
+            GLTFLoader.prototype._startAnimations = function () {
                 switch (this.animationStartMode) {
                     case BABYLON.GLTFLoaderAnimationStartMode.NONE: {
                         // do nothing
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.FIRST: {
-                        var animation = animations[0];
-                        animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        if (babylonAnimationGroups.length !== 0) {
+                            babylonAnimationGroups[0].start(true);
+                        }
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.ALL: {
-                        for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
-                            var animation = animations_1[_i];
-                            animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        for (var _i = 0, babylonAnimationGroups_1 = babylonAnimationGroups; _i < babylonAnimationGroups_1.length; _i++) {
+                            var babylonAnimationGroup = babylonAnimationGroups_1[_i];
+                            babylonAnimationGroup.start(true);
                         }
                         break;
                     }
@@ -4293,6 +4338,8 @@ var BABYLON;
                     _this._forEachPrimitive(node, function (babylonMesh) {
                         babylonMesh.skeleton = skin._babylonSkeleton;
                     });
+                    // Ignore the TRS of skinned nodes.
+                    // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
                     node._babylonMesh.parent = _this._rootBabylonMesh;
                     node._babylonMesh.position = BABYLON.Vector3.Zero();
                     node._babylonMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
@@ -4382,7 +4429,6 @@ var BABYLON;
                     var channel = _a[_i];
                     promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
                 }
-                this.onAnimationGroupLoadedObservable.notifyObservers(babylonAnimationGroup);
                 return Promise.all(promises).then(function () {
                     babylonAnimationGroup.normalize();
                 });
@@ -4390,7 +4436,12 @@ var BABYLON;
             GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
                 var _this = this;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
-                if (!targetNode._babylonMesh || targetNode.skin != undefined) {
+                if (!targetNode._babylonMesh) {
+                    return Promise.resolve();
+                }
+                // Ignore animations targeting TRS of skinned nodes.
+                // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
+                if (targetNode.skin != undefined && channel.target.path !== "weights" /* WEIGHTS */) {
                     return Promise.resolve();
                 }
                 var sampler = GLTFLoader._GetProperty(context + "/sampler", animation.samplers, channel.sampler);
@@ -4501,10 +4552,12 @@ var BABYLON;
                                 value: key.value[targetIndex],
                                 outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined
                             }); }));
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             _this._forEachPrimitive(targetNode, function (babylonMesh) {
                                 var morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, morphTarget);
+                                multiTarget.subTargets.push(morphTarget);
                             });
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         };
                         for (var targetIndex = 0; targetIndex < targetNode._numMorphTargets; targetIndex++) {
                             _loop_1(targetIndex);
@@ -4515,10 +4568,12 @@ var BABYLON;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
                         if (targetNode._babylonAnimationTargets) {
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
                                 var target = _a[_i];
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, target);
+                                multiTarget.subTargets.push(target);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         }
                     }
                 });

Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/loaders/babylonjs.loaders.min.js


+ 12 - 9
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -152,7 +152,6 @@ declare module BABYLON {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onDisposeObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
@@ -161,6 +160,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync: (scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void) => Promise<void>;
     }
@@ -216,12 +216,6 @@ declare module BABYLON {
         private _onMaterialLoadedObserver;
         onMaterialLoaded: (material: Material) => void;
         /**
-         * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-         */
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
-        private _onAnimationGroupLoadedObserver;
-        onAnimationGroupLoaded: (animationGroup: AnimationGroup) => void;
-        /**
          * Raised when the asset is completely loaded, immediately before the loader is disposed.
          * For assets with LODs, raised when all of the LODs are complete.
          * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -262,6 +256,7 @@ declare module BABYLON {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         loadAssetContainerAsync(scene: Scene, data: string | ArrayBuffer, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<AssetContainer>;
@@ -681,7 +676,6 @@ declare module BABYLON.GLTF1 {
         onMeshLoadedObservable: Observable<AbstractMesh>;
         onTextureLoadedObservable: Observable<BaseTexture>;
         onMaterialLoadedObservable: Observable<Material>;
-        onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         onCompleteObservable: Observable<IGLTFLoader>;
         onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         state: Nullable<GLTFLoaderState>;
@@ -691,6 +685,7 @@ declare module BABYLON.GLTF1 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         private _loadAsync(scene, data, rootUrl, onSuccess, onProgress?, onError?);
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
@@ -846,6 +841,13 @@ declare module BABYLON.GLTF2 {
     class ArrayItem {
         static Assign(values?: IArrayItem[]): void;
     }
+    class AnimationMultiTarget {
+        subTargets: any[];
+        position: Vector3;
+        rotationQuaternion: Quaternion;
+        scaling: Vector3;
+        influence: number;
+    }
 }
 
 
@@ -966,7 +968,6 @@ declare module BABYLON.GLTF2 {
         readonly onMeshLoadedObservable: Observable<AbstractMesh>;
         readonly onTextureLoadedObservable: Observable<BaseTexture>;
         readonly onMaterialLoadedObservable: Observable<Material>;
-        readonly onAnimationGroupLoadedObservable: Observable<AnimationGroup>;
         readonly onExtensionLoadedObservable: Observable<IGLTFLoaderExtension>;
         readonly onCompleteObservable: Observable<IGLTFLoader>;
         readonly state: Nullable<GLTFLoaderState>;
@@ -975,6 +976,7 @@ declare module BABYLON.GLTF2 {
             meshes: AbstractMesh[];
             particleSystems: ParticleSystem[];
             skeletons: Skeleton[];
+            animationGroups: AnimationGroup[];
         }>;
         loadAsync(scene: Scene, data: IGLTFLoaderData, rootUrl: string, onProgress?: (event: SceneLoaderProgressEvent) => void): Promise<void>;
         private _loadAsync(nodes, scene, data, rootUrl, onProgress?);
@@ -988,6 +990,7 @@ declare module BABYLON.GLTF2 {
         private _forEachPrimitive(node, callback);
         private _getMeshes();
         private _getSkeletons();
+        private _getAnimationGroups();
         private _startAnimations();
         _loadNodeAsync(context: string, node: ILoaderNode): Promise<void>;
         private _loadMeshAsync(context, node, mesh, babylonMesh);

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 3
dist/preview release/materialsLibrary/babylonjs.materials.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/serializers/babylon.glTF2Serializer.min.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/serializers/babylonjs.serializers.min.js


Разница между файлами не показана из-за своего большого размера
+ 58 - 58
dist/preview release/viewer/babylon.viewer.js


+ 173 - 59
dist/preview release/viewer/babylon.viewer.max.js

@@ -11358,7 +11358,7 @@ var BABYLON;
         });
         Object.defineProperty(Engine, "Version", {
             get: function () {
-                return "3.2.0-beta.2";
+                return "3.2.0-beta.3";
             },
             enumerable: true,
             configurable: true
@@ -23847,7 +23847,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeAnimation = function (toRemove) {
             var index = this.animations.indexOf(toRemove);
             if (index !== -1) {
@@ -23855,7 +23854,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given animation group from this scene.
+         * @param toRemove The animation group to remove
+         * @returns The index of the removed animation group
+         */
+        Scene.prototype.removeAnimationGroup = function (toRemove) {
+            var index = this.animationGroups.indexOf(toRemove);
+            if (index !== -1) {
+                this.animationGroups.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.removeMultiMaterial = function (toRemove) {
             var index = this.multiMaterials.indexOf(toRemove);
             if (index !== -1) {
@@ -23863,7 +23873,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeMaterial = function (toRemove) {
             var index = this.materials.indexOf(toRemove);
             if (index !== -1) {
@@ -23871,7 +23880,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeLensFlareSystem = function (toRemove) {
             var index = this.lensFlareSystems.indexOf(toRemove);
             if (index !== -1) {
@@ -23879,7 +23887,6 @@ var BABYLON;
             }
             return index;
         };
-        ;
         Scene.prototype.removeActionManager = function (toRemove) {
             var index = this._actionManagers.indexOf(toRemove);
             if (index !== -1) {
@@ -23887,7 +23894,18 @@ var BABYLON;
             }
             return index;
         };
-        ;
+        /**
+         * Removes the given texture from this scene.
+         * @param toRemove The texture to remove
+         * @returns The index of the removed texture
+         */
+        Scene.prototype.removeTexture = function (toRemove) {
+            var index = this.textures.indexOf(toRemove);
+            if (index !== -1) {
+                this.textures.splice(index, 1);
+            }
+            return index;
+        };
         Scene.prototype.addLight = function (newLight) {
             this.lights.push(newLight);
             this.sortLightsByPriority();
@@ -23919,6 +23937,13 @@ var BABYLON;
         Scene.prototype.addAnimation = function (newAnimation) {
             this.animations.push(newAnimation);
         };
+        /**
+         * Adds the given animation group to this scene.
+         * @param newAnimationGroup The animation group to add
+         */
+        Scene.prototype.addAnimationGroup = function (newAnimationGroup) {
+            this.animationGroups.push(newAnimationGroup);
+        };
         Scene.prototype.addMultiMaterial = function (newMultiMaterial) {
             this.multiMaterials.push(newMultiMaterial);
         };
@@ -23938,6 +23963,13 @@ var BABYLON;
             this._actionManagers.push(newActionManager);
         };
         /**
+         * Adds the given texture to this scene.
+         * @param newTexture The texture to add
+         */
+        Scene.prototype.addTexture = function (newTexture) {
+            this.textures.push(newTexture);
+        };
+        /**
          * Switch active camera
          * @param {Camera} newCamera - new active camera
          * @param {boolean} attachControl - call attachControl for the new active camera (default: true)
@@ -26091,6 +26123,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups to keep.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials to keep.
              */
             this.multiMaterials = new Array();
@@ -26126,6 +26162,10 @@ var BABYLON;
              * Sounds to keep.
              */
             this.sounds = new Array();
+            /**
+             * Textures to keep.
+             */
+            this.textures = new Array();
         }
         return KeepAssets;
     }());
@@ -26165,6 +26205,10 @@ var BABYLON;
              */
             this.animations = new Array();
             /**
+             * AnimationGroups populated in the container.
+             */
+            this.animationGroups = new Array();
+            /**
              * MultiMaterials populated in the container.
              */
             this.multiMaterials = new Array();
@@ -26200,6 +26244,10 @@ var BABYLON;
              * Sounds populated in the container.
              */
             this.sounds = new Array();
+            /**
+             * Textures populated in the container.
+             */
+            this.textures = new Array();
             this.scene = scene;
         }
         /**
@@ -26225,6 +26273,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.addAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.addAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.addMultiMaterial(o);
             });
@@ -26251,6 +26302,9 @@ var BABYLON;
                 o.autoplay = true;
                 _this.scene.mainSoundTrack.AddSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.addTexture;
+            });
         };
         /**
          * Removes all the assets in the container from the scene
@@ -26275,6 +26329,9 @@ var BABYLON;
             this.animations.forEach(function (o) {
                 _this.scene.removeAnimation(o);
             });
+            this.animationGroups.forEach(function (o) {
+                _this.scene.removeAnimationGroup(o);
+            });
             this.multiMaterials.forEach(function (o) {
                 _this.scene.removeMultiMaterial(o);
             });
@@ -26301,6 +26358,9 @@ var BABYLON;
                 o.autoplay = false;
                 _this.scene.mainSoundTrack.RemoveSound(o);
             });
+            this.textures.forEach(function (o) {
+                _this.scene.removeTexture(o);
+            });
         };
         AssetContainer.prototype._moveAssets = function (sourceAssets, targetAssets, keepAssets) {
             for (var _i = 0, sourceAssets_1 = sourceAssets; _i < sourceAssets_1.length; _i++) {
@@ -26332,6 +26392,7 @@ var BABYLON;
             this._moveAssets(this.scene.materials, this.materials, keepAssets.materials);
             this._moveAssets(this.scene._actionManagers, this.actionManagers, keepAssets.actionManagers);
             this._moveAssets(this.scene.animations, this.animations, keepAssets.animations);
+            this._moveAssets(this.scene.animationGroups, this.animationGroups, keepAssets.animationGroups);
             this._moveAssets(this.scene.lensFlareSystems, this.lensFlareSystems, keepAssets.lensFlareSystems);
             this._moveAssets(this.scene.lights, this.lights, keepAssets.lights);
             this._moveAssets(this.scene.morphTargetManagers, this.morphTargetManagers, keepAssets.morphTargetManagers);
@@ -26340,6 +26401,7 @@ var BABYLON;
             this._moveAssets(this.scene.particleSystems, this.particleSystems, keepAssets.particleSystems);
             this._moveAssets(this.scene.mainSoundTrack.soundCollection, this.sounds, keepAssets.sounds);
             this._moveAssets(this.scene.transformNodes, this.transformNodes, keepAssets.transformNodes);
+            this._moveAssets(this.scene.textures, this.textures, keepAssets.textures);
             this.removeAllFromScene();
         };
         return AssetContainer;
@@ -63277,11 +63339,11 @@ var BABYLON;
                     errorHandler("Error in onProgress callback", e);
                 }
             } : undefined;
-            var successHandler = function (meshes, particleSystems, skeletons) {
+            var successHandler = function (meshes, particleSystems, skeletons, animationGroups) {
                 scene.importedMeshesFiles.push(rootUrl + sceneFilename);
                 if (onSuccess) {
                     try {
-                        onSuccess(meshes, particleSystems, skeletons);
+                        onSuccess(meshes, particleSystems, skeletons, animationGroups);
                     }
                     catch (e) {
                         errorHandler("Error in onSuccess callback", e);
@@ -63307,13 +63369,13 @@ var BABYLON;
                         return;
                     }
                     scene.loadingPluginName = plugin.name;
-                    successHandler(meshes, particleSystems, skeletons);
+                    successHandler(meshes, particleSystems, skeletons, []);
                 }
                 else {
                     var asyncedPlugin = plugin;
                     asyncedPlugin.importMeshAsync(meshNames, scene, data, rootUrl, progressHandler).then(function (result) {
                         scene.loadingPluginName = plugin.name;
-                        successHandler(result.meshes, result.particleSystems, result.skeletons);
+                        successHandler(result.meshes, result.particleSystems, result.skeletons, result.animationGroups);
                     }).catch(function (error) {
                         errorHandler(error.message, error);
                     });
@@ -63328,17 +63390,18 @@ var BABYLON;
         * @param scene the instance of BABYLON.Scene to append to
         * @param onProgress a callback with a progress event for each file being loaded
         * @param pluginExtension the extension used to determine the plugin
-        * @returns The loaded list of imported meshes, particleSystems, and skeletons
+        * @returns The loaded list of imported meshes, particle systems, skeletons, and animation groups
         */
         SceneLoader.ImportMeshAsync = function (meshNames, rootUrl, sceneFilename, scene, onProgress, pluginExtension) {
             if (onProgress === void 0) { onProgress = null; }
             if (pluginExtension === void 0) { pluginExtension = null; }
             return new Promise(function (resolve, reject) {
-                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons) {
+                SceneLoader.ImportMesh(meshNames, rootUrl, sceneFilename, scene, function (meshes, particleSystems, skeletons, animationGroups) {
                     resolve({
                         meshes: meshes,
                         particleSystems: particleSystems,
-                        skeletons: skeletons
+                        skeletons: skeletons,
+                        animationGroups: animationGroups
                     });
                 }, onProgress, function (scene, message, exception) {
                     reject(exception || new Error(message));
@@ -94401,13 +94464,17 @@ var ModelLoader = (function () {
         var filename = babylonjs_1.Tools.GetFilename(modelConfiguration.url) || modelConfiguration.url;
         var base = modelConfiguration.root || babylonjs_1.Tools.GetFolderPath(modelConfiguration.url);
         var plugin = modelConfiguration.loader;
-        model.loader = babylonjs_1.SceneLoader.ImportMesh(undefined, base, filename, this._viewer.scene, function (meshes, particleSystems, skeletons) {
+        model.loader = babylonjs_1.SceneLoader.ImportMesh(undefined, base, filename, this._viewer.scene, function (meshes, particleSystems, skeletons, animationGroups) {
             meshes.forEach(function (mesh) {
                 babylonjs_1.Tags.AddTagsTo(mesh, "viewerMesh");
             });
             model.meshes = meshes;
             model.particleSystems = particleSystems;
             model.skeletons = skeletons;
+            for (var _i = 0, animationGroups_1 = animationGroups; _i < animationGroups_1.length; _i++) {
+                var animationGroup = animationGroups_1[_i];
+                model.addAnimationGroup(animationGroup);
+            }
             model.initAnimations();
             model.onLoadedObservable.notifyObserversWithPromise(model);
         }, function (progressEvent) {
@@ -94419,10 +94486,7 @@ var ModelLoader = (function () {
         }, plugin);
         if (model.loader.name === "gltf") {
             var gltfLoader = model.loader;
-            gltfLoader.animationStartMode = 0;
-            gltfLoader.onAnimationGroupLoaded = function (ag) {
-                model.addAnimationGroup(ag);
-            };
+            gltfLoader.animationStartMode = BABYLON.GLTFLoaderAnimationStartMode.NONE;
         }
         model.loadId = this._loadId++;
         this._loaders.push(model.loader);
@@ -96743,10 +96807,6 @@ var BABYLON;
              */
             this.onMaterialLoadedObservable = new BABYLON.Observable();
             /**
-             * Raised when the loader creates an animation group after parsing the glTF properties of the animation.
-             */
-            this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
-            /**
              * Raised when the asset is completely loaded, immediately before the loader is disposed.
              * For assets with LODs, raised when all of the LODs are complete.
              * For assets without LODs, raised when the model is complete, immediately after onSuccess.
@@ -96809,16 +96869,6 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
-        Object.defineProperty(GLTFFileLoader.prototype, "onAnimationGroupLoaded", {
-            set: function (callback) {
-                if (this._onAnimationGroupLoadedObserver) {
-                    this.onAnimationGroupLoadedObservable.remove(this._onAnimationGroupLoadedObserver);
-                }
-                this._onAnimationGroupLoadedObserver = this.onAnimationGroupLoadedObservable.add(callback);
-            },
-            enumerable: true,
-            configurable: true
-        });
         Object.defineProperty(GLTFFileLoader.prototype, "onComplete", {
             set: function (callback) {
                 if (this._onCompleteObserver) {
@@ -96911,6 +96961,7 @@ var BABYLON;
                     Array.prototype.push.apply(container.meshes, result.meshes);
                     Array.prototype.push.apply(container.particleSystems, result.particleSystems);
                     Array.prototype.push.apply(container.skeletons, result.skeletons);
+                    Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                     container.removeAllFromScene();
                     return container;
                 });
@@ -96972,7 +97023,6 @@ var BABYLON;
             loader.onTextureLoadedObservable.add(function (texture) { return _this.onTextureLoadedObservable.notifyObservers(texture); });
             loader.onMaterialLoadedObservable.add(function (material) { return _this.onMaterialLoadedObservable.notifyObservers(material); });
             loader.onExtensionLoadedObservable.add(function (extension) { return _this.onExtensionLoadedObservable.notifyObservers(extension); });
-            loader.onAnimationGroupLoadedObservable.add(function (animationGroup) { return _this.onAnimationGroupLoadedObservable.notifyObservers(animationGroup); });
             loader.onCompleteObservable.add(function () {
                 _this.onMeshLoadedObservable.clear();
                 _this.onTextureLoadedObservable.clear();
@@ -98537,7 +98587,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.state = null;
@@ -98592,12 +98641,12 @@ var BABYLON;
                             importMaterials(gltfRuntime);
                             postLoad(gltfRuntime);
                             if (!BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                                onSuccess(meshes, [], skeletons);
+                                onSuccess(meshes, skeletons);
                             }
                         });
                     }, onProgress);
                     if (BABYLON.GLTFFileLoader.IncrementalLoading && onSuccess) {
-                        onSuccess(meshes, [], skeletons);
+                        onSuccess(meshes, skeletons);
                     }
                 }, onError);
                 return true;
@@ -98605,11 +98654,12 @@ var BABYLON;
             GLTFLoader.prototype.importMeshAsync = function (meshesNames, scene, data, rootUrl, onProgress) {
                 var _this = this;
                 return new Promise(function (resolve, reject) {
-                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, particleSystems, skeletons) {
+                    _this._importMeshAsync(meshesNames, scene, data, rootUrl, function (meshes, skeletons) {
                         resolve({
                             meshes: meshes,
-                            particleSystems: particleSystems,
-                            skeletons: skeletons
+                            particleSystems: [],
+                            skeletons: skeletons,
+                            animationGroups: []
                         });
                     }, onProgress, function (message) {
                         reject(new Error(message));
@@ -99341,6 +99391,53 @@ var BABYLON;
             return ArrayItem;
         }());
         GLTF2.ArrayItem = ArrayItem;
+        var AnimationMultiTarget = /** @class */ (function () {
+            function AnimationMultiTarget() {
+                this.subTargets = new Array();
+            }
+            Object.defineProperty(AnimationMultiTarget.prototype, "position", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.position = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "rotationQuaternion", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.rotationQuaternion = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "scaling", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.scaling = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            Object.defineProperty(AnimationMultiTarget.prototype, "influence", {
+                set: function (value) {
+                    for (var _i = 0, _a = this.subTargets; _i < _a.length; _i++) {
+                        var subTarget = _a[_i];
+                        subTarget.influence = value;
+                    }
+                },
+                enumerable: true,
+                configurable: true
+            });
+            return AnimationMultiTarget;
+        }());
+        GLTF2.AnimationMultiTarget = AnimationMultiTarget;
     })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
 })(BABYLON || (BABYLON = {}));
 
@@ -99376,7 +99473,6 @@ var BABYLON;
                 this.onMeshLoadedObservable = new BABYLON.Observable();
                 this.onTextureLoadedObservable = new BABYLON.Observable();
                 this.onMaterialLoadedObservable = new BABYLON.Observable();
-                this.onAnimationGroupLoadedObservable = new BABYLON.Observable();
                 this.onExtensionLoadedObservable = new BABYLON.Observable();
                 this.onCompleteObservable = new BABYLON.Observable();
             }
@@ -99433,6 +99529,7 @@ var BABYLON;
                             meshes: _this._getMeshes(),
                             particleSystems: [],
                             skeletons: _this._getSkeletons(),
+                            animationGroups: _this._getAnimationGroups()
                         };
                     });
                 });
@@ -99653,25 +99750,37 @@ var BABYLON;
                 }
                 return skeletons;
             };
-            GLTFLoader.prototype._startAnimations = function () {
+            GLTFLoader.prototype._getAnimationGroups = function () {
+                var animationGroups = new Array();
                 var animations = this._gltf.animations;
-                if (!animations) {
-                    return;
+                if (animations) {
+                    for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
+                        var animation = animations_1[_i];
+                        if (animation._babylonAnimationGroup) {
+                            animationGroups.push(animation._babylonAnimationGroup);
+                        }
+                    }
                 }
+                return animationGroups;
+            };
+            GLTFLoader.prototype._startAnimations = function () {
                 switch (this.animationStartMode) {
                     case BABYLON.GLTFLoaderAnimationStartMode.NONE: {
                         // do nothing
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.FIRST: {
-                        var animation = animations[0];
-                        animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        if (babylonAnimationGroups.length !== 0) {
+                            babylonAnimationGroups[0].start(true);
+                        }
                         break;
                     }
                     case BABYLON.GLTFLoaderAnimationStartMode.ALL: {
-                        for (var _i = 0, animations_1 = animations; _i < animations_1.length; _i++) {
-                            var animation = animations_1[_i];
-                            animation._babylonAnimationGroup.start(true);
+                        var babylonAnimationGroups = this._getAnimationGroups();
+                        for (var _i = 0, babylonAnimationGroups_1 = babylonAnimationGroups; _i < babylonAnimationGroups_1.length; _i++) {
+                            var babylonAnimationGroup = babylonAnimationGroups_1[_i];
+                            babylonAnimationGroup.start(true);
                         }
                         break;
                     }
@@ -99961,6 +100070,8 @@ var BABYLON;
                     _this._forEachPrimitive(node, function (babylonMesh) {
                         babylonMesh.skeleton = skin._babylonSkeleton;
                     });
+                    // Ignore the TRS of skinned nodes.
+                    // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
                     node._babylonMesh.parent = _this._rootBabylonMesh;
                     node._babylonMesh.position = BABYLON.Vector3.Zero();
                     node._babylonMesh.rotationQuaternion = BABYLON.Quaternion.Identity();
@@ -100050,7 +100161,6 @@ var BABYLON;
                     var channel = _a[_i];
                     promises.push(this._loadAnimationChannelAsync(context + "/channels/" + channel._index, context, animation, channel, babylonAnimationGroup));
                 }
-                this.onAnimationGroupLoadedObservable.notifyObservers(babylonAnimationGroup);
                 return Promise.all(promises).then(function () {
                     babylonAnimationGroup.normalize();
                 });
@@ -100058,7 +100168,12 @@ var BABYLON;
             GLTFLoader.prototype._loadAnimationChannelAsync = function (context, animationContext, animation, channel, babylonAnimationGroup) {
                 var _this = this;
                 var targetNode = GLTFLoader._GetProperty(context + "/target/node", this._gltf.nodes, channel.target.node);
-                if (!targetNode._babylonMesh || targetNode.skin != undefined) {
+                if (!targetNode._babylonMesh) {
+                    return Promise.resolve();
+                }
+                // Ignore animations targeting TRS of skinned nodes.
+                // See https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins (second implementation note)
+                if (targetNode.skin != undefined && channel.target.path !== "weights" /* WEIGHTS */) {
                     return Promise.resolve();
                 }
                 var sampler = GLTFLoader._GetProperty(context + "/sampler", animation.samplers, channel.sampler);
@@ -100169,10 +100284,12 @@ var BABYLON;
                                 value: key.value[targetIndex],
                                 outTangent: key.outTangent ? key.outTangent[targetIndex] : undefined
                             }); }));
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             _this._forEachPrimitive(targetNode, function (babylonMesh) {
                                 var morphTarget = babylonMesh.morphTargetManager.getTarget(targetIndex);
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, morphTarget);
+                                multiTarget.subTargets.push(morphTarget);
                             });
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         };
                         for (var targetIndex = 0; targetIndex < targetNode._numMorphTargets; targetIndex++) {
                             _loop_1(targetIndex);
@@ -100183,10 +100300,12 @@ var BABYLON;
                         var babylonAnimation = new BABYLON.Animation(animationName, targetPath, 1, animationType);
                         babylonAnimation.setKeys(keys);
                         if (targetNode._babylonAnimationTargets) {
+                            var multiTarget = new GLTF2.AnimationMultiTarget();
                             for (var _i = 0, _a = targetNode._babylonAnimationTargets; _i < _a.length; _i++) {
                                 var target = _a[_i];
-                                babylonAnimationGroup.addTargetedAnimation(babylonAnimation, target);
+                                multiTarget.subTargets.push(target);
                             }
+                            babylonAnimationGroup.addTargetedAnimation(babylonAnimation, multiTarget);
                         }
                     }
                 });
@@ -101239,12 +101358,7 @@ var BABYLON;
 //# sourceMappingURL=KHR_lights.js.map
 
     
-//backwards compatibility
-if(typeof earcut !== 'undefined') {
-    globalObject["Earcut"] = {
-        earcut: earcut
-    };
-}
+
     return BABYLON;
 });