|
@@ -137,16 +137,16 @@ export abstract class AbstractViewer {
|
|
private _onTemplateLoaded(): Promise<AbstractViewer> {
|
|
private _onTemplateLoaded(): Promise<AbstractViewer> {
|
|
return this.onTemplatesLoaded().then(() => {
|
|
return this.onTemplatesLoaded().then(() => {
|
|
let autoLoadModel = !!this.configuration.model;
|
|
let autoLoadModel = !!this.configuration.model;
|
|
- return this.initEngine().then(() => {
|
|
|
|
- return this.onEngineInitObservable.notifyWithPromise(this);
|
|
|
|
|
|
+ return this.initEngine().then((engine) => {
|
|
|
|
+ return this.onEngineInitObservable.notifyWithPromise(engine);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
if (autoLoadModel) {
|
|
if (autoLoadModel) {
|
|
return this.loadModel();
|
|
return this.loadModel();
|
|
} else {
|
|
} else {
|
|
return this.scene || this.initScene();
|
|
return this.scene || this.initScene();
|
|
}
|
|
}
|
|
- }).then(() => {
|
|
|
|
- return this.onSceneInitObservable.notifyWithPromise(this);
|
|
|
|
|
|
+ }).then((scene) => {
|
|
|
|
+ return this.onSceneInitObservable.notifyWithPromise(scene);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
return this.onInitDoneObservable.notifyWithPromise(this);
|
|
return this.onInitDoneObservable.notifyWithPromise(this);
|
|
}).then(() => {
|
|
}).then(() => {
|
|
@@ -226,7 +226,7 @@ export abstract class AbstractViewer {
|
|
}, (e, m, exception) => {
|
|
}, (e, m, exception) => {
|
|
// console.log(m, exception);
|
|
// console.log(m, exception);
|
|
reject(m);
|
|
reject(m);
|
|
- }, plugin);
|
|
|
|
|
|
+ }, plugin)!;
|
|
});
|
|
});
|
|
}).then((meshes: Array<AbstractMesh>) => {
|
|
}).then((meshes: Array<AbstractMesh>) => {
|
|
return this.onModelLoadedObservable.notifyWithPromise(meshes).then(() => {
|
|
return this.onModelLoadedObservable.notifyWithPromise(meshes).then(() => {
|