Quellcode durchsuchen

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

Guide vor 6 Jahren
Ursprung
Commit
1b52237c32
100 geänderte Dateien mit 10622 neuen und 4075 gelöschten Zeilen
  1. 2 1
      .vscode/settings.json
  2. 1308 558
      Playground/babylon.d.txt
  3. 2 1
      Playground/full.html
  4. 7 5
      Tools/Config/config.js
  5. 35 8
      Tools/Config/config.json
  6. 17 0
      Tools/Gulp/helpers/gulp-processAmdDeclarationToModule.js
  7. 1 0
      Tools/Gulp/tasks/gulpTasks-libraries.js
  8. 15 13
      Tools/Gulp/tasks/gulpTasks-librariesES6.js
  9. 0 1
      Tools/Gulp/tasks/gulpTasks-viewerLibraries.js
  10. 1 1
      Tools/Publisher/tasks/prepareEs6DevPackages.js
  11. 4 1
      Tools/Publisher/tasks/processEs6Packages.js
  12. 1 1
      Tools/Publisher/tasks/processUMDViewer.js
  13. 0 2
      Tools/WebpackPlugins/babylonWebpackConfig.js
  14. 27 0
      Tools/WebpackPlugins/viewerResolve.js
  15. 35 0
      Viewer/README-ES6.md
  16. BIN
      Viewer/dist/external/msft/EnvMap_3.0-256.env
  17. 255 0
      Viewer/dist/renderOnlyViewer.html
  18. 2 0
      Viewer/package.json
  19. 1 1
      Viewer/src/configuration/configuration.ts
  20. 2 1
      Viewer/src/configuration/configurationContainer.ts
  21. 1 1
      Viewer/src/configuration/globals.ts
  22. 1 1
      Viewer/src/configuration/interfaces/defaultRenderingPipelineConfiguration.ts
  23. 5 134
      Viewer/src/configuration/loader.ts
  24. 1 1
      Viewer/src/configuration/mappers.ts
  25. 164 0
      Viewer/src/configuration/renderOnlyLoader.ts
  26. 5 4
      Viewer/src/configuration/types/default.ts
  27. 1 1
      Viewer/src/configuration/types/environmentMap.ts
  28. 1 1
      Viewer/src/configuration/types/extended.ts
  29. 1 2
      Viewer/src/configuration/types/minimal.ts
  30. 32 0
      Viewer/src/configuration/types/renderOnlyDefault.ts
  31. 2 1
      Viewer/src/labs/environmentSerializer.ts
  32. 6 1
      Viewer/src/labs/texture.ts
  33. 5 2
      Viewer/src/labs/viewerLabs.ts
  34. 6 3
      Viewer/src/loader/modelLoader.ts
  35. 2 2
      Viewer/src/loader/plugins/applyMaterialConfig.ts
  36. 3 2
      Viewer/src/loader/plugins/extendedMaterialLoaderPlugin.ts
  37. 1 1
      Viewer/src/loader/plugins/index.ts
  38. 6 2
      Viewer/src/loader/plugins/loaderPlugin.ts
  39. 3 3
      Viewer/src/loader/plugins/msftLodLoaderPlugin.ts
  40. 2 1
      Viewer/src/loader/plugins/telemetryLoaderPlugin.ts
  41. 4 1
      Viewer/src/managers/observablesManager.ts
  42. 75 20
      Viewer/src/managers/sceneManager.ts
  43. 3 1
      Viewer/src/managers/telemetryManager.ts
  44. 4 3
      Viewer/src/model/modelAnimation.ts
  45. 17 2
      Viewer/src/model/viewerModel.ts
  46. 2 1
      Viewer/src/optimizer/custom/extended.ts
  47. 18 0
      Viewer/src/renderOnlyIndex.ts
  48. 1 1
      Viewer/src/templating/plugins/printButton.ts
  49. 2 2
      Viewer/src/templating/templateManager.ts
  50. 34 6
      Viewer/src/viewer/defaultViewer.ts
  51. 30 0
      Viewer/src/viewer/renderOnlyViewer.ts
  52. 18 16
      Viewer/src/viewer/viewer.ts
  53. 1 1
      Viewer/src/viewer/viewerManager.ts
  54. 12 0
      Viewer/src/viewer/viewerWithTemplate.ts
  55. 0 43
      Viewer/tests/unit/src/configuration/updateConfiguration.ts
  56. 6 1
      Viewer/tests/unit/webpack.config.js
  57. 3 3
      Viewer/tsconfig.json
  58. 10 46
      Viewer/webpack.config.js
  59. 6 1
      Viewer/webpack.gulp.config.js
  60. BIN
      assets/environments/correlatedBRDF.dds
  61. BIN
      assets/environments/correlatedBRDF.png
  62. BIN
      assets/environments/correlatedBRDFRGBA.png
  63. BIN
      assets/environments/correlatedMSBRDF.dds
  64. BIN
      assets/environments/correlatedMSBRDF.png
  65. BIN
      assets/environments/correlatedMSBRDFRGBA.png
  66. BIN
      assets/environments/uncorrelatedBRDF.dds
  67. BIN
      assets/environments/uncorrelatedBRDF.png
  68. BIN
      assets/environments/uncorrelatedBRDFRGB.png
  69. 1158 555
      dist/preview release/babylon.d.ts
  70. 2 2
      dist/preview release/babylon.js
  71. 1975 742
      dist/preview release/babylon.max.js
  72. 1 1
      dist/preview release/babylon.max.js.map
  73. 2253 1020
      dist/preview release/babylon.module.d.ts
  74. 1 1
      dist/preview release/glTF2Interface/package.json
  75. 2 1
      dist/preview release/gui/babylon.gui.d.ts
  76. 54 47
      dist/preview release/gui/babylon.gui.js
  77. 1 1
      dist/preview release/gui/babylon.gui.js.map
  78. 1 1
      dist/preview release/gui/babylon.gui.min.js
  79. 4 2
      dist/preview release/gui/babylon.gui.module.d.ts
  80. 2 2
      dist/preview release/gui/package.json
  81. 7 7
      dist/preview release/inspector/babylon.inspector.bundle.js
  82. 2153 637
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  83. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  84. 157 26
      dist/preview release/inspector/babylon.inspector.d.ts
  85. 396 62
      dist/preview release/inspector/babylon.inspector.module.d.ts
  86. 6 6
      dist/preview release/inspector/package.json
  87. 1 1
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  88. 2 2
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  89. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  90. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  91. 3 3
      dist/preview release/loaders/babylon.glTFFileLoader.js
  92. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  93. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  94. 81 19
      dist/preview release/loaders/babylon.objFileLoader.js
  95. 1 1
      dist/preview release/loaders/babylon.objFileLoader.js.map
  96. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  97. 61 2
      dist/preview release/loaders/babylonjs.loaders.d.ts
  98. 84 22
      dist/preview release/loaders/babylonjs.loaders.js
  99. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  100. 0 0
      dist/preview release/loaders/babylonjs.loaders.min.js

+ 2 - 1
.vscode/settings.json

@@ -17,8 +17,9 @@
         "materialsLibrary/**/*.d.ts": true,
         "postProcessesLibrary/**/*.d.ts": true,
         "proceduralTexturesLibrary/**/*.d.ts": true,
-        "serielazers/**/*.d.ts": true,
+        "serializers/**/*.d.ts": true,
         "Viewer/**/*.d.ts": true,
+        "src/**/*.js.map": true,
         "gui/**/*.js.map": true,
         "inspector/**/*.js.map": true,
         "loaders/**/*.js.map": true,

Datei-Diff unterdrückt, da er zu groß ist
+ 1308 - 558
Playground/babylon.d.txt


+ 2 - 1
Playground/full.html

@@ -50,7 +50,8 @@
     </head>
 
     <body>
-        <canvas touch-action="none" id="renderCanvas" tabindex="1"></canvas>
+        <!-- Override frame style -->
+        <canvas touch-action="none" id="renderCanvas" tabindex="1" style="height: 100%"></canvas>
         <script src="https://code.jquery.com/jquery.js"></script>
         <script src="js/frame.js"></script>
 

+ 7 - 5
Tools/Config/config.js

@@ -52,7 +52,7 @@ config.additionalNpmPackages.forEach(package => {
     };
 });
 
-config.modules.map(function(module) {
+config.es6modules.map(function(module) {
     const settings = config[module];
 
     const mainDirectory = path.resolve(rootFolder, settings.build.mainFolder);
@@ -103,11 +103,13 @@ config.modules.map(function(module) {
         const tsGlob = srcDirectory.replace(/\\/g, "/") + "/**/*.ts*";
 
         for (let library of settings.libraries) {
-            const entryPath = path.join(srcDirectory, library.entry);
+            if(library.entry){
+                const entryPath = path.join(srcDirectory, library.entry);
 
-            library.computed = {
-                entryPath
-            };
+                library.computed = {
+                    entryPath
+                };
+            }
         }
 
         settings.computed.srcDirectory = srcDirectory;

+ 35 - 8
Tools/Config/config.json

@@ -47,6 +47,17 @@
         "gui",
         "inspector"
     ],
+    "es6modules": [
+        "core",
+        "materialsLibrary",
+        "postProcessesLibrary",
+        "proceduralTexturesLibrary",
+        "loaders",
+        "serializers",
+        "gui",
+        "inspector",
+        "viewer"
+    ],
     "lintModules": [
         "core",
         "materialsLibrary",
@@ -105,7 +116,8 @@
                             "path": "babylonjs/Debug/skeletonViewer",
                             "namespace": "BABYLON.Debug"
                         }
-                    ]
+                    ],
+                    "hiddenConsts": ["Debug"]
                 },
                 "requiredFiles": [
                     "readme.md"
@@ -246,6 +258,11 @@
                 "output": "babylon.digitalRainPostProcess.min.js",
                 "entry": "./legacy/legacy-digitalRain.ts",
                 "preventLoadLibrary": true
+            },
+            {
+                "output": "babylon.oceanPostProcess.min.js",
+                "entry": "./legacy/legacy-ocean.ts",
+                "preventLoadLibrary": true
             }
         ],
         "build": {
@@ -543,12 +560,11 @@
                 }
             },
             "es6": {
-                "webpackBuild": {
-                    "dependencies": [
-                        "node_modules/re-resizable/lib/index.es5.js",
-                        "Tools/**/*"
-                    ]
-                },
+                "webpackBuild": true,
+                "buildDependencies": [
+                    "node_modules/re-resizable/lib/index.es5.js",
+                    "Tools/**/*"
+                ],
                 "packageName": "@babylonjs/inspector",
                 "readme": "dist/preview release/inspector/readme-es6.md",
                 "packagesFiles": [
@@ -574,6 +590,7 @@
             }
         ],
         "build": {
+            "mainFolder": "./Viewer/",
             "webpack": "../../../Viewer/webpack.gulp.config.js",
             "distOutputDirectory": "/viewer/",
             "dtsBundle": {
@@ -635,7 +652,17 @@
                     ]
                 }
             ],
-            "legacyPackageOutputDirectory": "../../../Viewer/build/src/"
+            "legacyPackageOutputDirectory": "../../../Viewer/build/src/",
+            "es6": {
+                "buildDependencies": [
+                    "node_modules/handlebars/**/*",
+                    "node_modules/@types/**/*"
+                ],
+                "packageName": "@babylonjs/viewer",
+                "readme": "Viewer/README-ES6.md",
+                "skipLibCheck": true,
+                "packageBuildFolder": "src"
+            }
         }
     },
     "viewer-assets": {

+ 17 - 0
Tools/Gulp/helpers/gulp-processAmdDeclarationToModule.js

@@ -119,6 +119,23 @@ var processData = function(data, options) {
         str = str.replace(/^\s*$/gm, "");
     }
 
+    // Hide Exported Consts if necessary
+    if (options.hiddenConsts) {
+        for (let toHide of options.hiddenConsts) {
+            var constStart = str.indexOf(`export const ${toHide}`);
+            if (constStart > -1) {
+                for (let i = constStart; i < str.length; i++) {
+                    if (str[i] === "}") {
+                        // +1 to enroll the last }
+                        // +2 to enroll the trailing ;
+                        str = str.substr(0, constStart) + str.substr(i + 2);
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
     // Add Entry point.
     str += `
 declare module "${moduleName}" {

+ 1 - 0
Tools/Gulp/tasks/gulpTasks-libraries.js

@@ -134,6 +134,7 @@ var processDTSFiles = function(libraries, settings, cb) {
             moduleName: commandLineOptions.moduleName || settings.build.umd.packageName,
             entryPoint: library.entry,
             externals: settings.build.umd.processDeclaration.classMap,
+            hiddenConsts: settings.build.umd.processDeclaration.hiddenConsts
         });
 
         // Convert Module to Namespace for globals

+ 15 - 13
Tools/Gulp/tasks/gulpTasks-librariesES6.js

@@ -68,8 +68,8 @@ var dep = function(settings) {
         }
     }
 
-    if (settings.build.es6.webpackBuild && settings.build.es6.webpackBuild.dependencies) {
-        for (let pathName of settings.build.es6.webpackBuild.dependencies) {
+    if (settings.build.es6.buildDependencies) {
+        for (let pathName of settings.build.es6.buildDependencies) {
             const dependencyPath = path.join(config.computed.rootFolder, pathName);
             copyPaths.push(dependencyPath);
         }
@@ -91,7 +91,7 @@ var modifySources = function(settings) {
             pathName = pathName.replace("/*", "");
         }
 
-        for (var moduleName of config.modules) {
+        for (var moduleName of config.es6modules) {
             var module = config[moduleName];
             if (module.build.umd.packageName === pathName) {
                 if (module.build.es6.packageName) {
@@ -127,7 +127,7 @@ var modifyTsConfig = function(settings, cb) {
         }
 
         var mapped = false;
-        for (var moduleName of config.modules) {
+        for (var moduleName of config.es6modules) {
             var module = config[moduleName];
             if (module.build.umd.packageName === pathName) {
                 if (module.build.es6.packageName) {
@@ -187,7 +187,9 @@ var build = function(settings, cb) {
         verbose: true
     };
 
-    let command = `node "${config.computed.tscPath}" --skipLibCheck false --inlineSources --sourceMap true -t es5 -m esNext --outDir "${settings.computed.distES6Directory}"`;
+    var skipLibCheck = settings.build.es6.skipLibCheck ? 'true' : 'false';
+    let command = `node "${config.computed.tscPath}" --skipLibCheck ${skipLibCheck} --inlineSources --sourceMap true -t es5 -m esNext --outDir "${settings.computed.distES6Directory}"`;
+
     shelljs.exec(command, options, function(code, stdout, stderr) {
         if (stderr) {
             console.log(stderr);
@@ -252,11 +254,11 @@ function buildES6Library(settings, module) {
     // Creates the required tasks.
     var tasks = [];
 
-    var cleanTasks = [
-        function cleanES6(cb) { return cleanSourceAndDist(settings, cb); },
-        function cleanES6Shaders() { return cleanShaders(settings); }
-    ];
-    var shaders = function() { return buildShaders(settings); };
+    var cleanAndShaderTasks = [ function cleanES6(cb) { return cleanSourceAndDist(settings, cb); } ];
+    if (settings.computed.shaderTSGlob) {
+        cleanAndShaderTasks.push(function cleanES6Shaders() { return cleanShaders(settings); });
+        cleanAndShaderTasks.push(function() { return buildShaders(settings); });
+    }
     var copySource = function() { return source(settings); };
     var dependencies = function() { return dep(settings); };
     var adaptSourceImportPaths = function() { return modifySources(settings); };
@@ -278,7 +280,7 @@ function buildES6Library(settings, module) {
         ];
     }
 
-    tasks.push(...cleanTasks, shaders, copySource, dependencies, adaptSourceImportPaths, adaptTsConfigImportPaths, ...buildSteps);
+    tasks.push(...cleanAndShaderTasks, copySource, dependencies, adaptSourceImportPaths, adaptTsConfigImportPaths, ...buildSteps);
 
     return gulp.series.apply(this, tasks);
 }
@@ -286,7 +288,7 @@ function buildES6Library(settings, module) {
 /**
  * Dynamic es 6 module creation.
  */
-config.modules.map(function(module) {
+config.es6modules.map(function(module) {
     const settings = config[module];
     gulp.task(module + "-es6", buildES6Library(settings, module));
 });
@@ -294,4 +296,4 @@ config.modules.map(function(module) {
 /**
  * Build all es 6 libs.
  */
-gulp.task("typescript-es6", gulp.series(config.modules.map((module) => module + "-es6")));
+gulp.task("typescript-es6", gulp.series(config.es6modules.map((module) => module + "-es6")));

+ 0 - 1
Tools/Gulp/tasks/gulpTasks-viewerLibraries.js

@@ -10,7 +10,6 @@ var rename = require("gulp-rename");
 // Gulp Helpers
 var processDeclaration = require('../helpers/gulp-processModuleDeclarationToNamespace');
 var addModuleExports = require("../helpers/gulp-addModuleExports");
-
 // Import Build Config
 var config = require("../../Config/config.json");
 

+ 1 - 1
Tools/Publisher/tasks/prepareEs6DevPackages.js

@@ -12,7 +12,7 @@ const config = require("../../Config/config.js");
  * Prepare an es6 Dev folder npm linked for test purpose.
  */
 function prepareEs6DevPackages() {
-    config.modules.forEach(moduleName => {
+    config.es6modules.forEach(moduleName => {
         const module = config[moduleName];
 
         colorConsole.log("Prepare " + "ES6Dev".magenta + " Package: " + moduleName.blue.bold);

+ 4 - 1
Tools/Publisher/tasks/processEs6Packages.js

@@ -16,13 +16,16 @@ const modules = config.modules.concat(config.viewerModules);
  * Process ES6 Packages.
  */
 function processEs6Packages(version) {
-    config.modules.forEach(moduleName => {
+    config.es6modules.forEach(moduleName => {
         let module = config[moduleName];
         let es6Config = module.build.es6;
 
         colorConsole.log("Process " + "ES6".magenta + " Package: " + moduleName.blue.bold);
 
         let distPath = module.computed.distES6Directory;
+        if (es6Config.packageBuildFolder) {
+            distPath = path.join(distPath, es6Config.packageBuildFolder);
+        }
         let packagePath = module.computed.packageES6Directory;
         let umdPackageJson = require(module.computed.packageJSONPath);
 

+ 1 - 1
Tools/Publisher/tasks/processUMDViewer.js

@@ -49,7 +49,7 @@ function processUMDViewer(module, version) {
     packageJson.main = "babylon.viewer.js";
     packageJson.typings = "index.d.ts";
 
-    fs.writeFileSync(buildPath + 'package.json', JSON.stringify(packageJson, null, 4));
+    fs.writeFileSync(path.join(buildPath, 'package.json'), JSON.stringify(packageJson, null, 4));
 
     publish(version, "viewer", buildPath);
     colorConsole.emptyLine();

+ 0 - 2
Tools/WebpackPlugins/babylonWebpackConfig.js

@@ -1,6 +1,5 @@
 const webpack = require('webpack');
 const babylonExternals = require('./babylonExternals');
-const hardSourceWebpackPlugin = require('hard-source-webpack-plugin');
 
 const config = require("../Config/config.js");
 
@@ -54,7 +53,6 @@ module.exports = function defaultConfig(options) {
             hints: false
         },
         plugins: [
-            //new hardSourceWebpackPlugin(),
             new webpack.WatchIgnorePlugin([
                 /\.js$/,
                 /\.d\.ts$/,

+ 27 - 0
Tools/WebpackPlugins/viewerResolve.js

@@ -0,0 +1,27 @@
+var path = require('path');
+var assign = require('object-assign');
+var forEachBail = require('enhanced-resolve/lib/forEachBail');
+var basename = require('enhanced-resolve/lib/getPaths').basename;
+
+module.exports = function (modulesToResolveToEs5) {
+  return {
+    apply: doApply.bind(this, modulesToResolveToEs5)
+  };
+};
+
+function doApply(modulesToResolveToEs5, resolver) {
+  // file type taken from: https://github.com/webpack/enhanced-resolve/blob/v4.0.0/test/plugins.js
+  var target = resolver.ensureHook("undescribed-raw-file");
+  //console.log(resolver.hooks);
+  resolver.getHook("resolve")
+    .tapAsync("ViewerResolvePlugin", (request, resolveContext, callback) => {
+        for(var package of modulesToResolveToEs5){
+            if(request.request.indexOf(package+"/") == 0){
+                const newRequest = Object.assign({}, request, { request: package, });
+                return resolver.doResolve(target, newRequest, "viewer resolved", resolveContext, callback);
+            }
+        }
+        
+        return callback();
+    });
+}

+ 35 - 0
Viewer/README-ES6.md

@@ -0,0 +1,35 @@
+# BabylonJS Viewer
+
+This project is a 3d model viewer using babylonjs.
+
+Please note that this is an *initial release*. The API and project structure could (and probably SHOULD) be changed, so please don't rely on this yet in a productive environment.
+
+The viewer is using the latest Babylon from npm (3.1 alpha).
+
+This documentation is also not full. I will slowly add more and more exmplanations.
+
+## Basic usage
+
+See `basicExample.html` in `/dist`.
+
+Basically, all that is needed is an html tag, and the viewer.js, which includes everything needed to render a Scene:
+
+```html
+<babylon model="https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoomBox/glTF/BoomBox.gltf" default-viewer="true"></babylon>
+<script src="viewer.js"></script>
+``` 
+
+This will create a (default) viewer and will load the model in this URL using the gltf loader.
+
+The `babylon` tag will be automatically initialized. 
+
+## Configuration
+
+Configuration can be provided using html attributes or a JSON (at the moment). A configuration Mapper can be registered to create new configuration readers. 
+
+Before I finish a full documentation, take a look at `configuration.ts`
+
+## Templating
+
+The default templates are integrated in the viewer.js file. The current templates are located in `/assets/templates/default/` . Those templates can be extended and registered using the configuration file.
+

BIN
Viewer/dist/external/msft/EnvMap_3.0-256.env


+ 255 - 0
Viewer/dist/renderOnlyViewer.html

@@ -0,0 +1,255 @@
+<!DOCTYPE html>
+<html lang="en">
+
+    <head>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+        <meta http-equiv="X-UA-Compatible" content="ie=edge">
+        <title>BabylonJS Viewer - Basic usage</title>
+        <style>
+            babylon {
+                max-width: 800px;
+                max-height: 500px;
+                width: 100%;
+                height: 600px;
+            }
+        </style>
+    </head>
+
+    <body>
+        <canvas id="babylon-viewer" camera.behaviors.auto-rotate="0" style="max-width: 800px; max-height: 500px; width: 100%; height: 600px;"></canvas>
+        <script src="renderOnlyViewer.js"></script>
+        <script>
+
+            var config = {
+                "Renderer.ClearColorR": 0.2706,
+                "Renderer.ClearColorG": 0.2902,
+                "Renderer.ClearColorB": 0.3137,
+                "Renderer.ClearColorA": 1.0,
+                "Renderer.ClearColorOverride": false,
+                "GroundPlane.BottomVisible": false,
+                "GroundPlane.BottomGridOpacity": 1.0,
+                "Lighting.Light0_Enabled": true,
+                "Lighting.Light0_PositionX": -4.0,
+                "Lighting.Light0_PositionY": 4.5,
+                "Lighting.Light0_PositionZ": -4.0,
+                "Lighting.Light0_TargetX": 0.0,
+                "Lighting.Light0_TargetY": 0.0,
+                "Lighting.Light0_TargetZ": 0.0,
+                "Lighting.Light0_ColorR": 1.0,
+                "Lighting.Light0_ColorG": 1.0,
+                "Lighting.Light0_ColorB": 1.0,
+                "Lighting.Light0_Intensity": 80.0,
+                "Lighting.Light0_IntensityMode": 0,
+                "Lighting.Light0_Type": 0,
+                "Lighting.Light0_Radius": 0.3,
+                "Lighting.Light0_SpotAngle": 60.0,
+                "Lighting.Light0_CameraRelative": false,
+                "Lighting.Light0_ShadowEnabled": true,
+                "Lighting.Light0_ShadowBufferSize": 512.0,
+                "Lighting.Light0_ShadowFrustumSize": 2.0,
+                "Lighting.Light0_ShadowFieldOfView": 15.0,
+                "Lighting.Light0_ShadowNearClip": 1.0,
+                "Lighting.Light0_ShadowFarClip": 10.0,
+                "Lighting.Light0_FrustumEdgeFalloff": 1.0,
+                "Lighting.Light0_CameraOrientationTracking": 0,
+                "Lighting.Light1_Enabled": true,
+                "Lighting.Light1_PositionX": 5.0,
+                "Lighting.Light1_PositionY": 1.3,
+                "Lighting.Light1_PositionZ": 0.26,
+                "Lighting.Light1_TargetX": 0.0,
+                "Lighting.Light1_TargetY": 0.0,
+                "Lighting.Light1_TargetZ": 0.0,
+                "Lighting.Light1_ColorR": 1.0,
+                "Lighting.Light1_ColorG": 1.0,
+                "Lighting.Light1_ColorB": 1.0,
+                "Lighting.Light1_Intensity": 20.0,
+                "Lighting.Light1_IntensityMode": 0,
+                "Lighting.Light1_Type": 0,
+                "Lighting.Light1_Radius": 0.3,
+                "Lighting.Light1_SpotAngle": 35.0,
+                "Lighting.Light1_CameraRelative": false,
+                "Lighting.Light1_ShadowEnabled": false,
+                "Lighting.Light1_ShadowBufferSize": 512.0,
+                "Lighting.Light1_ShadowFrustumSize": 2.0,
+                "Lighting.Light1_ShadowFieldOfView": 15.0,
+                "Lighting.Light1_ShadowNearClip": 0.2,
+                "Lighting.Light1_ShadowFarClip": 10.0,
+                "Lighting.Light1_FrustumEdgeFalloff": 1.0,
+                "Lighting.Light1_CameraOrientationTracking": 0,
+                "Lighting.Light2_Enabled": true,
+                "Lighting.Light2_PositionX": 0.5,
+                "Lighting.Light2_PositionY": 0.0,
+                "Lighting.Light2_PositionZ": 4.5,
+                "Lighting.Light2_TargetX": 0.0,
+                "Lighting.Light2_TargetY": 0.0,
+                "Lighting.Light2_TargetZ": 0.0,
+                "Lighting.Light2_ColorR": 1.0,
+                "Lighting.Light2_ColorG": 1.0,
+                "Lighting.Light2_ColorB": 1.0,
+                "Lighting.Light2_Intensity": 3.0,
+                "Lighting.Light2_IntensityMode": 0,
+                "Lighting.Light2_Type": 0,
+                "Lighting.Light2_Radius": 0.3,
+                "Lighting.Light2_SpotAngle": 42.0,
+                "Lighting.Light2_CameraRelative": false,
+                "Lighting.Light2_ShadowEnabled": false,
+                "Lighting.Light2_ShadowBufferSize": 512.0,
+                "Lighting.Light2_ShadowFrustumSize": 2.0,
+                "Lighting.Light2_ShadowFieldOfView": 15.0,
+                "Lighting.Light2_ShadowNearClip": 0.2,
+                "Lighting.Light2_ShadowFarClip": 10.0,
+                "Lighting.Light2_FrustumEdgeFalloff": 1.0,
+                "Lighting.Light2_CameraOrientationTracking": 0,
+                "Lighting.MasterEnabled": true,
+                "Lighting.DirectEnabled": true,
+                "Lighting.DirectIntensity": 1.0,
+                "Lighting.EmissiveIntensity": 1.0,
+                "Lighting.EnvironmentEnabled": true,
+                "Lighting.EnvironmentIntensity": 1.5,
+                "Lighting.EnvironmentColorR": 1.0,
+                "Lighting.EnvironmentColorG": 1.0,
+                "Lighting.EnvironmentColorB": 1.0,
+                "Lighting.EnvironmentRotation": -30.0,
+                "Lighting.EnvironmentIndex": 0,
+                "Lighting.BackgroundColorR": 1.0,
+                "Lighting.BackgroundColorG": 1.0,
+                "Lighting.BackgroundColorB": 1.0,
+                "Lighting.BackgroundColorAmount": 1.0,
+                "Lighting.BackgroundLighting": 0.75,
+                "Lighting.BackgroundShadowFalloff": 1.0,
+                "Lighting.BackgroundShadowAmount": 0.075,
+                "ImageProcessing.Enabled": true,
+                "ImageProcessing.PlanarReflectionEnabled": true,
+                "ImageProcessing.PlanarReflectionWeight": 0.8,
+                "ImageProcessing.PlanarReflectionQuality": 2,
+                "ImageProcessing.PlanarReflectionBlur": true,
+                "ImageProcessing.PlanarReflectionDirect": false,
+                "ImageProcessing.BloomEnabled": false,
+                "ImageProcessing.BloomWeight": 0.0,
+                "ImageProcessing.BloomQuality": 2,
+                "ImageProcessing.VignetteWeight": 0.0,
+                "ImageProcessing.VignetteCentreX": 0.0,
+                "ImageProcessing.VignetteCentreY": 0.0,
+                "ImageProcessing.VignetteStretch": 0.5,
+                "ImageProcessing.VignetteColorR": 1.0,
+                "ImageProcessing.VignetteColorG": 1.0,
+                "ImageProcessing.VignetteColorB": 1.0,
+                "ImageProcessing.VignetteColorA": 1.0,
+                "ImageProcessing.VignetteBlendMode": 0,
+                "ColorGrading.TransformWeight": 1.0,
+                "ColorGrading.TransformData": "",
+                "ColorGrading.TransformDataFormat": "",
+                "ColorGrading.ColorFilterHueGlobal": 1.0,
+                "ColorGrading.ColorFilterHueShadows": 0.0,
+                "ColorGrading.ColorFilterHueMidtones": 0.0,
+                "ColorGrading.ColorFilterHueHighlights": 0.0,
+                "ColorGrading.ColorFilterDensityGlobal": 1.0,
+                "ColorGrading.ColorFilterDensityShadows": 1.0,
+                "ColorGrading.ColorFilterDensityMidtones": 1.0,
+                "ColorGrading.ColorFilterDensityHighlights": 1.0,
+                "ColorGrading.SaturationGlobal": 1.0,
+                "ColorGrading.SaturationShadows": 1.0,
+                "ColorGrading.SaturationMidtones": 1.0,
+                "ColorGrading.SaturationHighlights": 1.0,
+                "ColorGrading.ExposureShadows": 1.0,
+                "ColorGrading.ExposureMidtones": 1.0,
+                "ColorGrading.ExposureHighlights": 1.0,
+                "Camera.State.Position.X": 0.0,
+                "Camera.State.Position.Y": 0.0,
+                "Camera.State.Position.Z": 0.0,
+                "Camera.State.Rotation.X": 0.0,
+                "Camera.State.Rotation.Y": 0.0,
+                "Camera.State.Rotation.Z": 0.0,
+                "Camera.State.Rotation.W": 1.0,
+                "Camera.ExposureValue": 1.0,
+                "Camera.ExposureValueIsBrightness": false,
+                "Camera.ToneMappingEnabled": false,
+                "Camera.Contrast": 1.0,
+                "Camera.FieldOfView (Degrees)": 45.0,
+                "Camera.ElevationReturnTime (s)": 2.0,
+                "Camera.ElevationReturnWaitTime (s)": 3.0,
+                "Camera.DefaultElevation": 15.0,
+                "Camera.ElevationUpperLimit (degrees)": 80.0,
+                "Camera.ElevationLowerLimit (degrees)": -85.0,
+                "Camera.IdleRotationSpeed (degrees/s)": 0.0,
+                "Camera.IdleRotationWaitTime (s)": 4.0,
+                "Camera.IdleRotationSpinupTime (s)": 2.5,
+                "Camera.FramingPositionY": 0.5,
+                "Camera.FramingRadius": 0.866,
+                "Camera.FramingTime": 0.5,
+                "Camera.FramingRotation": -90.0,
+                "Camera.FramingElevation": 15.0,
+                "Camera.FramingBehaviour": 0,
+                "Camera.FrameOnModelLoad": true,
+                "Camera.ZoomStopsAnimation": false,
+                "Camera.Behaviour": 1,
+                "Camera.MinDistance": 0.5,
+                "Camera.MaxDistance": 5.0,
+                "Model.RelativeModelLoadScale": 1.0,
+                "Model.PositionAlignBase": true,
+                "Model.PositionOffsetX": 0.0,
+                "Model.PositionOffsetY": 0.0,
+                "Model.PositionOffsetZ": 0.0,
+                "Model.RotationOffsetAxisX": 0.0,
+                "Model.RotationOffsetAxisY": 1.0,
+                "Model.RotationOffsetAxisZ": 0.0,
+                "Model.RotationOffsetAngle": 210.0,
+
+                "Environment.RotationAroundY": 0.0,
+                "Environment.BackgroundClearColorFallback": [0.2706, 0.2902, 0.3137],
+                
+                "Environment.Ground_Texture": "Ground_1.0-1024.png",
+                "Environment.Ground_TextureInGamma": false,
+                "Environment.Ground_UseRGBColor": false,
+                "Environment.Ground_Noise": false,
+                "Environment.Ground_PrimaryColor": [1,1,1],
+                "Environment.Ground_SecondaryColor": [0, 0, 0],
+                "Environment.Ground_TertiaryColor": [0, 0, 0],
+                "Environment.Ground_PrimaryLevel": 1.55,
+                "Environment.Ground_SecondaryLevel": 0,
+                "Environment.Ground_TertiaryLevel": 0,
+                
+                "Environment.Ground_OpacityLevel": 0.8,
+                "Environment.Ground_ReflectionLevel": 1,
+                "Environment.Ground_ShadowLevel": 0.8,
+                
+                "Environment.Skybox_Texture": "Skybox_1.0-128.dds",
+                "Environment.Skybox_TextureInGamma": false,
+                "Environment.Skybox_UseRGBColor": false,
+                "Environment.Skybox_Noise": false,
+                "Environment.Skybox_PrimaryColor": [1, 1, 1],
+                "Environment.Skybox_SecondaryColor": [0, 0, 0],
+                "Environment.Skybox_TertiaryColor": [0, 0, 0],
+                "Environment.Skybox_PrimaryLevel": 1.5,
+                "Environment.Skybox_SecondaryLevel": 0,
+                "Environment.Skybox_TertiaryLevel": 0
+            }
+            
+            // Create viewer with a canvas element
+            var viewer = new BabylonViewer.RenderOnlyViewer(document.getElementById("babylon-viewer"), config);
+
+            // Initialize the viewer (this will setup the scene and load a model if its not)
+            viewer.initialize().then(()=>{
+                // Load a model
+                return viewer.loadModel({
+                    title: "Helmet",
+                    subtitle: "BabylonJS",
+                    thumbnail: "https://www.babylonjs.com/img/favicon/apple-icon-144x144.png",
+                    url: "https://www.babylonjs.com/Assets/DamagedHelmet/glTF/DamagedHelmet.gltf"
+                });
+            }).then(()=>{
+                // 1st model has been loaded, wait a second and swap to another model
+                setTimeout(() => {
+                    viewer.loadModel({
+                        title: "Helmet",
+                        subtitle: "BabylonJS",
+                        thumbnail: "https://www.babylonjs.com/img/favicon/apple-icon-144x144.png",
+                        url: "https://www.babylonjs.com/Assets/DamagedHelmet/glTF/DamagedHelmet.gltf"
+                    });
+                }, 1000);
+            });
+        </script>
+    </body>
+
+</html>

+ 2 - 0
Viewer/package.json

@@ -39,6 +39,8 @@
         "webpack-dev-server": "^3.1.4"
     },
     "dependencies": {
+        "@babylonjs/core": "^4.0.0-alpha.18",
+        "@babylonjs/loaders": "^4.0.0-alpha.18",
         "pepjs": "^0.4.3"
     }
 }

+ 1 - 1
Viewer/src/configuration/configuration.ts

@@ -1,4 +1,4 @@
-import { EngineOptions } from 'babylonjs';
+import { EngineOptions } from 'babylonjs/Engines/engine';
 import { ICameraConfiguration, IDefaultRenderingPipelineConfiguration, IGroundConfiguration, ILightConfiguration, IModelConfiguration, IObserversConfiguration, ISceneConfiguration, ISceneOptimizerConfiguration, ISkyboxConfiguration, ITemplateConfiguration, IVRConfiguration } from './interfaces';
 import { IEnvironmentMapConfiguration } from './interfaces/environmentMapConfiguration';
 

+ 2 - 1
Viewer/src/configuration/configurationContainer.ts

@@ -1,5 +1,6 @@
 import { ViewerConfiguration } from './configuration';
-import { Color3, Scene } from 'babylonjs';
+import { Color3 } from 'babylonjs/Maths/math';
+import { Scene } from 'babylonjs/scene';
 
 export class ConfigurationContainer {
 

+ 1 - 1
Viewer/src/configuration/globals.ts

@@ -1,4 +1,4 @@
-import { Engine } from "babylonjs";
+import { Engine } from "babylonjs/Engines/engine";
 
 export class ViewerGlobals {
 

+ 1 - 1
Viewer/src/configuration/interfaces/defaultRenderingPipelineConfiguration.ts

@@ -1,4 +1,4 @@
-import { DepthOfFieldEffectBlurLevel } from 'babylonjs';
+import { DepthOfFieldEffectBlurLevel } from "babylonjs/PostProcesses/depthOfFieldEffect";
 
 export interface IDefaultRenderingPipelineConfiguration {
     sharpenEnabled?: boolean;

+ 5 - 134
Viewer/src/configuration/loader.ts

@@ -1,137 +1,8 @@
-import { mapperManager } from './mappers';
-import { ViewerConfiguration } from './configuration';
-import { getConfigurationType } from './types';
-import { processConfigurationCompatibility } from './configurationCompatibility';
+import { RenderOnlyConfigurationLoader } from "./renderOnlyLoader";
+import { getConfigurationType } from "./types";
 
-import { deepmerge } from '../helper/';
-import { Tools, IFileRequest } from 'babylonjs';
-
-/**
- * The configuration loader will load the configuration object from any source and will use the defined mapper to
- * parse the object and return a conform ViewerConfiguration.
- * It is a private member of the scene.
- */
-export class ConfigurationLoader {
-
-    private _configurationCache: { [url: string]: any };
-
-    private _loadRequests: Array<IFileRequest>;
-
-    constructor(private _enableCache: boolean = false) {
-        this._configurationCache = {};
-        this._loadRequests = [];
+export class ConfigurationLoader extends RenderOnlyConfigurationLoader {
+    protected getExtendedConfig(type:string|undefined){
+        return getConfigurationType(type || "extended");
     }
-
-    /**
-     * load a configuration object that is defined in the initial configuration provided.
-     * The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
-     *
-     * @param initConfig the initial configuration that has the definitions of further configuration to load.
-     * @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
-     * @returns A promise that delivers the extended viewer configuration, when done.
-     */
-    public loadConfiguration(initConfig: ViewerConfiguration = {}, callback?: (config: ViewerConfiguration) => void): Promise<ViewerConfiguration> {
-
-        let loadedConfig: ViewerConfiguration = deepmerge({}, initConfig);
-        this._processInitialConfiguration(loadedConfig);
-
-        let extendedConfiguration = getConfigurationType(loadedConfig.extends || "extended");
-
-        if (loadedConfig.configuration) {
-
-            let mapperType = "json";
-            return Promise.resolve().then(() => {
-                if (typeof loadedConfig.configuration === "string" || (loadedConfig.configuration && loadedConfig.configuration.url)) {
-                    // a file to load
-
-                    let url: string = '';
-                    if (typeof loadedConfig.configuration === "string") {
-                        url = loadedConfig.configuration;
-                    }
-
-                    // if configuration is an object
-                    if (typeof loadedConfig.configuration === "object" && loadedConfig.configuration.url) {
-                        url = loadedConfig.configuration.url;
-                        let type = loadedConfig.configuration.mapper;
-                        // empty string?
-                        if (!type) {
-                            // load mapper type from filename / url
-                            type = loadedConfig.configuration.url.split('.').pop();
-                        }
-                        mapperType = type || mapperType;
-                    }
-                    return this._loadFile(url);
-                } else {
-                    if (typeof loadedConfig.configuration === "object") {
-                        mapperType = loadedConfig.configuration.mapper || mapperType;
-                        return loadedConfig.configuration.payload || {};
-                    }
-                    return {};
-
-                }
-            }).then((data: any) => {
-                let mapper = mapperManager.getMapper(mapperType);
-                let parsed = deepmerge(mapper.map(data), loadedConfig);
-                let merged = deepmerge(extendedConfiguration, parsed);
-                processConfigurationCompatibility(merged);
-                if (callback) { callback(merged); }
-                return merged;
-            });
-        } else {
-            loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
-            processConfigurationCompatibility(loadedConfig);
-            if (callback) { callback(loadedConfig); }
-            return Promise.resolve(loadedConfig);
-        }
-    }
-
-    /**
-     * Dispose the configuration loader. This will cancel file requests, if active.
-     */
-    public dispose() {
-        this._loadRequests.forEach((request) => {
-            request.abort();
-        });
-        this._loadRequests.length = 0;
-    }
-
-    /**
-     * This function will process the initial configuration and make needed changes for the viewer to work.
-     * @param config the mutable(!) initial configuration to process
-     */
-    private _processInitialConfiguration(config: ViewerConfiguration) {
-        if (config.model) {
-            if (typeof config.model === "string") {
-                config.model = {
-                    url: config.model
-                };
-            }
-        }
-    }
-
-    private _loadFile(url: string): Promise<any> {
-        let cacheReference = this._configurationCache;
-        if (this._enableCache && cacheReference[url]) {
-            return Promise.resolve(cacheReference[url]);
-        }
-
-        return new Promise((resolve, reject) => {
-            let fileRequest = Tools.LoadFile(url, (result) => {
-                let idx = this._loadRequests.indexOf(fileRequest);
-                if (idx !== -1) {
-                    this._loadRequests.splice(idx, 1);
-                }
-                if (this._enableCache) { cacheReference[url] = result; }
-                resolve(result);
-            }, undefined, undefined, false, (request, error: any) => {
-                let idx = this._loadRequests.indexOf(fileRequest);
-                if (idx !== -1) {
-                    this._loadRequests.splice(idx, 1);
-                }
-                reject(error);
-            });
-            this._loadRequests.push(fileRequest);
-        });
-    }
-
 }

+ 1 - 1
Viewer/src/configuration/mappers.ts

@@ -1,4 +1,4 @@
-import { Tools } from 'babylonjs';
+import { Tools } from 'babylonjs/Misc/tools';
 import { ViewerConfiguration } from './configuration';
 
 import { kebabToCamel } from '../helper/';

+ 164 - 0
Viewer/src/configuration/renderOnlyLoader.ts

@@ -0,0 +1,164 @@
+import { mapperManager } from './mappers';
+import { ViewerConfiguration } from './configuration';
+import { processConfigurationCompatibility } from './configurationCompatibility';
+
+import { deepmerge } from '../helper';
+import { IFileRequest, Tools } from 'babylonjs/Misc/tools';
+import { extendedConfiguration } from './types/extended';
+import { renderOnlyDefaultConfiguration } from './types/renderOnlyDefault';
+
+/**
+ * The configuration loader will load the configuration object from any source and will use the defined mapper to
+ * parse the object and return a conform ViewerConfiguration.
+ * It is a private member of the scene.
+ */
+export class RenderOnlyConfigurationLoader {
+
+    private _configurationCache: { [url: string]: any };
+
+    private _loadRequests: Array<IFileRequest>;
+
+    constructor(private _enableCache: boolean = false) {
+        this._configurationCache = {};
+        this._loadRequests = [];
+    }
+
+    private _getConfigurationTypeExcludeTemplate (types: string): ViewerConfiguration {
+        let config: ViewerConfiguration = {};
+        let typesSeparated = types.split(",");
+        typesSeparated.forEach((type) => {
+            switch (type.trim()) {
+                case 'default':
+                    config = deepmerge(config, renderOnlyDefaultConfiguration);
+                    break;
+                case 'none':
+                    break;
+                case 'extended':
+                default:
+                    config = deepmerge(config, extendedConfiguration);
+                    break;
+            }
+            if (config.extends) {
+                config = deepmerge(config, this._getConfigurationTypeExcludeTemplate(config.extends));
+            }
+        });
+        return config;
+    };
+
+    protected getExtendedConfig(type:string|undefined){
+        return this._getConfigurationTypeExcludeTemplate(type || "extended");
+    }
+
+    /**
+     * load a configuration object that is defined in the initial configuration provided.
+     * The viewer configuration can extend different types of configuration objects and have an extra configuration defined.
+     *
+     * @param initConfig the initial configuration that has the definitions of further configuration to load.
+     * @param callback an optional callback that will be called sync, if noconfiguration needs to be loaded or configuration is payload-only
+     * @returns A promise that delivers the extended viewer configuration, when done.
+     */
+    public loadConfiguration(initConfig: ViewerConfiguration = {}, callback?: (config: ViewerConfiguration) => void): Promise<ViewerConfiguration> {
+
+        let loadedConfig: ViewerConfiguration = deepmerge({}, initConfig);
+        this._processInitialConfiguration(loadedConfig);
+        
+        let extendedConfiguration = this.getExtendedConfig(loadedConfig.extends);
+
+        if (loadedConfig.configuration) {
+
+            let mapperType = "json";
+            return Promise.resolve().then(() => {
+                if (typeof loadedConfig.configuration === "string" || (loadedConfig.configuration && loadedConfig.configuration.url)) {
+                    // a file to load
+
+                    let url: string = '';
+                    if (typeof loadedConfig.configuration === "string") {
+                        url = loadedConfig.configuration;
+                    }
+
+                    // if configuration is an object
+                    if (typeof loadedConfig.configuration === "object" && loadedConfig.configuration.url) {
+                        url = loadedConfig.configuration.url;
+                        let type = loadedConfig.configuration.mapper;
+                        // empty string?
+                        if (!type) {
+                            // load mapper type from filename / url
+                            type = loadedConfig.configuration.url.split('.').pop();
+                        }
+                        mapperType = type || mapperType;
+                    }
+                    return this._loadFile(url);
+                } else {
+                    if (typeof loadedConfig.configuration === "object") {
+                        mapperType = loadedConfig.configuration.mapper || mapperType;
+                        return loadedConfig.configuration.payload || {};
+                    }
+                    return {};
+
+                }
+            }).then((data: any) => {
+                let mapper = mapperManager.getMapper(mapperType);
+                let parsed = deepmerge(mapper.map(data), loadedConfig);
+                let merged = deepmerge(extendedConfiguration, parsed);
+                processConfigurationCompatibility(merged);
+                if (callback) { callback(merged); }
+                return merged;
+            });
+        } else {
+            loadedConfig = deepmerge(extendedConfiguration, loadedConfig);
+            processConfigurationCompatibility(loadedConfig);
+            if (callback) { callback(loadedConfig); }
+            return Promise.resolve(loadedConfig);
+        }
+    }
+
+    /**
+     * Dispose the configuration loader. This will cancel file requests, if active.
+     */
+    public dispose() {
+        this._loadRequests.forEach((request) => {
+            request.abort();
+        });
+        this._loadRequests.length = 0;
+    }
+
+    /**
+     * This function will process the initial configuration and make needed changes for the viewer to work.
+     * @param config the mutable(!) initial configuration to process
+     */
+    private _processInitialConfiguration(config: ViewerConfiguration) {
+        if (config.model) {
+            if (typeof config.model === "string") {
+                config.model = {
+                    url: config.model
+                };
+            }
+        }
+    }
+
+    private _loadFile(url: string): Promise<any> {
+        let cacheReference = this._configurationCache;
+        if (this._enableCache && cacheReference[url]) {
+            return Promise.resolve(cacheReference[url]);
+        }
+
+        return new Promise((resolve, reject) => {
+            let fileRequest = Tools.LoadFile(url, (result) => {
+                let idx = this._loadRequests.indexOf(fileRequest);
+                if (idx !== -1) {
+                    this._loadRequests.splice(idx, 1);
+                }
+                if (this._enableCache) { cacheReference[url] = result; }
+                resolve(result);
+            }, undefined, undefined, false, (request, error: any) => {
+                let idx = this._loadRequests.indexOf(fileRequest);
+                if (idx !== -1) {
+                    this._loadRequests.splice(idx, 1);
+                }
+                reject(error);
+            });
+            this._loadRequests.push(fileRequest);
+        });
+    }
+    
+}

+ 5 - 4
Viewer/src/configuration/types/default.ts

@@ -1,13 +1,14 @@
 import { ViewerConfiguration } from '../configuration';
-import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from 'babylonjs-viewer-assets';
-import { babylonFont } from 'babylonjs-viewer-assets';
+import { babylonFont, defaultTemplate, fillContainer, loadingScreen, defaultViewer, navbar, overlay, help, share, error } from 'babylonjs-viewer-assets';
 import * as images from 'babylonjs-viewer-assets';
+import { renderOnlyDefaultConfiguration } from './renderOnlyDefault';
+import { deepmerge } from '../../helper';
 
 /**
  * The default configuration of the viewer, including templates (canvas, overly, loading screen)
  * This configuration doesn't hold specific parameters, and only defines objects that are needed for the viewer to fully work correctly.
  */
-export let defaultConfiguration: ViewerConfiguration = {
+export let defaultConfiguration: ViewerConfiguration = deepmerge(renderOnlyDefaultConfiguration, {
     version: "3.2.0-alpha4",
     templates: {
         main: {
@@ -119,4 +120,4 @@ export let defaultConfiguration: ViewerConfiguration = {
     },
     scene: {
     }
-};
+});

+ 1 - 1
Viewer/src/configuration/types/environmentMap.ts

@@ -7,7 +7,7 @@ export const environmentMapConfiguration: ViewerConfiguration = {
     lab: {
         assetsRootURL: '/assets/environment/',
         environmentMap: {
-            texture: 'EnvMap_2.0-256.env',
+            texture: 'EnvMap_3.0-256.env',
             rotationY: 0,
             tintLevel: 0.4
         }

+ 1 - 1
Viewer/src/configuration/types/extended.ts

@@ -1,5 +1,5 @@
 import { ViewerConfiguration } from './../configuration';
-import { Tools } from 'babylonjs';
+import { Tools } from 'babylonjs/Misc/tools';
 
 /**
  * The viewer's "extended" configuration.

+ 1 - 2
Viewer/src/configuration/types/minimal.ts

@@ -1,6 +1,5 @@
 import { ViewerConfiguration } from './../configuration';
-import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error } from 'babylonjs-viewer-assets';
-import { loading, close } from 'babylonjs-viewer-assets';
+import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error, loading, close } from 'babylonjs-viewer-assets';
 
 /**
  * The minimal configuration needed to make the viewer work.

+ 32 - 0
Viewer/src/configuration/types/renderOnlyDefault.ts

@@ -0,0 +1,32 @@
+/**
+ * The render only default configuration of the viewer, including templates (canvas, overly, loading screen)
+ * This configuration doesn't hold specific parameters, and only defines objects that are needed for the render only viewer viewer to fully work correctly.
+ */
+export let renderOnlyDefaultConfiguration = {
+    version: "3.2.0-alpha4",
+    camera: {
+        behaviors: {
+            autoRotate: {
+                type: 0
+            },
+            framing: {
+                type: 2,
+                zoomOnBoundingInfo: true,
+                zoomStopsAnimation: false
+            },
+            bouncing: {
+                type: 1
+            }
+        }
+    },
+    skybox: {
+    },
+    ground: {
+        receiveShadows: true
+    },
+    engine: {
+        antialiasing: true
+    },
+    scene: {
+    }
+};

+ 2 - 1
Viewer/src/labs/environmentSerializer.ts

@@ -1,4 +1,5 @@
-import { Vector3, Tools } from "babylonjs";
+import { Vector3 } from 'babylonjs/Maths/math';
+import { Tools } from 'babylonjs/Misc/tools';
 import { TextureCube, PixelFormat, PixelType } from './texture';
 
 /**

+ 6 - 1
Viewer/src/labs/texture.ts

@@ -1,4 +1,9 @@
-import { Scene, CubeTexture, InternalTexture, Scalar, BaseTexture, Texture } from "babylonjs";
+import { Scene } from "babylonjs/scene";
+import { CubeTexture } from "babylonjs/Materials/Textures/cubeTexture";
+import { InternalTexture } from "babylonjs/Materials/Textures/internalTexture";
+import { Scalar } from "babylonjs/Maths/math.scalar";
+import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
+import { Texture } from "babylonjs/Materials/Textures/texture";
 
 /**
  * WebGL Pixel Formats

+ 5 - 2
Viewer/src/labs/viewerLabs.ts

@@ -1,8 +1,11 @@
 import { PBREnvironment, EnvironmentDeserializer } from "./environmentSerializer";
-
-import { Tools, Quaternion, ShadowLight, Vector3, Axis, Matrix, SphericalPolynomial, Tmp, Scene } from 'babylonjs';
+import { Scene } from "babylonjs/scene";
+import { Vector3, Quaternion, Axis, Matrix, Tmp } from "babylonjs/Maths/math";
+import { SphericalPolynomial } from "babylonjs/Maths/sphericalPolynomial";
+import { ShadowLight } from "babylonjs/Lights/shadowLight";
 import { TextureUtils } from "./texture";
 
+
 /**
  * The ViewerLabs class will hold functions that are not (!) backwards compatible.
  * The APIs in all labs-related classes and configuration  might change.

+ 6 - 3
Viewer/src/loader/modelLoader.ts

@@ -1,5 +1,8 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoader, Tags, Tools } from 'babylonjs';
-import { GLTFFileLoader, GLTFLoaderAnimationStartMode } from 'babylonjs-loaders';
+import {GLTFFileLoader, GLTFLoaderAnimationStartMode} from "babylonjs-loaders/glTF/glTFFileLoader"
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs/Loading/sceneLoader';
+import { Tools } from 'babylonjs/Misc/tools';
+import { SceneLoader } from 'babylonjs/Loading/sceneLoader';
+import { Tags } from 'babylonjs/Misc/tags';
 
 import { ConfigurationContainer } from '../configuration/configurationContainer';
 import { IModelConfiguration } from '../configuration/interfaces/modelConfiguration';
@@ -63,7 +66,7 @@ export class ModelLoader {
      * @param modelConfiguration the modelConfiguration to use to load the model
      */
     public load(modelConfiguration: IModelConfiguration): ViewerModel {
-
+        
         const model = new ViewerModel(this._observablesManager, modelConfiguration, this._configurationContainer);
 
         model.loadId = this._loadId++;

+ 2 - 2
Viewer/src/loader/plugins/applyMaterialConfig.ts

@@ -1,7 +1,7 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material } from 'babylonjs';
-
 import { ViewerModel } from '../../model/viewerModel';
 import { ILoaderPlugin } from './loaderPlugin';
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs/Loading/sceneLoader';
+import { Material } from 'babylonjs/Materials/material';
 
 /**
  * Force-apply material configuration right after a material was loaded.

+ 3 - 2
Viewer/src/loader/plugins/extendedMaterialLoaderPlugin.ts

@@ -1,5 +1,6 @@
-import { Engine, Material, PBRMaterial } from 'babylonjs';
-
+import { Material } from 'babylonjs/Materials/material';
+import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
+import { Engine } from 'babylonjs/Engines/engine';
 import { ILoaderPlugin } from './loaderPlugin';
 
 /**

+ 1 - 1
Viewer/src/loader/plugins/index.ts

@@ -3,7 +3,7 @@ import { ILoaderPlugin } from "./loaderPlugin";
 import { MSFTLodLoaderPlugin } from './msftLodLoaderPlugin';
 import { ApplyMaterialConfigPlugin } from './applyMaterialConfig';
 import { ExtendedMaterialLoaderPlugin } from './extendedMaterialLoaderPlugin';
-import { Tools } from "babylonjs";
+import { Tools } from "babylonjs/Misc/tools";
 
 const pluginCache: { [key: string]: ILoaderPlugin } = {};
 

+ 6 - 2
Viewer/src/loader/plugins/loaderPlugin.ts

@@ -1,6 +1,10 @@
 import { ViewerModel } from "../../model/viewerModel";
-import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders";
-import { AbstractMesh, ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent, BaseTexture, Material } from "babylonjs";
+import { IGLTFLoaderExtension, IGLTFLoaderData } from "babylonjs-loaders/glTF/glTFFileLoader";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs/Loading/sceneLoader";
+import { SceneLoaderProgressEvent } from "babylonjs/Loading/sceneLoader";
+import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
+import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
+import { Material } from "babylonjs/Materials/material";
 
 /**
  * This interface defines the structure of a loader plugin.

+ 3 - 3
Viewer/src/loader/plugins/msftLodLoaderPlugin.ts

@@ -1,6 +1,6 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs';
-import { IGLTFLoaderExtension, GLTF2 } from 'babylonjs-loaders';
-
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs/Loading/sceneLoader';
+import { IGLTFLoaderExtension } from 'babylonjs-loaders/glTF/2.0/glTFLoaderExtension';
+import { GLTF2 } from 'babylonjs-loaders/glTF/index';
 import { ViewerModel } from '../../model/viewerModel';
 import { ILoaderPlugin } from './loaderPlugin';
 

+ 2 - 1
Viewer/src/loader/plugins/telemetryLoaderPlugin.ts

@@ -1,7 +1,8 @@
 import { ILoaderPlugin } from "./loaderPlugin";
 import { telemetryManager } from "../../managers/telemetryManager";
 import { ViewerModel } from "../../model/viewerModel";
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, PrecisionDate } from "babylonjs";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs/Loading/sceneLoader";
+import { PrecisionDate } from "babylonjs/Misc/precisionDate";
 
 export class TelemetryLoaderPlugin implements ILoaderPlugin {
 

+ 4 - 1
Viewer/src/managers/observablesManager.ts

@@ -1,4 +1,7 @@
-import { Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, Scene, SceneLoaderProgressEvent } from 'babylonjs';
+import { Observable } from 'babylonjs/Misc/observable';
+import { Scene } from 'babylonjs/scene';
+import { Engine } from 'babylonjs/Engines/engine';
+import { SceneLoaderProgressEvent, ISceneLoaderPlugin, ISceneLoaderPluginAsync } from 'babylonjs/Loading/sceneLoader';
 
 import { ViewerModel } from '../model/viewerModel';
 

Datei-Diff unterdrückt, da er zu groß ist
+ 75 - 20
Viewer/src/managers/sceneManager.ts


+ 3 - 1
Viewer/src/managers/telemetryManager.ts

@@ -1,4 +1,6 @@
-import { Engine, Observable } from "babylonjs";
+import { Observable } from "babylonjs/Misc/observable";
+import { Engine } from "babylonjs/Engines/engine";
+
 
 /**
  * The data structure of a telemetry event.

+ 4 - 3
Viewer/src/model/modelAnimation.ts

@@ -1,4 +1,5 @@
-import { Animatable, AnimationGroup, Vector3 } from 'babylonjs';
+import { Vector3 } from "babylonjs/Maths/math";
+import { AnimationGroup, Animatable } from "babylonjs/Animations/index";
 
 /**
  * Animation play mode enum - is the animation looping or playing once
@@ -267,10 +268,10 @@ export class GroupModelAnimation implements IModelAnimation {
      */
     restart() {
         if (this.state === AnimationState.PAUSED) {
-            this._animationGroup.restart();
+            this._animationGroup.restart();
         }
         else {
-            this.start();
+            this.start();
         }
     }
 

+ 17 - 2
Viewer/src/model/viewerModel.ts

@@ -1,5 +1,20 @@
-import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, AnimationGroup, Animatable, AbstractMesh, Tools, Scene, SceneLoader, Observable, SceneLoaderProgressEvent, Tags, IParticleSystem, Skeleton, IDisposable, Nullable, Animation, Quaternion, Material, Vector3, AnimationPropertiesOverride, QuinticEase, SineEase, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, PBRMaterial, MultiMaterial } from "babylonjs";
-import { GLTFFileLoader } from "babylonjs-loaders";
+import { IDisposable } from "babylonjs/scene";
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync } from "babylonjs/Loading/sceneLoader";
+import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
+import { IParticleSystem } from "babylonjs/Particles/IParticleSystem";
+import { Skeleton } from "babylonjs/Bones/skeleton";
+import { Observable } from "babylonjs/Misc/observable";
+import { SceneLoaderProgressEvent } from "babylonjs/Loading/sceneLoader";
+import { AnimationGroup } from "babylonjs/Animations/animationGroup";
+import { Animation, Animatable, CircleEase, BackEase, BounceEase, CubicEase, ElasticEase, ExponentialEase, PowerEase, QuadraticEase, QuarticEase, QuinticEase, SineEase } from "babylonjs/Animations/index";
+import { Nullable } from "babylonjs/types";
+import { Quaternion, Vector3 } from "babylonjs/Maths/math";
+import { Tags } from "babylonjs/Misc/tags";
+import { Material } from "babylonjs/Materials/material";
+import { PBRMaterial } from "babylonjs/Materials/PBR/pbrMaterial";
+import { MultiMaterial } from "babylonjs/Materials/multiMaterial";
+import { Tools } from "babylonjs/Misc/tools";
+import { GLTFFileLoader } from "babylonjs-loaders/glTF/index";
 import { IAsset } from "babylonjs-gltf2interface";
 import { IModelConfiguration } from "../configuration/interfaces/modelConfiguration";
 import { IModelAnimationConfiguration } from "../configuration/interfaces/modelAnimationConfiguration";

+ 2 - 1
Viewer/src/optimizer/custom/extended.ts

@@ -1,4 +1,5 @@
-import { Scalar, DefaultRenderingPipeline, Scene } from 'babylonjs';
+import { DefaultRenderingPipeline } from 'babylonjs/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline';
+import { Scalar } from 'babylonjs/Maths/math.scalar';
 import { SceneManager } from '../../managers/sceneManager';
 
 /**

+ 18 - 0
Viewer/src/renderOnlyIndex.ts

@@ -0,0 +1,18 @@
+import { RenderOnlyViewer } from './viewer/renderOnlyViewer';
+
+// Required side effects
+import 'babylonjs-loaders/glTF/2.0';
+import "babylonjs/Lights/Shadows/shadowGeneratorSceneComponent"
+import "babylonjs/Debug/debugLayer";
+import "babylonjs/Meshes/Builders/planeBuilder";
+import "babylonjs/Meshes/Builders/boxBuilder";
+import "babylonjs/Materials/Textures/Loaders/ddsTextureLoader"
+import "babylonjs/Materials/Textures/Loaders/envTextureLoader"
+import "babylonjs/Materials/Textures/Loaders/ktxTextureLoader"
+import "babylonjs/PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent";
+
+// Override default material factory to avoid the dependency on standard material
+import { Scene } from 'babylonjs/scene';
+Scene.DefaultMaterialFactory = (scene:Scene)=>{return null as any};
+
+export { RenderOnlyViewer };

+ 1 - 1
Viewer/src/templating/plugins/printButton.ts

@@ -1,7 +1,7 @@
 import { AbstractViewerNavbarButton } from "../viewerTemplatePlugin";
 import { DefaultViewer } from "../../viewer/defaultViewer";
 import { EventCallback } from "../templateManager";
-import { Tools } from "babylonjs";
+import { Tools } from "babylonjs/Misc/tools";
 
 export class PrintButtonPlugin extends AbstractViewerNavbarButton {
 

+ 2 - 2
Viewer/src/templating/templateManager.ts

@@ -1,5 +1,5 @@
-
-import { Observable, IFileRequest, Tools } from 'babylonjs';
+import { Observable } from 'babylonjs/Misc/observable';
+import { IFileRequest, Tools } from 'babylonjs/Misc/tools';
 import { isUrl, camelToKebab, kebabToCamel } from '../helper';
 
 import * as Handlebars from 'handlebars/dist/handlebars';

+ 34 - 6
Viewer/src/viewer/defaultViewer.ts

@@ -1,8 +1,14 @@
 
-import { ViewerConfiguration, IModelConfiguration, ILightConfiguration } from './../configuration';
+import { ViewerConfiguration, IModelConfiguration, ILightConfiguration, ISceneConfiguration } from './../configuration';
 import { Template, EventCallback } from '../templating/templateManager';
-import { AbstractViewer } from './viewer';
-import { SpotLight, Vector3, FilesInput } from 'babylonjs';
+import { FilesInput } from 'babylonjs/Misc/filesInput';
+import { SpotLight } from 'babylonjs/Lights/spotLight';
+import { Vector3 } from 'babylonjs/Maths/math';
+import { TemplateManager } from '../templating/templateManager';
+import { AbstractViewerWithTemplate } from './viewerWithTemplate';
+import { StandardMaterial } from 'babylonjs/Materials/standardMaterial';
+import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
+import { extendClassWithConfig } from '../helper';
 import { ViewerModel } from '../model/viewerModel';
 import { IModelAnimation, AnimationState } from '../model/modelAnimation';
 import { IViewerTemplatePlugin } from '../templating/viewerTemplatePlugin';
@@ -13,7 +19,11 @@ import { PrintButtonPlugin } from '../templating/plugins/printButton';
  * The Default viewer is the default implementation of the AbstractViewer.
  * It uses the templating system to render a new canvas and controls.
  */
-export class DefaultViewer extends AbstractViewer {
+export class DefaultViewer extends AbstractViewerWithTemplate {
+    /**
+     * The corresponsing template manager of this viewer.
+     */
+    public templateManager: TemplateManager;
 
     public fullscreenElement?: Element;
 
@@ -24,7 +34,7 @@ export class DefaultViewer extends AbstractViewer {
      */
     constructor(public containerElement: Element, initialConfiguration: ViewerConfiguration = { extends: 'default' }) {
         super(containerElement, initialConfiguration);
-
+        
         this.onModelLoadedObservable.add(this._onModelLoaded);
         this.onModelRemovedObservable.add(() => {
             this._configureTemplate();
@@ -37,6 +47,22 @@ export class DefaultViewer extends AbstractViewer {
         });
 
         this.onInitDoneObservable.add(() => {
+            this.sceneManager.setDefaultMaterial = function(sceneConfig: ISceneConfiguration){
+                let conf = sceneConfig.defaultMaterial;
+                if(!conf){
+                    return;
+                }
+                if ((conf.materialType === 'standard' && this.scene.defaultMaterial.getClassName() !== 'StandardMaterial') ||
+                    (conf.materialType === 'pbr' && this.scene.defaultMaterial.getClassName() !== 'PBRMaterial')) {
+                    this.scene.defaultMaterial.dispose();
+                    if (conf.materialType === 'standard') {
+                        this.scene.defaultMaterial = new StandardMaterial("defaultMaterial", this.scene);
+                    } else {
+                        this.scene.defaultMaterial = new PBRMaterial("defaultMaterial", this.scene);
+                    }
+                }
+                extendClassWithConfig(this.scene.defaultMaterial, conf);
+            }
             if (!this.sceneManager.models.length) {
                 this.hideLoadingScreen();
             }
@@ -205,7 +231,7 @@ export class DefaultViewer extends AbstractViewer {
                 }
                 var speed = element.dataset["value"];
                 if (speed) {
-                    this._updateAnimationSpeed(speed);
+                    this._updateAnimationSpeed(speed);
                 }
                 break;
             case "progress-wrapper":
@@ -601,6 +627,8 @@ export class DefaultViewer extends AbstractViewer {
 
         super._onConfigurationLoaded(configuration);
 
+        this.templateManager = new TemplateManager(this.containerElement);
+
         // initialize the templates
         let templateConfiguration = this.configuration.templates || {};
 

+ 30 - 0
Viewer/src/viewer/renderOnlyViewer.ts

@@ -0,0 +1,30 @@
+
+import { ViewerConfiguration } from '../configuration';
+import { AbstractViewer } from './viewer';
+
+export class RenderOnlyViewer extends AbstractViewer {
+    constructor(public containerElement: Element, initialConfiguration: ViewerConfiguration = {}) {
+        super(containerElement, initialConfiguration);
+        this._canvas = containerElement as HTMLCanvasElement
+    }
+    public initialize(){
+        let autoLoad = typeof this.configuration.model === 'string' || (this.configuration.model && this.configuration.model.url);
+        return this._initEngine().then((engine) => {
+            return this.onEngineInitObservable.notifyObserversWithPromise(engine);
+        }).then(() => {
+            this._initTelemetryEvents();
+            if (autoLoad) {
+                return this.loadModel(this.configuration.model!).catch(() => { }).then(() => { return this.sceneManager.scene; });
+            } else {
+                return this.sceneManager.scene || this.sceneManager.initScene(this.configuration.scene);
+            }
+        }).then(() => {
+            return this.onInitDoneObservable.notifyObserversWithPromise(this);
+        }).catch((e) => {
+            console.log(e.toString());
+            return this;
+        });
+    }
+    protected _prepareContainerElement() {
+    }
+}

+ 18 - 16
Viewer/src/viewer/viewer.ts

@@ -1,16 +1,24 @@
-import { Effect, Engine, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Observable, RenderingManager, Scene, SceneLoaderProgressEvent, TargetCamera, Tools, Vector3, Observer } from 'babylonjs';
+import { Engine } from 'babylonjs/Engines/engine';
+import { ISceneLoaderPlugin, ISceneLoaderPluginAsync, SceneLoaderProgressEvent } from 'babylonjs/Loading/sceneLoader';
+import { Observable } from 'babylonjs/Misc/observable';
+import { Scene } from 'babylonjs/scene';
+import { RenderingManager } from 'babylonjs/Rendering/renderingManager';
+import { Vector3 } from 'babylonjs/Maths/math';
+import { TargetCamera } from 'babylonjs/Cameras/targetCamera';
+import { Tools } from 'babylonjs/Misc/tools';
+import { Effect } from 'babylonjs/Materials/effect';
+import { ConfigurationLoader } from '../configuration/loader';
 import { IModelConfiguration, IObserversConfiguration, ViewerConfiguration } from '../configuration/';
 import { processConfigurationCompatibility } from '../configuration/configurationCompatibility';
 import { ConfigurationContainer } from '../configuration/configurationContainer';
 import { viewerGlobals } from '../configuration/globals';
-import { ConfigurationLoader } from '../configuration/loader';
+import { RenderOnlyConfigurationLoader } from '../configuration/renderOnlyLoader';
 import { deepmerge } from '../helper/';
 import { ModelLoader } from '../loader/modelLoader';
 import { ObservablesManager } from '../managers/observablesManager';
 import { SceneManager } from '../managers/sceneManager';
 import { telemetryManager } from '../managers/telemetryManager';
 import { ViewerModel } from '../model/viewerModel';
-import { TemplateManager } from '../templating/templateManager';
 import { viewerManager } from './viewerManager';
 
 /**
@@ -18,13 +26,6 @@ import { viewerManager } from './viewerManager';
  * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
  */
 export abstract class AbstractViewer {
-
-    /**
-     * The corresponsing template manager of this viewer.
-     */
-    public templateManager: TemplateManager;
-    // TODO get the template manager to the default viewer, if no one is extending the abstract viewer
-
     /**
      * Babylon Engine corresponding with this viewer
      */
@@ -160,7 +161,7 @@ export abstract class AbstractViewer {
     /**
      * The configuration loader of this viewer
      */
-    protected _configurationLoader: ConfigurationLoader;
+    protected _configurationLoader: RenderOnlyConfigurationLoader;
 
     /**
      * Is the viewer already initialized. for internal use.
@@ -173,6 +174,10 @@ export abstract class AbstractViewer {
         return this._configurationContainer;
     }
 
+    protected getConfigurationLoader(){
+        return new RenderOnlyConfigurationLoader();
+    }
+
     constructor(public containerElement: Element, initialConfiguration: ViewerConfiguration = {}) {
         // if exists, use the container id. otherwise, generate a random string.
         if (containerElement.id) {
@@ -192,7 +197,7 @@ export abstract class AbstractViewer {
         RenderingManager.AUTOCLEAR = false;
 
         // extend the configuration
-        this._configurationLoader = new ConfigurationLoader();
+        this._configurationLoader = this.getConfigurationLoader();
         this._configurationLoader.loadConfiguration(initialConfiguration, (configuration) => {
             this._onConfigurationLoaded(configuration);
         });
@@ -417,8 +422,6 @@ export abstract class AbstractViewer {
             }));
         }
 
-        this.templateManager = new TemplateManager(this.containerElement);
-
         this.observablesManager.onViewerInitStartedObservable.notifyObservers(this);
     }
 
@@ -680,7 +683,6 @@ export abstract class AbstractViewer {
      * @returns a ViewerModel object that is not yet fully loaded.
      */
     public initModel(modelConfig: string | File | IModelConfiguration, clearScene: boolean = true): ViewerModel {
-
         let configuration: IModelConfiguration;
         if (typeof modelConfig === 'string') {
             configuration = {
@@ -748,7 +750,7 @@ export abstract class AbstractViewer {
             // We can decide here whether or not to cancel the lst load, but the developer can do that.
             return Promise.reject("another model is curently being loaded.");
         }
-
+        
         return Promise.resolve(this.sceneManager.scene).then((scene) => {
             if (!scene) { return this.sceneManager.initScene(this.configuration.scene, this.configuration.optimizer); }
             return scene;

+ 1 - 1
Viewer/src/viewer/viewerManager.ts

@@ -1,4 +1,4 @@
-import { Observable } from 'babylonjs';
+import { Observable } from 'babylonjs/Misc/observable';
 import { AbstractViewer } from './viewer';
 
 /**

+ 12 - 0
Viewer/src/viewer/viewerWithTemplate.ts

@@ -0,0 +1,12 @@
+import { AbstractViewer } from "./viewer";
+import { ConfigurationLoader } from "../configuration/loader";
+
+/**
+ * The AbstractViewer is the center of Babylon's viewer.
+ * It is the basic implementation of the default viewer and is responsible of loading and showing the model and the templates
+ */
+export abstract class AbstractViewerWithTemplate extends AbstractViewer {
+    protected getConfigurationLoader(){
+        return new ConfigurationLoader();
+    }
+}

+ 0 - 43
Viewer/tests/unit/src/configuration/updateConfiguration.ts

@@ -16,49 +16,6 @@ describe(name + " scene", () => {
         });
     });
 
-    it("should enable and disable the debug layer", (done) => {
-        let viewer = Helper.getNewViewerInstance(undefined, { extends: "none" });
-        let showCalled = 0;
-        let hideCalled = 0;
-        let isVisible = false;
-        viewer.onSceneInitObservable.add((scene) => {
-            scene.debugLayer.show = () => {
-                showCalled++;
-                isVisible = true;
-            };
-
-            scene.debugLayer.hide = () => {
-                hideCalled++;
-                isVisible = false;
-            };
-
-            scene.debugLayer.isVisible = () => {
-                return isVisible;
-            };
-        });
-        viewer.onInitDoneObservable.add(() => {
-            // assert.isUndefined(viewer.configuration.scene);
-            assert.equal(showCalled, 0);
-            assert.equal(hideCalled, 0);
-            viewer.updateConfiguration({
-                scene: {
-                    debug: true
-                }
-            });
-            assert.equal(showCalled, 1);
-
-            viewer.updateConfiguration({
-                scene: {
-                    debug: false
-                }
-            });
-            assert.equal(showCalled, 1);
-            assert.equal(hideCalled, 1);
-            viewer.dispose();
-            done();
-        });
-    });
-
     it("should update the image processing configuration values", (done) => {
         let viewer = Helper.getNewViewerInstance(undefined, { extends: "none" });
 

+ 6 - 1
Viewer/tests/unit/webpack.config.js

@@ -1,5 +1,7 @@
 const path = require('path');
 
+const ViewerResolve = require('../../../Tools/WebpackPlugins/viewerResolve');
+
 module.exports = {
     context: __dirname,
     entry: {
@@ -17,7 +19,10 @@ module.exports = {
             "babylonjs-materials": __dirname + '/../../../dist/preview release/materialsLibrary/babylonjs.materials.js',
             "babylonjs-loaders": __dirname + '/../../../dist/preview release/loaders/babylonjs.loaders.js',
             "babylonjs-viewer-assets": __dirname + '/../../src/assets/index.ts'
-        }
+        },
+        plugins: [
+            new ViewerResolve(["babylonjs", "babylonjs-loaders"])
+        ]
     },
     mode: "development",
     devtool: 'source-map',

+ 3 - 3
Viewer/tsconfig.json

@@ -22,10 +22,10 @@
         "baseUrl": "./src/",
         "rootDir": "./",
         "paths": {
-            "babylonjs": [
+            "babylonjs/*": [
                 "../../dist/preview release/babylon.module.d.ts"
             ],
-            "babylonjs-loaders": [
+            "babylonjs-loaders/*": [
                 "../../dist/preview release/loaders/babylonjs.loaders.module.d.ts"
             ],
             "babylonjs-gltf2interface": [
@@ -35,7 +35,7 @@
                 "./helper/deepmerge.d.ts"
             ],
             "handlebars": [
-                "./templates/handlebars.d.ts"
+                "./templating/handlebars.d.ts"
             ],
             "babylonjs-viewer-assets": [
                 "./assets/"

+ 10 - 46
Viewer/webpack.config.js

@@ -1,52 +1,13 @@
 const path = require('path');
 const webpack = require('webpack');
 
-module.exports = /*[
-    {
-    entry: {
-        'assets': './src/assets/index.ts'
-    },
-    output: {
-        path: path.resolve(__dirname, 'dist'),
-        filename: '[name].js',
-        devtoolModuleFilenameTemplate: '[relative-resource-path]'
-    },
-    plugins: [
-        new webpack.WatchIgnorePlugin([
-            /\.d\.ts$/
-        ])
-    ],
-    resolve: {
-        extensions: ['.ts', '.js']
-    },
-    module: {
-        loaders: [{
-            test: /\.tsx?$/,
-            loader: 'ts-loader',
-            exclude: /node_modules/
-        },
-        {
-            test: /\.(html)$/,
-            use: {
-                loader: 'html-loader',
-                options: {
-                    minimize: true
-                }
-            }
-        },
-        {
-            test: /\.(jpe?g|png|ttf|eot|svg?)(\?[a-z0-9=&.]+)?$/,
-            use: 'base64-image-loader?limit=1000&name=[name].[ext]'
-        },
-        {
-            test: /\.(woff|ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
-            loader: 'base64-font-loader'
-        }]
-    }
-},*/
+const ViewerResolve = require('../Tools/WebpackPlugins/viewerResolve');
+
+module.exports = 
     {
         entry: {
             'viewer': './src/index.ts',
+            'renderOnlyViewer': './src/renderOnlyIndex.ts',
         },
         output: {
             path: path.resolve(__dirname, 'dist'),
@@ -63,8 +24,12 @@ module.exports = /*[
                 "babylonjs-materials": __dirname + '/../dist/preview release/materialsLibrary/babylonjs.materials.js',
                 "babylonjs-loaders": __dirname + '/../dist/preview release/loaders/babylonjs.loaders.js',
                 "babylonjs-viewer-assets": __dirname + '/src/assets/index.ts'
-            }
+            },
+            plugins: [
+                new ViewerResolve(["babylonjs", "babylonjs-loaders"])
+            ]
         },
+        externals: [],
         mode: "development",
         devtool: 'source-map',
         plugins: [
@@ -102,5 +67,4 @@ module.exports = /*[
             //open: true,
             port: 9000
         }
-    }
-//]
+    }

+ 6 - 1
Viewer/webpack.gulp.config.js

@@ -1,6 +1,8 @@
 const path = require('path');
 const webpack = require('webpack');
 
+const ViewerResolve = require('../Tools/WebpackPlugins/viewerResolve');
+
 module.exports = {
     context: __dirname,
     entry: [
@@ -18,7 +20,10 @@ module.exports = {
             "babylonjs-materials": __dirname + '/../dist/preview release/materialsLibrary/babylonjs.materials.js',
             "babylonjs-loaders": __dirname + '/../dist/preview release/loaders/babylonjs.loaders.js',
             "babylonjs-viewer-assets": __dirname + '/src/assets/index.ts'
-        }
+        },
+        plugins: [
+            new ViewerResolve(["babylonjs", "babylonjs-loaders"])
+        ]
     },
     mode: "production",
     module: {

BIN
assets/environments/correlatedBRDF.dds


BIN
assets/environments/correlatedBRDF.png


BIN
assets/environments/correlatedBRDFRGBA.png


BIN
assets/environments/correlatedMSBRDF.dds


BIN
assets/environments/correlatedMSBRDF.png


BIN
assets/environments/correlatedMSBRDFRGBA.png


BIN
assets/environments/uncorrelatedBRDF.dds


BIN
assets/environments/uncorrelatedBRDF.png


BIN
assets/environments/uncorrelatedBRDFRGB.png


Datei-Diff unterdrückt, da er zu groß ist
+ 1158 - 555
dist/preview release/babylon.d.ts


Datei-Diff unterdrückt, da er zu groß ist
+ 2 - 2
dist/preview release/babylon.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1975 - 742
dist/preview release/babylon.max.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/babylon.max.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 2253 - 1020
dist/preview release/babylon.module.d.ts


+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.0.0-alpha.22",
+    "version": "4.0.0-alpha.26",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

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

@@ -54,9 +54,10 @@ declare module BABYLON.GUI {
         /**
          * Gets a string representation of the value
          * @param host defines the root host
+         * @param decimals defines an optional number of decimals to display
          * @returns a string
          */
-        toString(host: AdvancedDynamicTexture): string;
+        toString(host: AdvancedDynamicTexture, decimals?: number): string;
         /**
          * Store a value parsed from a string
          * @param source defines the source string

+ 54 - 47
dist/preview release/gui/babylon.gui.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-gui"] = factory(require("babylonjs"));
 	else
 		root["BABYLON"] = root["BABYLON"] || {}, root["BABYLON"]["GUI"] = factory(root["BABYLON"]);
-})(window, function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
+})(window, function(__WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_tools__) {
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** D:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
 /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -355,7 +355,7 @@ module.exports = g;
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdvancedDynamicTextureInstrumentation", function() { return AdvancedDynamicTextureInstrumentation; });
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__);
 
 /**
@@ -498,7 +498,7 @@ var AdvancedDynamicTextureInstrumentation = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdvancedDynamicTexture", function() { return AdvancedDynamicTexture; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _controls_container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./controls/container */ "./2D/controls/container.ts");
 /* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style */ "./2D/style.ts");
@@ -1613,7 +1613,7 @@ var Button = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Checkbox", function() { return Checkbox; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
@@ -1794,7 +1794,7 @@ var Checkbox = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return ColorPicker; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _inputText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inputText */ "./2D/controls/inputText.ts");
@@ -3241,7 +3241,7 @@ var ColorPicker = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Container", function() { return Container; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/logger */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/logger */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_logger__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../measure */ "./2D/measure.ts");
@@ -3646,7 +3646,7 @@ var Container = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Control", function() { return Control; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
 /* harmony import */ var _measure__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../measure */ "./2D/measure.ts");
@@ -6139,6 +6139,10 @@ var Grid = /** @class */ (function (_super) {
                 cell.top = tops[x] + "px";
                 cell.width = widths[y] + "px";
                 cell.height = heights[x] + "px";
+                cell._left.ignoreAdaptiveScaling = true;
+                cell._top.ignoreAdaptiveScaling = true;
+                cell._width.ignoreAdaptiveScaling = true;
+                cell._height.ignoreAdaptiveScaling = true;
             }
         });
         _super.prototype._additionalProcessing.call(this, parentMeasure, context);
@@ -6202,7 +6206,7 @@ var Grid = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Image", function() { return Image; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 
@@ -6977,7 +6981,7 @@ var InputPassword = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InputText", function() { return InputText; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -7986,7 +7990,7 @@ var InputText = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Line", function() { return Line; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -8179,8 +8183,8 @@ var Line = /** @class */ (function (_super) {
         context.lineWidth = this._lineWidth;
         context.setLineDash(this._dash);
         context.beginPath();
-        context.moveTo(this._x1.getValue(this._host), this._y1.getValue(this._host));
-        context.lineTo(this._effectiveX2, this._effectiveY2);
+        context.moveTo(this._currentMeasure.left, this._currentMeasure.top);
+        context.lineTo(this._currentMeasure.left + this._currentMeasure.width, this._currentMeasure.top + this._currentMeasure.height);
         context.stroke();
         context.restore();
     };
@@ -8190,8 +8194,8 @@ var Line = /** @class */ (function (_super) {
         this._currentMeasure.height = Math.abs(this._y1.getValue(this._host) - this._effectiveY2) + this._lineWidth;
     };
     Line.prototype._computeAlignment = function (parentMeasure, context) {
-        this._currentMeasure.left = Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2;
-        this._currentMeasure.top = Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2;
+        this._currentMeasure.left = parentMeasure.left + Math.min(this._x1.getValue(this._host), this._effectiveX2) - this._lineWidth / 2;
+        this._currentMeasure.top = parentMeasure.top + Math.min(this._y1.getValue(this._host), this._effectiveY2) - this._lineWidth / 2;
     };
     /**
      * Move one end of the line given 3D cartesian coordinates.
@@ -8254,7 +8258,7 @@ var Line = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiLine", function() { return MultiLine; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/abstractMesh */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/abstractMesh */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_abstractMesh__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _multiLinePoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../multiLinePoint */ "./2D/multiLinePoint.ts");
@@ -8521,7 +8525,7 @@ var MultiLine = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RadioButton", function() { return RadioButton; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
@@ -8866,7 +8870,7 @@ var Rectangle = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScrollViewer", function() { return ScrollViewer; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Events/pointerEvents */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Events/pointerEvents */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Events_pointerEvents__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _rectangle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../rectangle */ "./2D/controls/rectangle.ts");
 /* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../grid */ "./2D/controls/grid.ts");
@@ -9957,7 +9961,7 @@ var SelectionPanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseSlider", function() { return BaseSlider; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../control */ "./2D/controls/control.ts");
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../valueAndUnit */ "./2D/valueAndUnit.ts");
@@ -10852,7 +10856,7 @@ var Slider = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StackPanel", function() { return StackPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container */ "./2D/controls/container.ts");
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
@@ -11110,7 +11114,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextWrapping", function() { return TextWrapping; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextBlock", function() { return TextBlock; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../valueAndUnit */ "./2D/valueAndUnit.ts");
 /* harmony import */ var _control__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./control */ "./2D/controls/control.ts");
@@ -11550,7 +11554,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KeyPropertySet", function() { return KeyPropertySet; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualKeyboard", function() { return VirtualKeyboard; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _stackPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stackPanel */ "./2D/controls/stackPanel.ts");
 /* harmony import */ var _button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./button */ "./2D/controls/button.ts");
@@ -11925,7 +11929,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector2WithInfo", function() { return Vector2WithInfo; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Matrix2D", function() { return Matrix2D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -12149,7 +12153,7 @@ var Matrix2D = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Measure", function() { return Measure; });
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
 
 
@@ -12282,7 +12286,7 @@ var Measure = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiLinePoint", function() { return MultiLinePoint; });
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "./2D/valueAndUnit.ts");
 
@@ -12425,7 +12429,7 @@ var MultiLinePoint = /** @class */ (function () {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Style", function() { return Style; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _valueAndUnit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./valueAndUnit */ "./2D/valueAndUnit.ts");
 
@@ -12645,14 +12649,17 @@ var ValueAndUnit = /** @class */ (function () {
     /**
      * Gets a string representation of the value
      * @param host defines the root host
+     * @param decimals defines an optional number of decimals to display
      * @returns a string
      */
-    ValueAndUnit.prototype.toString = function (host) {
+    ValueAndUnit.prototype.toString = function (host, decimals) {
         switch (this.unit) {
             case ValueAndUnit.UNITMODE_PERCENTAGE:
-                return (this.getValue(host) * 100) + "%";
+                var percentage = this.getValue(host) * 100;
+                return (decimals ? percentage.toFixed(decimals) : percentage) + "%";
             case ValueAndUnit.UNITMODE_PIXEL:
-                return this.getValue(host) + "px";
+                var pixels = this.getValue(host);
+                return (decimals ? pixels.toFixed(decimals) : pixels) + "px";
         }
         return this.unit.toString();
     };
@@ -12729,7 +12736,7 @@ var ValueAndUnit = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbstractButton3D", function() { return AbstractButton3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "./3D/controls/control3D.ts");
 
@@ -12772,7 +12779,7 @@ var AbstractButton3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Button3D", function() { return Button3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _abstractButton3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./abstractButton3D */ "./3D/controls/abstractButton3D.ts");
 /* harmony import */ var _2D_advancedDynamicTexture__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../2D/advancedDynamicTexture */ "./2D/advancedDynamicTexture.ts");
@@ -12949,7 +12956,7 @@ var Button3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Container3D", function() { return Container3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Meshes/transformNode */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Meshes_transformNode__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _control3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./control3D */ "./3D/controls/control3D.ts");
 
@@ -13106,7 +13113,7 @@ var Container3D = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Control3D", function() { return Control3D; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _vector3WithInfo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../vector3WithInfo */ "./3D/vector3WithInfo.ts");
 
@@ -13500,7 +13507,7 @@ var Control3D = /** @class */ (function () {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CylinderPanel", function() { return CylinderPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -13585,7 +13592,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HolographicButton", function() { return HolographicButton; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
 /* harmony import */ var _button3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./button3D */ "./3D/controls/button3D.ts");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_2__);
 /* harmony import */ var _materials_fluentMaterial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../materials/fluentMaterial */ "./3D/materials/fluentMaterial.ts");
 /* harmony import */ var _2D_controls_stackPanel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../2D/controls/stackPanel */ "./2D/controls/stackPanel.ts");
@@ -14061,7 +14068,7 @@ var MeshButton3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PlanePanel", function() { return PlanePanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
@@ -14116,7 +14123,7 @@ var PlanePanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ScatterPanel", function() { return ScatterPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -14243,7 +14250,7 @@ var ScatterPanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SpherePanel", function() { return SpherePanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _volumeBasedPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./volumeBasedPanel */ "./3D/controls/volumeBasedPanel.ts");
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
@@ -14328,7 +14335,7 @@ var SpherePanel = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StackPanel3D", function() { return StackPanel3D; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 
@@ -14453,7 +14460,7 @@ var StackPanel3D = /** @class */ (function (_super) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VolumeBasedPanel", function() { return VolumeBasedPanel; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/tools */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _container3D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./container3D */ "./3D/controls/container3D.ts");
 
@@ -14644,7 +14651,7 @@ var VolumeBasedPanel = /** @class */ (function (_super) {
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GUI3DManager", function() { return GUI3DManager; });
-/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Misc/observable */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_0__);
 /* harmony import */ var _controls_container3D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./controls/container3D */ "./3D/controls/container3D.ts");
 
@@ -14911,7 +14918,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FluentMaterialDefines", function() { return FluentMaterialDefines; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FluentMaterial", function() { return FluentMaterial; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Misc/decorators */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _shaders_fluent_vertex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shaders/fluent.vertex */ "./3D/materials/shaders/fluent.vertex.ts");
 /* harmony import */ var _shaders_fluent_fragment__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shaders/fluent.fragment */ "./3D/materials/shaders/fluent.fragment.ts");
@@ -15233,7 +15240,7 @@ __webpack_require__.r(__webpack_exports__);
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fluentPixelShader", function() { return fluentPixelShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 var name = 'fluentPixelShader';
@@ -15255,7 +15262,7 @@ var fluentPixelShader = { name: name, shader: shader };
 "use strict";
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fluentVertexShader", function() { return fluentVertexShader; });
-/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! babylonjs/Materials/effect */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Materials_effect__WEBPACK_IMPORTED_MODULE_0__);
 
 var name = 'fluentVertexShader';
@@ -15278,7 +15285,7 @@ var fluentVertexShader = { name: name, shader: shader };
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Vector3WithInfo", function() { return Vector3WithInfo; });
 /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "../../node_modules/tslib/tslib.es6.js");
-/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/observable");
+/* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! babylonjs/Maths/math */ "babylonjs/Misc/tools");
 /* harmony import */ var babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_1__);
 
 
@@ -15572,14 +15579,14 @@ if (typeof globalObject !== "undefined") {
 
 /***/ }),
 
-/***/ "babylonjs/Misc/observable":
+/***/ "babylonjs/Misc/tools":
 /*!****************************************************************************************************!*\
   !*** external {"root":"BABYLON","commonjs":"babylonjs","commonjs2":"babylonjs","amd":"babylonjs"} ***!
   \****************************************************************************************************/
 /*! no static exports found */
 /***/ (function(module, exports) {
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_tools__;
 
 /***/ })
 

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/gui/babylon.gui.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


+ 4 - 2
dist/preview release/gui/babylon.gui.module.d.ts

@@ -55,9 +55,10 @@ declare module "babylonjs-gui/2D/valueAndUnit" {
         /**
          * Gets a string representation of the value
          * @param host defines the root host
+         * @param decimals defines an optional number of decimals to display
          * @returns a string
          */
-        toString(host: AdvancedDynamicTexture): string;
+        toString(host: AdvancedDynamicTexture, decimals?: number): string;
         /**
          * Store a value parsed from a string
          * @param source defines the source string
@@ -3898,9 +3899,10 @@ declare module BABYLON.GUI {
         /**
          * Gets a string representation of the value
          * @param host defines the root host
+         * @param decimals defines an optional number of decimals to display
          * @returns a string
          */
-        toString(host: AdvancedDynamicTexture): string;
+        toString(host: AdvancedDynamicTexture, decimals?: number): string;
         /**
          * Store a value parsed from a string
          * @param source defines the source string

+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.0.0-alpha.22",
+    "version": "4.0.0-alpha.26",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.0.0-alpha.22"
+        "babylonjs": "4.0.0-alpha.26"
     },
     "engines": {
         "node": "*"

Datei-Diff unterdrückt, da er zu groß ist
+ 7 - 7
dist/preview release/inspector/babylon.inspector.bundle.js


Datei-Diff unterdrückt, da er zu groß ist
+ 2153 - 637
dist/preview release/inspector/babylon.inspector.bundle.max.js


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 157 - 26
dist/preview release/inspector/babylon.inspector.d.ts

@@ -26,6 +26,7 @@ declare module INSPECTOR {
             [key: string]: any;
         };
         blockMutationUpdates: boolean;
+        selectedLineContainerTitle: string;
         prepareGLTFPlugin(loader: BABYLON.GLTFFileLoader): void;
         lightGizmos: Array<BABYLON.LightGizmo>;
         enableLightGizmo(light: BABYLON.Light, enable?: boolean): void;
@@ -77,16 +78,19 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ILineContainerComponentProps {
+        globalState: GlobalState;
         title: string;
         children: any[] | any;
         closed?: boolean;
     }
     export class LineContainerComponent extends React.Component<ILineContainerComponentProps, {
         isExpanded: boolean;
+        isHighlighted: boolean;
     }> {
         private static _InMemoryStorage;
         constructor(props: ILineContainerComponentProps);
         switchExpandedState(): void;
+        componentDidMount(): void;
         renderHeader(): JSX.Element;
         render(): JSX.Element;
     }
@@ -132,6 +136,7 @@ declare module INSPECTOR {
         propertyName?: string;
         isSelected?: () => boolean;
         onSelect?: (value: boolean) => void;
+        onValueChanged?: () => void;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class CheckBoxLineComponent extends React.Component<ICheckBoxLineComponentProps, {
@@ -150,6 +155,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IRenderGridPropertyGridComponentProps {
+        globalState: GlobalState;
         scene: BABYLON.Scene;
     }
     export class RenderGridPropertyGridComponent extends React.Component<IRenderGridPropertyGridComponentProps, {
@@ -164,13 +170,10 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     export class DebugTabComponent extends PaneComponent {
-        private _skeletonViewersEnabled;
         private _physicsViewersEnabled;
-        private _skeletonViewers;
         constructor(props: IPaneComponentProps);
         componentWillMount(): void;
         componentWillUnmount(): void;
-        switchSkeletonViewers(): void;
         switchPhysicsViewers(): void;
         render(): JSX.Element | null;
     }
@@ -242,6 +245,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.Material;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -253,6 +257,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.Material;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -328,12 +333,14 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IStandardMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.StandardMaterial;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class StandardMaterialPropertyGridComponent extends React.Component<IStandardMaterialPropertyGridComponentProps> {
+        private _onDebugSelectionChangeObservable;
         constructor(props: IStandardMaterialPropertyGridComponentProps);
         renderTextures(): JSX.Element | null;
         render(): JSX.Element;
@@ -425,12 +432,14 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IPBRMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.PBRMaterial;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class PBRMaterialPropertyGridComponent extends React.Component<IPBRMaterialPropertyGridComponentProps> {
+        private _onDebugSelectionChangeObservable;
         constructor(props: IPBRMaterialPropertyGridComponentProps);
         renderTextures(onDebugSelectionChangeObservable: BABYLON.Observable<BABYLON.BaseTexture>): JSX.Element | null;
         render(): JSX.Element;
@@ -456,6 +465,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IFogPropertyGridComponentProps {
+        globalState: GlobalState;
         scene: BABYLON.Scene;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -495,6 +505,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IScenePropertyGridComponentProps {
+        globalState: GlobalState;
         scene: BABYLON.Scene;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -514,6 +525,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonLightPropertyGridComponentProps {
+        globalState: GlobalState;
         light: BABYLON.Light;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -525,6 +537,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IHemisphericLightPropertyGridComponentProps {
+        globalState: GlobalState;
         light: BABYLON.HemisphericLight;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -536,6 +549,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonShadowLightPropertyGridComponentProps {
+        globalState: GlobalState;
         light: BABYLON.IShadowLight;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -547,6 +561,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IPointLightPropertyGridComponentProps {
+        globalState: GlobalState;
         light: BABYLON.PointLight;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -558,6 +573,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonCameraPropertyGridComponentProps {
+        globalState: GlobalState;
         camera: BABYLON.Camera;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -571,6 +587,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IFreeCameraPropertyGridComponentProps {
+        globalState: GlobalState;
         camera: BABYLON.FreeCamera;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -582,6 +599,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IArcRotateCameraPropertyGridComponentProps {
+        globalState: GlobalState;
         camera: BABYLON.ArcRotateCamera;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -621,6 +639,7 @@ declare module INSPECTOR {
 declare module INSPECTOR {
     interface IAxisViewerComponentProps {
         node: BABYLON.TransformNode;
+        globalState: GlobalState;
     }
     export class AxesViewerComponent extends React.Component<IAxisViewerComponentProps, {
         displayAxis: boolean;
@@ -635,6 +654,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IMeshPropertyGridComponentProps {
+        globalState: GlobalState;
         mesh: BABYLON.Mesh;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
@@ -654,6 +674,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ITransformNodePropertyGridComponentProps {
+        globalState: GlobalState;
         transformNode: BABYLON.TransformNode;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -665,12 +686,14 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IBackgroundMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.BackgroundMaterial;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class BackgroundMaterialPropertyGridComponent extends React.Component<IBackgroundMaterialPropertyGridComponentProps> {
+        private _onDebugSelectionChangeObservable;
         constructor(props: IBackgroundMaterialPropertyGridComponentProps);
         renderTextures(): JSX.Element;
         render(): JSX.Element;
@@ -702,6 +725,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonControlPropertyGridComponentProps {
+        globalState: GlobalState;
         control: BABYLON.GUI.Control;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -714,6 +738,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IControlPropertyGridComponentProps {
+        globalState: GlobalState;
         control: BABYLON.GUI.Control;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -725,6 +750,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ITextBlockPropertyGridComponentProps {
+        globalState: GlobalState;
         textBlock: BABYLON.GUI.TextBlock;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -736,6 +762,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IInputTextPropertyGridComponentProps {
+        globalState: GlobalState;
         inputText: BABYLON.GUI.InputText;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -747,6 +774,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IColorPickerPropertyGridComponentProps {
+        globalState: GlobalState;
         colorPicker: BABYLON.GUI.ColorPicker;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -768,6 +796,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IAnimationGroupGridComponentProps {
+        globalState: GlobalState;
         animationGroup: BABYLON.AnimationGroup;
         scene: BABYLON.Scene;
         lockObject: LockObject;
@@ -794,6 +823,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IImagePropertyGridComponentProps {
+        globalState: GlobalState;
         image: BABYLON.GUI.Image;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -805,6 +835,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ISliderPropertyGridComponentProps {
+        globalState: GlobalState;
         slider: BABYLON.GUI.Slider;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -816,6 +847,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IImageBasedSliderPropertyGridComponentProps {
+        globalState: GlobalState;
         imageBasedSlider: BABYLON.GUI.ImageBasedSlider;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -827,6 +859,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IRectanglePropertyGridComponentProps {
+        globalState: GlobalState;
         rectangle: BABYLON.GUI.Rectangle;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -838,6 +871,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IEllipsePropertyGridComponentProps {
+        globalState: GlobalState;
         ellipse: BABYLON.GUI.Ellipse;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -849,6 +883,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICheckboxPropertyGridComponentProps {
+        globalState: GlobalState;
         checkbox: BABYLON.GUI.Checkbox;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -860,6 +895,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IRadioButtonPropertyGridComponentProps {
+        globalState: GlobalState;
         radioButton: BABYLON.GUI.RadioButton;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -871,6 +907,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ILinePropertyGridComponentProps {
+        globalState: GlobalState;
         line: BABYLON.GUI.Line;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -883,6 +920,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IScrollViewerPropertyGridComponentProps {
+        globalState: GlobalState;
         scrollViewer: BABYLON.GUI.ScrollViewer;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -894,6 +932,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IGridPropertyGridComponentProps {
+        globalState: GlobalState;
         grid: BABYLON.GUI.Grid;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -907,12 +946,14 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IPBRMetallicRoughnessMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.PBRMetallicRoughnessMaterial;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class PBRMetallicRoughnessMaterialPropertyGridComponent extends React.Component<IPBRMetallicRoughnessMaterialPropertyGridComponentProps> {
+        private _onDebugSelectionChangeObservable;
         constructor(props: IPBRMetallicRoughnessMaterialPropertyGridComponentProps);
         renderTextures(): JSX.Element | null;
         render(): JSX.Element;
@@ -920,12 +961,14 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IPBRSpecularGlossinessMaterialPropertyGridComponentProps {
+        globalState: GlobalState;
         material: BABYLON.PBRSpecularGlossinessMaterial;
         lockObject: LockObject;
         onSelectionChangedObservable?: BABYLON.Observable<any>;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
     }
     export class PBRSpecularGlossinessMaterialPropertyGridComponent extends React.Component<IPBRSpecularGlossinessMaterialPropertyGridComponentProps> {
+        private _onDebugSelectionChangeObservable;
         constructor(props: IPBRSpecularGlossinessMaterialPropertyGridComponentProps);
         renderTextures(): JSX.Element | null;
         render(): JSX.Element;
@@ -933,6 +976,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IStackPanelPropertyGridComponentProps {
+        globalState: GlobalState;
         stackPanel: BABYLON.GUI.StackPanel;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -944,6 +988,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonPostProcessPropertyGridComponentProps {
+        globalState: GlobalState;
         postProcess: BABYLON.PostProcess;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -955,6 +1000,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IPostProcessPropertyGridComponentProps {
+        globalState: GlobalState;
         postProcess: BABYLON.PostProcess;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -966,6 +1012,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ICommonRenderingPipelinePropertyGridComponentProps {
+        globalState: GlobalState;
         renderPipeline: BABYLON.PostProcessRenderPipeline;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -977,6 +1024,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IRenderingPipelinePropertyGridComponentProps {
+        globalState: GlobalState;
         renderPipeline: BABYLON.PostProcessRenderPipeline;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -1013,6 +1061,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface IDefaultRenderingPipelinePropertyGridComponentProps {
+        globalState: GlobalState;
         renderPipeline: BABYLON.DefaultRenderingPipeline;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -1024,6 +1073,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ISSAORenderingPipelinePropertyGridComponentProps {
+        globalState: GlobalState;
         renderPipeline: BABYLON.SSAORenderingPipeline;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -1035,6 +1085,7 @@ declare module INSPECTOR {
 }
 declare module INSPECTOR {
     interface ISSAO2RenderingPipelinePropertyGridComponentProps {
+        globalState: GlobalState;
         renderPipeline: BABYLON.SSAO2RenderingPipeline;
         lockObject: LockObject;
         onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
@@ -1045,6 +1096,85 @@ declare module INSPECTOR {
     }
 }
 declare module INSPECTOR {
+    interface IAnimationGridComponentProps {
+        globalState: GlobalState;
+        animatable: BABYLON.IAnimatable;
+        scene: BABYLON.Scene;
+        lockObject: LockObject;
+        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
+    }
+    export class AnimationGridComponent extends React.Component<IAnimationGridComponentProps, {
+        currentFrame: number;
+    }> {
+        private _animations;
+        private _ranges;
+        private _animationControl;
+        private _runningAnimatable;
+        private _onBeforeRenderObserver;
+        private _isPlaying;
+        constructor(props: IAnimationGridComponentProps);
+        playOrPause(): void;
+        componentWillMount(): void;
+        componentWillUnmount(): void;
+        onCurrentFrameChange(value: number): void;
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
+    interface ISkeletonPropertyGridComponentProps {
+        globalState: GlobalState;
+        skeleton: BABYLON.Skeleton;
+        lockObject: LockObject;
+        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
+    }
+    export class SkeletonPropertyGridComponent extends React.Component<ISkeletonPropertyGridComponentProps> {
+        private _skeletonViewersEnabled;
+        private _skeletonViewers;
+        constructor(props: ISkeletonPropertyGridComponentProps);
+        switchSkeletonViewers(): void;
+        checkSkeletonViewerState(props: ISkeletonPropertyGridComponentProps): void;
+        componentWillMount(): void;
+        shouldComponentUpdate(nextProps: ISkeletonPropertyGridComponentProps): boolean;
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
+    interface IBonePropertyGridComponentProps {
+        globalState: GlobalState;
+        bone: BABYLON.Bone;
+        lockObject: LockObject;
+        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
+    }
+    export class BonePropertyGridComponent extends React.Component<IBonePropertyGridComponentProps> {
+        constructor(props: IBonePropertyGridComponentProps);
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
+    interface IDirectionalLightPropertyGridComponentProps {
+        globalState: GlobalState;
+        light: BABYLON.DirectionalLight;
+        lockObject: LockObject;
+        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
+    }
+    export class DirectionalLightPropertyGridComponent extends React.Component<IDirectionalLightPropertyGridComponentProps> {
+        constructor(props: IDirectionalLightPropertyGridComponentProps);
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
+    interface ISpotLightPropertyGridComponentProps {
+        globalState: GlobalState;
+        light: BABYLON.SpotLight;
+        lockObject: LockObject;
+        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
+    }
+    export class SpotLightPropertyGridComponent extends React.Component<ISpotLightPropertyGridComponentProps> {
+        constructor(props: ISpotLightPropertyGridComponentProps);
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
     export class PropertyGridTabComponent extends PaneComponent {
         private _timerIntervalId;
         private _lockObject;
@@ -1324,6 +1454,28 @@ declare module INSPECTOR {
     }
 }
 declare module INSPECTOR {
+    interface ISkeletonTreeItemComponentProps {
+        skeleton: BABYLON.Skeleton;
+        extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
+        onClick: () => void;
+    }
+    export class SkeletonTreeItemComponent extends React.Component<ISkeletonTreeItemComponentProps> {
+        constructor(props: ISkeletonTreeItemComponentProps);
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
+    interface IBoneTreeItemComponenttProps {
+        bone: BABYLON.Bone;
+        extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup[];
+        onClick: () => void;
+    }
+    export class BoneTreeItemComponent extends React.Component<IBoneTreeItemComponenttProps> {
+        constructor(props: IBoneTreeItemComponenttProps);
+        render(): JSX.Element;
+    }
+}
+declare module INSPECTOR {
     interface ITreeItemSpecializedComponentProps {
         label: string;
         entity?: any;
@@ -1509,9 +1661,10 @@ declare module INSPECTOR {
         private static _Scene;
         private static _OpenedPane;
         private static _OnBeforeRenderObserver;
-        static OnSelectionChangeObservable: BABYLON.Observable<string>;
+        static OnSelectionChangeObservable: BABYLON.Observable<any>;
         static OnPropertyChangedObservable: BABYLON.Observable<PropertyChangedEvent>;
         private static _GlobalState;
+        static MarkLineContainerTitleForHighlighting(title: string): void;
         private static _CopyStyles;
         private static _CreateSceneExplorer;
         private static _CreateActionTabs;
@@ -1526,26 +1679,4 @@ declare module INSPECTOR {
         private static _RemoveElementFromDOM;
         static Hide(): void;
     }
-}
-declare module INSPECTOR {
-    interface IDirectionalLightPropertyGridComponentProps {
-        light: BABYLON.DirectionalLight;
-        lockObject: LockObject;
-        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
-    }
-    export class DirectionalLightPropertyGridComponent extends React.Component<IDirectionalLightPropertyGridComponentProps> {
-        constructor(props: IDirectionalLightPropertyGridComponentProps);
-        render(): JSX.Element;
-    }
-}
-declare module INSPECTOR {
-    interface ISpotLightPropertyGridComponentProps {
-        light: BABYLON.SpotLight;
-        lockObject: LockObject;
-        onPropertyChangedObservable?: BABYLON.Observable<PropertyChangedEvent>;
-    }
-    export class SpotLightPropertyGridComponent extends React.Component<ISpotLightPropertyGridComponentProps> {
-        constructor(props: ISpotLightPropertyGridComponentProps);
-        render(): JSX.Element;
-    }
 }

Datei-Diff unterdrückt, da er zu groß ist
+ 396 - 62
dist/preview release/inspector/babylon.inspector.module.d.ts


+ 6 - 6
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.0.0-alpha.22",
+    "version": "4.0.0-alpha.26",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -31,11 +31,11 @@
     "dependencies": {
         "@types/react": "~16.7.3",
         "@types/react-dom": "~16.0.9",
-        "babylonjs": "4.0.0-alpha.22",
-        "babylonjs-gui": "4.0.0-alpha.22",
-        "babylonjs-loaders": "4.0.0-alpha.22",
-        "babylonjs-serializers": "4.0.0-alpha.22",
-        "babylonjs-gltf2interface": "4.0.0-alpha.22"
+        "babylonjs": "4.0.0-alpha.26",
+        "babylonjs-gui": "4.0.0-alpha.26",
+        "babylonjs-loaders": "4.0.0-alpha.26",
+        "babylonjs-serializers": "4.0.0-alpha.26",
+        "babylonjs-gltf2interface": "4.0.0-alpha.26"
     },
     "engines": {
         "node": "*"

+ 1 - 1
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** D:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
 /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {

+ 2 - 2
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1543,8 +1543,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene || 0);
+            else if (_this.gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 3 - 3
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** D:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
 /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -4092,8 +4092,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene || 0);
+            else if (_this.gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 81 - 19
dist/preview release/loaders/babylon.objFileLoader.js

@@ -383,7 +383,12 @@ var MTLFileLoader = /** @class */ (function () {
  * This is a babylon scene loader plugin.
  */
 var OBJFileLoader = /** @class */ (function () {
-    function OBJFileLoader() {
+    /**
+     * Creates loader for .OBJ files
+     *
+     * @param meshLoadOptions options for loading and parsing OBJ/MTL files.
+     */
+    function OBJFileLoader(meshLoadOptions) {
         /**
          * Defines the name of the plugin.
          */
@@ -425,7 +430,22 @@ var OBJFileLoader = /** @class */ (function () {
         // f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal ...
         /** @hidden */
         this.facePattern5 = /f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
+        this._meshLoadOptions = meshLoadOptions || OBJFileLoader.currentMeshLoadOptions;
     }
+    Object.defineProperty(OBJFileLoader, "currentMeshLoadOptions", {
+        get: function () {
+            return {
+                ComputeNormals: OBJFileLoader.COMPUTE_NORMALS,
+                ImportVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS,
+                InvertY: OBJFileLoader.INVERT_Y,
+                MaterialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY,
+                OptimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV,
+                SkipMaterials: OBJFileLoader.SKIP_MATERIALS
+            };
+        },
+        enumerable: true,
+        configurable: true
+    });
     /**
      * Calls synchronously the MTL file attached to this obj.
      * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
@@ -437,11 +457,29 @@ var OBJFileLoader = /** @class */ (function () {
      * @param onSuccess Callback function to be called when the MTL file is loaded
      * @private
      */
-    OBJFileLoader.prototype._loadMTL = function (url, rootUrl, onSuccess) {
+    OBJFileLoader.prototype._loadMTL = function (url, rootUrl, onSuccess, onFailure) {
         //The complete path to the mtl file
         var pathOfFile = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].BaseUrl + rootUrl + url;
         // Loads through the babylon tools to allow fileInput search.
-        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
+        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function (request, exception) {
+            onFailure(pathOfFile, exception);
+        });
+    };
+    /**
+     * Instantiates a OBJ file loader plugin.
+     * @returns the created plugin
+     */
+    OBJFileLoader.prototype.createPlugin = function () {
+        return new OBJFileLoader(OBJFileLoader.currentMeshLoadOptions);
+    };
+    /**
+     * If the data string can be loaded directly.
+     *
+     * @param data string containing the file data
+     * @returns if the data can be loaded directly
+     */
+    OBJFileLoader.prototype.canDirectLoad = function (data) {
+        return false;
     };
     /**
      * Imports one or more meshes from the loaded OBJ data and adds them to the scene
@@ -578,7 +616,7 @@ var OBJFileLoader = /** @class */ (function () {
         var setData = function (indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {
             //Check if this tuple already exists in the list of tuples
             var _index;
-            if (OBJFileLoader.OPTIMIZE_WITH_UV) {
+            if (_this._meshLoadOptions.OptimizeWithUV) {
                 _index = isInArrayUV(tuplePosNorm, [
                     indicePositionFromObj,
                     indiceNormalFromObj,
@@ -614,7 +652,7 @@ var OBJFileLoader = /** @class */ (function () {
                 //Add the tuple in the comparison list
                 tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                 tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                if (OBJFileLoader.OPTIMIZE_WITH_UV) {
+                if (_this._meshLoadOptions.OptimizeWithUV) {
                     tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
                 }
             }
@@ -636,7 +674,7 @@ var OBJFileLoader = /** @class */ (function () {
                 unwrappedNormalsForBabylon.push(wrappedNormalsForBabylon[l].x, wrappedNormalsForBabylon[l].y, wrappedNormalsForBabylon[l].z);
                 unwrappedUVForBabylon.push(wrappedUvsForBabylon[l].x, wrappedUvsForBabylon[l].y); //z is an optional value not supported by BABYLON
             }
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (_this._meshLoadOptions.ImportVertexColors === true) {
                 //Push the r, g, b, a values of each element in the unwrapped array
                 unwrappedColorsForBabylon.push(wrappedColorsForBabylon[l].r, wrappedColorsForBabylon[l].g, wrappedColorsForBabylon[l].b, wrappedColorsForBabylon[l].a);
             }
@@ -696,7 +734,7 @@ var OBJFileLoader = /** @class */ (function () {
                 setData(indicePositionFromObj, 0, 0, //In the pattern 1, normals and uvs are not defined
                 positions[indicePositionFromObj], //Get the vectors data
                 babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Up(), //Create default vectors
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -721,7 +759,7 @@ var OBJFileLoader = /** @class */ (function () {
                 setData(indicePositionFromObj, indiceUvsFromObj, 0, //Default value for normals
                 positions[indicePositionFromObj], //Get the values for each element
                 uvs[indiceUvsFromObj], babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Up(), //Default value for normals
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -768,7 +806,7 @@ var OBJFileLoader = /** @class */ (function () {
                 var indiceNormalFromObj = parseInt(point[1]) - 1;
                 setData(indicePositionFromObj, 1, //Default value for uv
                 indiceNormalFromObj, positions[indicePositionFromObj], //Get each vector of data
-                babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), normals[indiceNormalFromObj], OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), normals[indiceNormalFromObj], _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -793,7 +831,7 @@ var OBJFileLoader = /** @class */ (function () {
                 // Set normal indice
                 var indiceNormalFromObj = normals.length + parseInt(point[2]);
                 setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positions[indicePositionFromObj], uvs[indiceUvsFromObj], normals[indiceNormalFromObj], //Set the vector for each component
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -814,7 +852,7 @@ var OBJFileLoader = /** @class */ (function () {
                 handledMesh.positions = unwrappedPositionsForBabylon.slice();
                 handledMesh.normals = unwrappedNormalsForBabylon.slice();
                 handledMesh.uvs = unwrappedUVForBabylon.slice();
-                if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+                if (_this._meshLoadOptions.ImportVertexColors === true) {
                     handledMesh.colors = unwrappedColorsForBabylon.slice();
                 }
                 //Reset the array for the next mesh
@@ -843,7 +881,7 @@ var OBJFileLoader = /** @class */ (function () {
                 // ["v", "1.0", "2.0", "3.0"]
                 //Create a Vector3 with the position x, y, z
                 positions.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"](parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
-                if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+                if (this._meshLoadOptions.ImportVertexColors === true) {
                     if (result.length >= 7) {
                         // TODO: if these numbers are > 1 we can use Color4.FromInts(r,g,b,a)
                         colors.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color4"](parseFloat(result[4]), parseFloat(result[5]), parseFloat(result[6]), (result.length === 7 || result[7] === undefined) ? 1 : parseFloat(result[7])));
@@ -987,7 +1025,7 @@ var OBJFileLoader = /** @class */ (function () {
             handledMesh.positions = unwrappedPositionsForBabylon;
             handledMesh.normals = unwrappedNormalsForBabylon;
             handledMesh.uvs = unwrappedUVForBabylon;
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (this._meshLoadOptions.ImportVertexColors === true) {
                 handledMesh.colors = unwrappedColorsForBabylon;
             }
         }
@@ -1039,7 +1077,7 @@ var OBJFileLoader = /** @class */ (function () {
             vertexData.uvs = handledMesh.uvs;
             vertexData.indices = handledMesh.indices;
             vertexData.positions = handledMesh.positions;
-            if (OBJFileLoader.COMPUTE_NORMALS === true) {
+            if (this._meshLoadOptions.ComputeNormals === true) {
                 var normals_1 = new Array();
                 babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["VertexData"].ComputeNormals(handledMesh.positions, handledMesh.indices, normals_1);
                 vertexData.normals = normals_1;
@@ -1047,12 +1085,12 @@ var OBJFileLoader = /** @class */ (function () {
             else {
                 vertexData.normals = handledMesh.normals;
             }
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (this._meshLoadOptions.ImportVertexColors === true) {
                 vertexData.colors = handledMesh.colors;
             }
             //Set the data from the VertexBuffer to the current Mesh
             vertexData.applyToMesh(babylonMesh);
-            if (OBJFileLoader.INVERT_Y) {
+            if (this._meshLoadOptions.InvertY) {
                 babylonMesh.scaling.y *= -1;
             }
             //Push the mesh into an array
@@ -1061,7 +1099,7 @@ var OBJFileLoader = /** @class */ (function () {
         var mtlPromises = [];
         //load the materials
         //Check if we have a file to load
-        if (fileToLoad !== "") {
+        if (fileToLoad !== "" && this._meshLoadOptions.SkipMaterials === false) {
             //Load the file synchronously
             mtlPromises.push(new Promise(function (resolve, reject) {
                 _this._loadMTL(fileToLoad, rootUrl, function (dataLoaded) {
@@ -1096,7 +1134,21 @@ var OBJFileLoader = /** @class */ (function () {
                         resolve();
                     }
                     catch (e) {
-                        reject(e);
+                        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error processing MTL file: '" + fileToLoad + "'");
+                        if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
+                            resolve();
+                        }
+                        else {
+                            reject(e);
+                        }
+                    }
+                }, function (pathOfFile, exception) {
+                    babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error downloading MTL file: '" + fileToLoad + "'");
+                    if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
+                        resolve();
+                    }
+                    else {
+                        reject(exception);
                     }
                 });
             }));
@@ -1119,9 +1171,19 @@ var OBJFileLoader = /** @class */ (function () {
      */
     OBJFileLoader.IMPORT_VERTEX_COLORS = false;
     /**
-     * Compute the normals for the model, even if normals are present in the file
+     * Compute the normals for the model, even if normals are present in the file.
      */
     OBJFileLoader.COMPUTE_NORMALS = false;
+    /**
+     * Skip loading the materials even if defined in the OBJ file (materials are ignored).
+     */
+    OBJFileLoader.SKIP_MATERIALS = false;
+    /**
+     * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
+     *
+     * Defaults to true for backwards compatibility.
+     */
+    OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = true;
     return OBJFileLoader;
 }());
 

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.js.map


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


+ 61 - 2
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1758,10 +1758,39 @@ declare module BABYLON {
         private static _getTexture;
     }
     /**
+     * Options for loading OBJ/MTL files
+     */
+    type MeshLoadOptions = {
+        /**
+         * Defines if UVs are optimized by default during load.
+         */
+        OptimizeWithUV: boolean;
+        /**
+         * Invert model on y-axis (does a model scaling inversion)
+         */
+        InvertY: boolean;
+        /**
+         * Include in meshes the vertex colors available in some OBJ files.  This is not part of OBJ standard.
+         */
+        ImportVertexColors: boolean;
+        /**
+         * Compute the normals for the model, even if normals are present in the file.
+         */
+        ComputeNormals: boolean;
+        /**
+         * Skip loading the materials even if defined in the OBJ file (materials are ignored).
+         */
+        SkipMaterials: boolean;
+        /**
+         * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
+         */
+        MaterialLoadingFailsSilently: boolean;
+    };
+    /**
      * OBJ file type loader.
      * This is a babylon scene loader plugin.
      */
-    export class OBJFileLoader implements ISceneLoaderPluginAsync {
+    export class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
         /**
          * Defines if UVs are optimized by default during load.
          */
@@ -1775,10 +1804,20 @@ declare module BABYLON {
          */
         static IMPORT_VERTEX_COLORS: boolean;
         /**
-         * Compute the normals for the model, even if normals are present in the file
+         * Compute the normals for the model, even if normals are present in the file.
          */
         static COMPUTE_NORMALS: boolean;
         /**
+         * Skip loading the materials even if defined in the OBJ file (materials are ignored).
+         */
+        static SKIP_MATERIALS: boolean;
+        /**
+         * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
+         *
+         * Defaults to true for backwards compatibility.
+         */
+        static MATERIAL_LOADING_FAILS_SILENTLY: boolean;
+        /**
          * Defines the name of the plugin.
          */
         name: string;
@@ -1812,6 +1851,14 @@ declare module BABYLON {
         facePattern4: RegExp;
         /** @hidden */
         facePattern5: RegExp;
+        private _meshLoadOptions;
+        /**
+         * Creates loader for .OBJ files
+         *
+         * @param meshLoadOptions options for loading and parsing OBJ/MTL files.
+         */
+        constructor(meshLoadOptions?: MeshLoadOptions);
+        private static readonly currentMeshLoadOptions;
         /**
          * Calls synchronously the MTL file attached to this obj.
          * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
@@ -1825,6 +1872,18 @@ declare module BABYLON {
          */
         private _loadMTL;
         /**
+         * Instantiates a OBJ file loader plugin.
+         * @returns the created plugin
+         */
+        createPlugin(): ISceneLoaderPluginAsync | ISceneLoaderPlugin;
+        /**
+         * If the data string can be loaded directly.
+         *
+         * @param data string containing the file data
+         * @returns if the data can be loaded directly
+         */
+        canDirectLoad(data: string): boolean;
+        /**
          * Imports one or more meshes from the loaded OBJ data and adds them to the scene
          * @param meshesNames a string or array of strings of the mesh names that should be loaded from the file
          * @param scene the scene the meshes should be added to

+ 84 - 22
dist/preview release/loaders/babylonjs.loaders.js

@@ -98,7 +98,7 @@ return /******/ (function(modules) { // webpackBootstrap
 
 /***/ "../../node_modules/tslib/tslib.es6.js":
 /*!***********************************************************!*\
-  !*** D:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
+  !*** E:/Repos/Babylon.js/node_modules/tslib/tslib.es6.js ***!
   \***********************************************************/
 /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
@@ -601,7 +601,12 @@ var MTLFileLoader = /** @class */ (function () {
  * This is a babylon scene loader plugin.
  */
 var OBJFileLoader = /** @class */ (function () {
-    function OBJFileLoader() {
+    /**
+     * Creates loader for .OBJ files
+     *
+     * @param meshLoadOptions options for loading and parsing OBJ/MTL files.
+     */
+    function OBJFileLoader(meshLoadOptions) {
         /**
          * Defines the name of the plugin.
          */
@@ -643,7 +648,22 @@ var OBJFileLoader = /** @class */ (function () {
         // f -vertex/-uvs/-normal -vertex/-uvs/-normal -vertex/-uvs/-normal ...
         /** @hidden */
         this.facePattern5 = /f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/;
+        this._meshLoadOptions = meshLoadOptions || OBJFileLoader.currentMeshLoadOptions;
     }
+    Object.defineProperty(OBJFileLoader, "currentMeshLoadOptions", {
+        get: function () {
+            return {
+                ComputeNormals: OBJFileLoader.COMPUTE_NORMALS,
+                ImportVertexColors: OBJFileLoader.IMPORT_VERTEX_COLORS,
+                InvertY: OBJFileLoader.INVERT_Y,
+                MaterialLoadingFailsSilently: OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY,
+                OptimizeWithUV: OBJFileLoader.OPTIMIZE_WITH_UV,
+                SkipMaterials: OBJFileLoader.SKIP_MATERIALS
+            };
+        },
+        enumerable: true,
+        configurable: true
+    });
     /**
      * Calls synchronously the MTL file attached to this obj.
      * Load function or importMesh function don't enable to load 2 files in the same time asynchronously.
@@ -655,11 +675,29 @@ var OBJFileLoader = /** @class */ (function () {
      * @param onSuccess Callback function to be called when the MTL file is loaded
      * @private
      */
-    OBJFileLoader.prototype._loadMTL = function (url, rootUrl, onSuccess) {
+    OBJFileLoader.prototype._loadMTL = function (url, rootUrl, onSuccess, onFailure) {
         //The complete path to the mtl file
         var pathOfFile = babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].BaseUrl + rootUrl + url;
         // Loads through the babylon tools to allow fileInput search.
-        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function () { console.warn("Error - Unable to load " + pathOfFile); });
+        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].LoadFile(pathOfFile, onSuccess, undefined, undefined, false, function (request, exception) {
+            onFailure(pathOfFile, exception);
+        });
+    };
+    /**
+     * Instantiates a OBJ file loader plugin.
+     * @returns the created plugin
+     */
+    OBJFileLoader.prototype.createPlugin = function () {
+        return new OBJFileLoader(OBJFileLoader.currentMeshLoadOptions);
+    };
+    /**
+     * If the data string can be loaded directly.
+     *
+     * @param data string containing the file data
+     * @returns if the data can be loaded directly
+     */
+    OBJFileLoader.prototype.canDirectLoad = function (data) {
+        return false;
     };
     /**
      * Imports one or more meshes from the loaded OBJ data and adds them to the scene
@@ -796,7 +834,7 @@ var OBJFileLoader = /** @class */ (function () {
         var setData = function (indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positionVectorFromOBJ, textureVectorFromOBJ, normalsVectorFromOBJ, positionColorsFromOBJ) {
             //Check if this tuple already exists in the list of tuples
             var _index;
-            if (OBJFileLoader.OPTIMIZE_WITH_UV) {
+            if (_this._meshLoadOptions.OptimizeWithUV) {
                 _index = isInArrayUV(tuplePosNorm, [
                     indicePositionFromObj,
                     indiceNormalFromObj,
@@ -832,7 +870,7 @@ var OBJFileLoader = /** @class */ (function () {
                 //Add the tuple in the comparison list
                 tuplePosNorm[indicePositionFromObj].normals.push(indiceNormalFromObj);
                 tuplePosNorm[indicePositionFromObj].idx.push(curPositionInIndices++);
-                if (OBJFileLoader.OPTIMIZE_WITH_UV) {
+                if (_this._meshLoadOptions.OptimizeWithUV) {
                     tuplePosNorm[indicePositionFromObj].uv.push(indiceUvsFromObj);
                 }
             }
@@ -854,7 +892,7 @@ var OBJFileLoader = /** @class */ (function () {
                 unwrappedNormalsForBabylon.push(wrappedNormalsForBabylon[l].x, wrappedNormalsForBabylon[l].y, wrappedNormalsForBabylon[l].z);
                 unwrappedUVForBabylon.push(wrappedUvsForBabylon[l].x, wrappedUvsForBabylon[l].y); //z is an optional value not supported by BABYLON
             }
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (_this._meshLoadOptions.ImportVertexColors === true) {
                 //Push the r, g, b, a values of each element in the unwrapped array
                 unwrappedColorsForBabylon.push(wrappedColorsForBabylon[l].r, wrappedColorsForBabylon[l].g, wrappedColorsForBabylon[l].b, wrappedColorsForBabylon[l].a);
             }
@@ -914,7 +952,7 @@ var OBJFileLoader = /** @class */ (function () {
                 setData(indicePositionFromObj, 0, 0, //In the pattern 1, normals and uvs are not defined
                 positions[indicePositionFromObj], //Get the vectors data
                 babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Up(), //Create default vectors
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -939,7 +977,7 @@ var OBJFileLoader = /** @class */ (function () {
                 setData(indicePositionFromObj, indiceUvsFromObj, 0, //Default value for normals
                 positions[indicePositionFromObj], //Get the values for each element
                 uvs[indiceUvsFromObj], babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"].Up(), //Default value for normals
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -986,7 +1024,7 @@ var OBJFileLoader = /** @class */ (function () {
                 var indiceNormalFromObj = parseInt(point[1]) - 1;
                 setData(indicePositionFromObj, 1, //Default value for uv
                 indiceNormalFromObj, positions[indicePositionFromObj], //Get each vector of data
-                babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), normals[indiceNormalFromObj], OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector2"].Zero(), normals[indiceNormalFromObj], _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -1011,7 +1049,7 @@ var OBJFileLoader = /** @class */ (function () {
                 // Set normal indice
                 var indiceNormalFromObj = normals.length + parseInt(point[2]);
                 setData(indicePositionFromObj, indiceUvsFromObj, indiceNormalFromObj, positions[indicePositionFromObj], uvs[indiceUvsFromObj], normals[indiceNormalFromObj], //Set the vector for each component
-                OBJFileLoader.IMPORT_VERTEX_COLORS === true ? colors[indicePositionFromObj] : undefined);
+                _this._meshLoadOptions.ImportVertexColors === true ? colors[indicePositionFromObj] : undefined);
             }
             //Reset variable for the next line
             triangles = [];
@@ -1032,7 +1070,7 @@ var OBJFileLoader = /** @class */ (function () {
                 handledMesh.positions = unwrappedPositionsForBabylon.slice();
                 handledMesh.normals = unwrappedNormalsForBabylon.slice();
                 handledMesh.uvs = unwrappedUVForBabylon.slice();
-                if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+                if (_this._meshLoadOptions.ImportVertexColors === true) {
                     handledMesh.colors = unwrappedColorsForBabylon.slice();
                 }
                 //Reset the array for the next mesh
@@ -1061,7 +1099,7 @@ var OBJFileLoader = /** @class */ (function () {
                 // ["v", "1.0", "2.0", "3.0"]
                 //Create a Vector3 with the position x, y, z
                 positions.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Vector3"](parseFloat(result[1]), parseFloat(result[2]), parseFloat(result[3])));
-                if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+                if (this._meshLoadOptions.ImportVertexColors === true) {
                     if (result.length >= 7) {
                         // TODO: if these numbers are > 1 we can use Color4.FromInts(r,g,b,a)
                         colors.push(new babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Color4"](parseFloat(result[4]), parseFloat(result[5]), parseFloat(result[6]), (result.length === 7 || result[7] === undefined) ? 1 : parseFloat(result[7])));
@@ -1205,7 +1243,7 @@ var OBJFileLoader = /** @class */ (function () {
             handledMesh.positions = unwrappedPositionsForBabylon;
             handledMesh.normals = unwrappedNormalsForBabylon;
             handledMesh.uvs = unwrappedUVForBabylon;
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (this._meshLoadOptions.ImportVertexColors === true) {
                 handledMesh.colors = unwrappedColorsForBabylon;
             }
         }
@@ -1257,7 +1295,7 @@ var OBJFileLoader = /** @class */ (function () {
             vertexData.uvs = handledMesh.uvs;
             vertexData.indices = handledMesh.indices;
             vertexData.positions = handledMesh.positions;
-            if (OBJFileLoader.COMPUTE_NORMALS === true) {
+            if (this._meshLoadOptions.ComputeNormals === true) {
                 var normals_1 = new Array();
                 babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["VertexData"].ComputeNormals(handledMesh.positions, handledMesh.indices, normals_1);
                 vertexData.normals = normals_1;
@@ -1265,12 +1303,12 @@ var OBJFileLoader = /** @class */ (function () {
             else {
                 vertexData.normals = handledMesh.normals;
             }
-            if (OBJFileLoader.IMPORT_VERTEX_COLORS === true) {
+            if (this._meshLoadOptions.ImportVertexColors === true) {
                 vertexData.colors = handledMesh.colors;
             }
             //Set the data from the VertexBuffer to the current Mesh
             vertexData.applyToMesh(babylonMesh);
-            if (OBJFileLoader.INVERT_Y) {
+            if (this._meshLoadOptions.InvertY) {
                 babylonMesh.scaling.y *= -1;
             }
             //Push the mesh into an array
@@ -1279,7 +1317,7 @@ var OBJFileLoader = /** @class */ (function () {
         var mtlPromises = [];
         //load the materials
         //Check if we have a file to load
-        if (fileToLoad !== "") {
+        if (fileToLoad !== "" && this._meshLoadOptions.SkipMaterials === false) {
             //Load the file synchronously
             mtlPromises.push(new Promise(function (resolve, reject) {
                 _this._loadMTL(fileToLoad, rootUrl, function (dataLoaded) {
@@ -1314,7 +1352,21 @@ var OBJFileLoader = /** @class */ (function () {
                         resolve();
                     }
                     catch (e) {
-                        reject(e);
+                        babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error processing MTL file: '" + fileToLoad + "'");
+                        if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
+                            resolve();
+                        }
+                        else {
+                            reject(e);
+                        }
+                    }
+                }, function (pathOfFile, exception) {
+                    babylonjs_Maths_math__WEBPACK_IMPORTED_MODULE_0__["Tools"].Warn("Error downloading MTL file: '" + fileToLoad + "'");
+                    if (_this._meshLoadOptions.MaterialLoadingFailsSilently) {
+                        resolve();
+                    }
+                    else {
+                        reject(exception);
                     }
                 });
             }));
@@ -1337,9 +1389,19 @@ var OBJFileLoader = /** @class */ (function () {
      */
     OBJFileLoader.IMPORT_VERTEX_COLORS = false;
     /**
-     * Compute the normals for the model, even if normals are present in the file
+     * Compute the normals for the model, even if normals are present in the file.
      */
     OBJFileLoader.COMPUTE_NORMALS = false;
+    /**
+     * Skip loading the materials even if defined in the OBJ file (materials are ignored).
+     */
+    OBJFileLoader.SKIP_MATERIALS = false;
+    /**
+     * When a material fails to load OBJ loader will silently fail and onSuccess() callback will be triggered.
+     *
+     * Defaults to true for backwards compatibility.
+     */
+    OBJFileLoader.MATERIAL_LOADING_FAILS_SILENTLY = true;
     return OBJFileLoader;
 }());
 
@@ -5346,8 +5408,8 @@ var GLTFLoader = /** @class */ (function () {
             if (nodes) {
                 promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
             }
-            else {
-                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene || 0);
+            else if (_this.gltf.scene != undefined) {
+                var scene = ArrayItem.Get("/scene", _this.gltf.scenes, _this.gltf.scene);
                 promises.push(_this.loadSceneAsync("/scenes/" + scene.index, scene));
             }
             if (_this._parent.compileMaterials) {

Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


+ 0 - 0
dist/preview release/loaders/babylonjs.loaders.min.js


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.