|
@@ -123,6 +123,7 @@ module BABYLON.GLTF2 {
|
|
|
this._state = GLTFLoaderState.Loading;
|
|
|
|
|
|
this._loadData(data);
|
|
|
+ this._checkExtensions();
|
|
|
|
|
|
const promises = new Array<Promise<void>>();
|
|
|
|
|
@@ -231,6 +232,17 @@ module BABYLON.GLTF2 {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private _checkExtensions(): void {
|
|
|
+ if (this._gltf.extensionsRequired) {
|
|
|
+ for (const name of this._gltf.extensionsRequired) {
|
|
|
+ const extension = this._extensions[name];
|
|
|
+ if (!extension || !extension.enabled) {
|
|
|
+ throw new Error(`Require extension ${name} is not available`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private _createRootNode(): ILoaderNode {
|
|
|
this._rootBabylonMesh = new Mesh("__root__", this._babylonScene);
|
|
|
const rootNode = { _babylonMesh: this._rootBabylonMesh } as ILoaderNode;
|