Raanan Weber 7 年 前
コミット
1fbd20ee00

+ 5 - 1
Viewer/tsconfig-gulp.json

@@ -31,5 +31,9 @@
                 "../dist/babylon.glTF2Interface.d.ts"
             ]
         }
-    }
+    },
+    "exclude": [
+        "node_modules",
+        "dist"
+    ]
 }

ファイルの差分が大きいため隠しています
+ 9 - 9
dist/preview release/viewer/babylon.viewer.js


+ 23 - 20
dist/preview release/viewer/babylon.viewer.max.js

@@ -94330,11 +94330,11 @@ var AbstractViewer = (function () {
     AbstractViewer.prototype.initModel = function (modelConfig, clearScene) {
         var _this = this;
         if (clearScene === void 0) { clearScene = true; }
-        var model = this.modelLoader.load(modelConfig);
         if (clearScene) {
             this.models.forEach(function (m) { return m.dispose(); });
             this.models.length = 0;
         }
+        var model = this.modelLoader.load(modelConfig);
         this.lastUsedLoader = model.loader;
         model.onLoadErrorObservable.add(function (errorObject) {
             _this.onModelLoadErrorObservable.notifyObserversWithPromise(errorObject);
@@ -95112,9 +95112,9 @@ var TemplateManager = (function () {
     function TemplateManager(containerElement) {
         this.containerElement = containerElement;
         this.templates = {};
-        this.onInit = new babylonjs_1.Observable();
-        this.onLoaded = new babylonjs_1.Observable();
-        this.onStateChange = new babylonjs_1.Observable();
+        this.onTemplateInit = new babylonjs_1.Observable();
+        this.onTemplateLoaded = new babylonjs_1.Observable();
+        this.onTemplateStateChange = new babylonjs_1.Observable();
         this.onAllLoaded = new babylonjs_1.Observable();
         this.onEventTriggered = new babylonjs_1.Observable();
         this.eventManager = new eventManager_1.EventManager(this);
@@ -95157,6 +95157,13 @@ var TemplateManager = (function () {
             if (!templates[name])
                 return Promise.resolve(false);
             var template = new Template(name, templates[name]);
+            template.onLoaded.add(function () {
+                _this.onTemplateLoaded.notifyObservers(template);
+            });
+            template.onStateChange.add(function () {
+                _this.onTemplateStateChange.notifyObservers(template);
+            });
+            _this.onTemplateInit.notifyObservers(template);
             template.onEventTriggered.add(function (eventData) { return _this.onEventTriggered.notifyObservers(eventData); });
             _this.templates[name] = template;
             return template.initPromise;
@@ -95199,11 +95206,11 @@ var TemplateManager = (function () {
         });
         this.templates = {};
         this.eventManager.dispose();
-        this.onInit.clear();
+        this.onTemplateInit.clear();
         this.onAllLoaded.clear();
         this.onEventTriggered.clear();
-        this.onLoaded.clear();
-        this.onStateChange.clear();
+        this.onTemplateLoaded.clear();
+        this.onTemplateStateChange.clear();
     };
     return TemplateManager;
 }());
@@ -95229,7 +95236,6 @@ var Template = (function () {
         var _this = this;
         this.name = name;
         this._configuration = _configuration;
-        this.onInit = new babylonjs_1.Observable();
         this.onLoaded = new babylonjs_1.Observable();
         this.onAppended = new babylonjs_1.Observable();
         this.onStateChange = new babylonjs_1.Observable();
@@ -95238,7 +95244,6 @@ var Template = (function () {
         this.isLoaded = false;
         this.isShown = false;
         this.isInHtmlTree = false;
-        this.onInit.notifyObservers(this);
         var htmlContentPromise = this._getTemplateAsHtml(_configuration);
         this.initPromise = htmlContentPromise.then(function (htmlTemplate) {
             if (htmlTemplate) {
@@ -95348,7 +95353,6 @@ var Template = (function () {
     Template.prototype.dispose = function () {
         this.onAppended.clear();
         this.onEventTriggered.clear();
-        this.onInit.clear();
         this.onLoaded.clear();
         this.onStateChange.clear();
         this.isLoaded = false;
@@ -95376,7 +95380,7 @@ var Template = (function () {
             return Promise.resolve(templateConfig.html);
         }
         else {
-            var location_1 = getTemplateLocation(templateConfig);
+            var location_1 = this._getTemplateLocation(templateConfig);
             if (helper_1.isUrl(location_1)) {
                 return new Promise(function (resolve, reject) {
                     var fileRequest = babylonjs_1.Tools.LoadFile(location_1, function (data) {
@@ -95449,18 +95453,17 @@ var Template = (function () {
             }
         }
     };
+    Template.prototype._getTemplateLocation = function (templateConfig) {
+        if (!templateConfig || typeof templateConfig === 'string') {
+            return templateConfig;
+        }
+        else {
+            return templateConfig.location;
+        }
+    };
     return Template;
 }());
 exports.Template = Template;
-function getTemplateLocation(templateConfig) {
-    if (!templateConfig || typeof templateConfig === 'string') {
-        return templateConfig;
-    }
-    else {
-        return templateConfig.location;
-    }
-}
-exports.getTemplateLocation = getTemplateLocation;
 
 
 /***/ }),