David Catuhe %!s(int64=7) %!d(string=hai) anos
pai
achega
20238432a3

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 6574 - 6552
Playground/babylon.d.txt


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 6635 - 6613
dist/preview release/babylon.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 36 - 36
dist/preview release/babylon.js


+ 61 - 11
dist/preview release/babylon.max.js

@@ -18369,6 +18369,12 @@ var BABYLON;
             * @type {BABYLON.AbstractMesh[]}
             */
             this.meshes = new Array();
+            /**
+            * All of the animation groups added to this scene.
+            * @see BABYLON.AnimationGroup
+            * @type {BABYLON.AnimationGroup[]}
+            */
+            this.animationGroups = new Array();
             // Geometries
             this._geometries = new Array();
             this.materials = new Array();
@@ -20018,6 +20024,19 @@ var BABYLON;
             return null;
         };
         /**
+         * get an animation group using its name
+         * @param {string} the material's name
+         * @return {BABYLON.AnimationGroup|null} the animation group or null if none found.
+         */
+        Scene.prototype.getAnimationGroupByName = function (name) {
+            for (var index = 0; index < this.animationGroups.length; index++) {
+                if (this.animationGroups[index].name === name) {
+                    return this.animationGroups[index];
+                }
+            }
+            return null;
+        };
+        /**
          * get a material using its id
          * @param {string} the material's ID
          * @return {BABYLON.Material|null} the material or null if none found.
@@ -21192,6 +21211,7 @@ var BABYLON;
             this.afterRender = null;
             this.skeletons = [];
             this.morphTargetManagers = [];
+            this.animationGroups = [];
             this.importedMeshesFiles = new Array();
             this.stopAllAnimations();
             this.resetCachedMaterial();
@@ -41832,8 +41852,41 @@ var BABYLON;
 var BABYLON;
 (function (BABYLON) {
     var AnimationGroup = /** @class */ (function () {
-        function AnimationGroup() {
+        function AnimationGroup(name, scene) {
+            if (scene === void 0) { scene = null; }
+            this.name = name;
+            // private _animations = new Array<Animation>();
+            // private _targets = new Array<Object>()
+            // private _animatables: Animatable[];
+            // private _from: number;
+            // private _to: number;
+            this.onAnimationEndObservable = new BABYLON.Observable();
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
+            this._scene.animationGroups.push(this);
         }
+        AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
+            return this;
+        };
+        AnimationGroup.prototype.start = function (loop, speedRatio) {
+            // for (var index = 0; index < this._animations) {
+            //     this._scene.beginDirectAnimation(this._targets[index], [this._animations[index]], this._from, this._to, loop, speedRatio, () => {
+            if (loop === void 0) { loop = false; }
+            if (speedRatio === void 0) { speedRatio = 1; }
+            //     });
+            // }
+            return this;
+        };
+        AnimationGroup.prototype.pause = function () {
+            return this;
+        };
+        AnimationGroup.prototype.restart = function () {
+            return this;
+        };
+        AnimationGroup.prototype.stop = function () {
+            return this;
+        };
+        AnimationGroup.prototype.dispose = function () {
+        };
         return AnimationGroup;
     }());
     BABYLON.AnimationGroup = AnimationGroup;
@@ -54677,12 +54730,10 @@ var BABYLON;
             });
         };
         FilesInput.prototype._processFiles = function (files) {
-            var skippedFiles = 0;
             for (var i = 0; i < files.length; i++) {
                 var name = files[i].correctName.toLowerCase();
                 var extension = name.split('.').pop();
                 if (!this.onProcessFileCallback(files[i], name, extension)) {
-                    skippedFiles++;
                     continue;
                 }
                 if ((extension === "babylon" || extension === "stl" || extension === "obj" || extension === "gltf" || extension === "glb")
@@ -54693,12 +54744,6 @@ var BABYLON;
                     FilesInput.FilesToLoad[name] = files[i];
                 }
             }
-            if (this._onReloadCallback) {
-                this._onReloadCallback(this._sceneFileToLoad);
-            }
-            else if (skippedFiles < files.length) {
-                this.reload();
-            }
         };
         FilesInput.prototype.loadFiles = function (event) {
             var _this = this;
@@ -54754,16 +54799,21 @@ var BABYLON;
                         });
                     }
                 }
+                if (this._onReloadCallback) {
+                    this._onReloadCallback(this._sceneFileToLoad);
+                }
+                else {
+                    this.reload();
+                }
             }
         };
         FilesInput.prototype.reload = function () {
             var _this = this;
-            // If a ".babylon" file has been provided
+            // If a scene file has been provided
             if (this._sceneFileToLoad) {
                 if (this._currentScene) {
                     if (BABYLON.Tools.errorsCount > 0) {
                         BABYLON.Tools.ClearLogCache();
-                        BABYLON.Tools.Log("Babylon.js engine (v" + BABYLON.Engine.Version + ") launched");
                     }
                     this._engine.stopRenderLoop();
                     this._currentScene.dispose();

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 36 - 36
dist/preview release/babylon.worker.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 36 - 36
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 61 - 11
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -18369,6 +18369,12 @@ var BABYLON;
             * @type {BABYLON.AbstractMesh[]}
             */
             this.meshes = new Array();
+            /**
+            * All of the animation groups added to this scene.
+            * @see BABYLON.AnimationGroup
+            * @type {BABYLON.AnimationGroup[]}
+            */
+            this.animationGroups = new Array();
             // Geometries
             this._geometries = new Array();
             this.materials = new Array();
@@ -20018,6 +20024,19 @@ var BABYLON;
             return null;
         };
         /**
+         * get an animation group using its name
+         * @param {string} the material's name
+         * @return {BABYLON.AnimationGroup|null} the animation group or null if none found.
+         */
+        Scene.prototype.getAnimationGroupByName = function (name) {
+            for (var index = 0; index < this.animationGroups.length; index++) {
+                if (this.animationGroups[index].name === name) {
+                    return this.animationGroups[index];
+                }
+            }
+            return null;
+        };
+        /**
          * get a material using its id
          * @param {string} the material's ID
          * @return {BABYLON.Material|null} the material or null if none found.
@@ -21192,6 +21211,7 @@ var BABYLON;
             this.afterRender = null;
             this.skeletons = [];
             this.morphTargetManagers = [];
+            this.animationGroups = [];
             this.importedMeshesFiles = new Array();
             this.stopAllAnimations();
             this.resetCachedMaterial();
@@ -41832,8 +41852,41 @@ var BABYLON;
 var BABYLON;
 (function (BABYLON) {
     var AnimationGroup = /** @class */ (function () {
-        function AnimationGroup() {
+        function AnimationGroup(name, scene) {
+            if (scene === void 0) { scene = null; }
+            this.name = name;
+            // private _animations = new Array<Animation>();
+            // private _targets = new Array<Object>()
+            // private _animatables: Animatable[];
+            // private _from: number;
+            // private _to: number;
+            this.onAnimationEndObservable = new BABYLON.Observable();
+            this._scene = scene || BABYLON.Engine.LastCreatedScene;
+            this._scene.animationGroups.push(this);
         }
+        AnimationGroup.prototype.normalize = function (beginFrame, endFrame) {
+            return this;
+        };
+        AnimationGroup.prototype.start = function (loop, speedRatio) {
+            // for (var index = 0; index < this._animations) {
+            //     this._scene.beginDirectAnimation(this._targets[index], [this._animations[index]], this._from, this._to, loop, speedRatio, () => {
+            if (loop === void 0) { loop = false; }
+            if (speedRatio === void 0) { speedRatio = 1; }
+            //     });
+            // }
+            return this;
+        };
+        AnimationGroup.prototype.pause = function () {
+            return this;
+        };
+        AnimationGroup.prototype.restart = function () {
+            return this;
+        };
+        AnimationGroup.prototype.stop = function () {
+            return this;
+        };
+        AnimationGroup.prototype.dispose = function () {
+        };
         return AnimationGroup;
     }());
     BABYLON.AnimationGroup = AnimationGroup;
@@ -54523,12 +54576,10 @@ var BABYLON;
             });
         };
         FilesInput.prototype._processFiles = function (files) {
-            var skippedFiles = 0;
             for (var i = 0; i < files.length; i++) {
                 var name = files[i].correctName.toLowerCase();
                 var extension = name.split('.').pop();
                 if (!this.onProcessFileCallback(files[i], name, extension)) {
-                    skippedFiles++;
                     continue;
                 }
                 if ((extension === "babylon" || extension === "stl" || extension === "obj" || extension === "gltf" || extension === "glb")
@@ -54539,12 +54590,6 @@ var BABYLON;
                     FilesInput.FilesToLoad[name] = files[i];
                 }
             }
-            if (this._onReloadCallback) {
-                this._onReloadCallback(this._sceneFileToLoad);
-            }
-            else if (skippedFiles < files.length) {
-                this.reload();
-            }
         };
         FilesInput.prototype.loadFiles = function (event) {
             var _this = this;
@@ -54600,16 +54645,21 @@ var BABYLON;
                         });
                     }
                 }
+                if (this._onReloadCallback) {
+                    this._onReloadCallback(this._sceneFileToLoad);
+                }
+                else {
+                    this.reload();
+                }
             }
         };
         FilesInput.prototype.reload = function () {
             var _this = this;
-            // If a ".babylon" file has been provided
+            // If a scene file has been provided
             if (this._sceneFileToLoad) {
                 if (this._currentScene) {
                     if (BABYLON.Tools.errorsCount > 0) {
                         BABYLON.Tools.ClearLogCache();
-                        BABYLON.Tools.Log("Babylon.js engine (v" + BABYLON.Engine.Version + ") launched");
                     }
                     this._engine.stopRenderLoop();
                     this._currentScene.dispose();

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 37 - 37
dist/preview release/viewer/babylon.viewer.js


+ 46 - 1
src/Animations/babylon.animationGroup.ts

@@ -1,4 +1,49 @@
 module BABYLON {
-    export class AnimationGroup {
+    export class AnimationGroup implements IDisposable {
+        private _scene: Scene;
+
+        // private _animations = new Array<Animation>();
+        // private _targets = new Array<Object>()
+        // private _animatables: Animatable[];
+        // private _from: number;
+        // private _to: number;
+
+        public onAnimationEndObservable = new Observable<Animation>();
+
+        public constructor(public name: string, scene: Nullable<Scene> = null) {
+            this._scene = scene || Engine.LastCreatedScene!;
+
+            this._scene.animationGroups.push(this);
+        }
+
+        public normalize(beginFrame: number, endFrame: number): AnimationGroup {
+            return this;
+        }
+
+        public start(loop = false, speedRatio = 1): AnimationGroup {
+            // for (var index = 0; index < this._animations) {
+            //     this._scene.beginDirectAnimation(this._targets[index], [this._animations[index]], this._from, this._to, loop, speedRatio, () => {
+
+            //     });
+            // }
+
+            return this;
+        }
+
+        public pause(): AnimationGroup {
+            return this;
+        }
+
+        public restart(): AnimationGroup {
+            return this;
+        }
+
+        public stop(): AnimationGroup {
+            return this;
+        }
+
+        public dispose(): void {
+
+        }
     }
 }

+ 16 - 18
src/Tools/babylon.filesInput.ts

@@ -1,6 +1,6 @@
 module BABYLON {
     export class FilesInput {
-        public static FilesToLoad: {[key: string]: File} = {};
+        public static FilesToLoad: { [key: string]: File } = {};
 
         public onProcessFileCallback: (file: File, name: string, extension: string) => true = () => { return true; };
 
@@ -18,8 +18,8 @@
         private _sceneFileToLoad: File;
         private _filesToLoad: File[];
 
-        constructor(engine: Engine, scene: Scene, sceneLoadedCallback: (sceneFile: File, scene: Scene) => void, progressCallback: (progress: ProgressEvent) => void, additionalRenderLoopLogicCallback: () => void, 
-                    textureLoadingCallback: (remaining: number) => void, startingProcessingFilesCallback: () => void, onReloadCallback: (sceneFile: File) => void, errorCallback: (sceneFile: File, scene: Scene, message: string) => void) {
+        constructor(engine: Engine, scene: Scene, sceneLoadedCallback: (sceneFile: File, scene: Scene) => void, progressCallback: (progress: ProgressEvent) => void, additionalRenderLoopLogicCallback: () => void,
+            textureLoadingCallback: (remaining: number) => void, startingProcessingFilesCallback: () => void, onReloadCallback: (sceneFile: File) => void, errorCallback: (sceneFile: File, scene: Scene, message: string) => void) {
             this._engine = engine;
             this._currentScene = scene;
 
@@ -57,7 +57,7 @@
 
             this._elementToMonitor.removeEventListener("dragenter", this._dragEnterHandler);
             this._elementToMonitor.removeEventListener("dragover", this._dragOverHandler);
-            this._elementToMonitor.removeEventListener("drop", this._dropHandler);            
+            this._elementToMonitor.removeEventListener("drop", this._dropHandler);
         }
 
         private renderFunction(): void {
@@ -96,7 +96,7 @@
                 remaining.count += entries.length;
                 for (let entry of entries) {
                     if (entry.isFile) {
-                        entry.file((file:any) => {
+                        entry.file((file: any) => {
                             file.correctName = relativePath + file.name;
                             files.push(file);
 
@@ -117,17 +117,15 @@
         }
 
         private _processFiles(files: Array<any>): void {
-            var skippedFiles = 0;
             for (var i = 0; i < files.length; i++) {
                 var name = files[i].correctName.toLowerCase();
                 var extension = name.split('.').pop();
 
                 if (!this.onProcessFileCallback(files[i], name, extension)) {
-                    skippedFiles++;
                     continue;
                 }
 
-                if ((extension === "babylon" || extension === "stl" || extension === "obj" || extension === "gltf" || extension === "glb") 
+                if ((extension === "babylon" || extension === "stl" || extension === "obj" || extension === "gltf" || extension === "glb")
                     && name.indexOf(".binary.babylon") === -1 && name.indexOf(".incremental.babylon") === -1) {
                     this._sceneFileToLoad = files[i];
                 }
@@ -135,13 +133,6 @@
                     FilesInput.FilesToLoad[name] = files[i];
                 }
             }
-
-            if (this._onReloadCallback) {
-                this._onReloadCallback(this._sceneFileToLoad);
-            }
-            else if (skippedFiles < files.length) {
-                this.reload();
-            }
         }
 
         public loadFiles(event: any): void {
@@ -163,7 +154,7 @@
                 var items = event.dataTransfer ? event.dataTransfer.items : null;
 
                 for (var i = 0; i < this._filesToLoad.length; i++) {
-                    let fileToLoad:any =  this._filesToLoad[i];
+                    let fileToLoad: any = this._filesToLoad[i];
                     let name = fileToLoad.name.toLowerCase();
                     let entry;
 
@@ -199,16 +190,23 @@
                         });
                     }
                 }
+
+                if (this._onReloadCallback) {
+                    this._onReloadCallback(this._sceneFileToLoad);
+                }
+                else {
+                    this.reload();
+                }
+
             }
         }
 
         public reload() {
-            // If a ".babylon" file has been provided
+            // If a scene file has been provided
             if (this._sceneFileToLoad) {
                 if (this._currentScene) {
                     if (Tools.errorsCount > 0) {
                         Tools.ClearLogCache();
-                        Tools.Log("Babylon.js engine (v" + Engine.Version + ") launched");
                     }
                     this._engine.stopRenderLoop();
                     this._currentScene.dispose();

+ 23 - 0
src/babylon.scene.ts

@@ -691,6 +691,13 @@
         */
         public meshes = new Array<AbstractMesh>();
 
+        /**
+        * All of the animation groups added to this scene.
+        * @see BABYLON.AnimationGroup
+        * @type {BABYLON.AnimationGroup[]}
+        */
+        public animationGroups = new Array<AnimationGroup>();
+
         // Geometries
         private _geometries = new Array<Geometry>();
 
@@ -2337,6 +2344,21 @@
         }
 
         /**
+         * get an animation group using its name
+         * @param {string} the material's name
+         * @return {BABYLON.AnimationGroup|null} the animation group or null if none found.
+         */
+        public getAnimationGroupByName(name: string): Nullable<AnimationGroup> {
+            for (var index = 0; index < this.animationGroups.length; index++) {
+                if (this.animationGroups[index].name === name) {
+                    return this.animationGroups[index];
+                }
+            }
+
+            return null;
+        }
+
+        /**
          * get a material using its id
          * @param {string} the material's ID
          * @return {BABYLON.Material|null} the material or null if none found.
@@ -3755,6 +3777,7 @@
 
             this.skeletons = [];
             this.morphTargetManagers = [];
+            this.animationGroups = [];
 
             this.importedMeshesFiles = new Array<string>();