@babylonjs/loaders 5.0.0-rc.3 → 5.0.0-rc.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -249,14 +249,16 @@ var GLTFLoader = /** @class */ (function () {
249
249
  // Block the marking of materials dirty until the scene is loaded.
250
250
  var oldBlockMaterialDirtyMechanism = _this._babylonScene.blockMaterialDirtyMechanism;
251
251
  _this._babylonScene.blockMaterialDirtyMechanism = true;
252
- if (nodes) {
253
- promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
254
- }
255
- else if (_this._gltf.scene != undefined || (_this._gltf.scenes && _this._gltf.scenes[0])) {
256
- var scene = ArrayItem.Get("/scene", _this._gltf.scenes, _this._gltf.scene || 0);
257
- promises.push(_this.loadSceneAsync("/scenes/".concat(scene.index), scene));
252
+ if (!_this.parent.loadOnlyMaterials) {
253
+ if (nodes) {
254
+ promises.push(_this.loadSceneAsync("/nodes", { nodes: nodes, index: -1 }));
255
+ }
256
+ else if (_this._gltf.scene != undefined || (_this._gltf.scenes && _this._gltf.scenes[0])) {
257
+ var scene = ArrayItem.Get("/scene", _this._gltf.scenes, _this._gltf.scene || 0);
258
+ promises.push(_this.loadSceneAsync("/scenes/".concat(scene.index), scene));
259
+ }
258
260
  }
259
- if (_this.parent.loadAllMaterials && _this._gltf.materials) {
261
+ if (!_this.parent.skipMaterials && _this.parent.loadAllMaterials && _this._gltf.materials) {
260
262
  for (var m = 0; m < _this._gltf.materials.length; ++m) {
261
263
  var material = _this._gltf.materials[m];
262
264
  var context_1 = "/materials/" + m;
@@ -748,7 +750,7 @@ var GLTFLoader = /** @class */ (function () {
748
750
  }
749
751
  babylonMesh_1.material = babylonMaterial;
750
752
  }
751
- else {
753
+ else if (!this.parent.skipMaterials) {
752
754
  var material = ArrayItem.Get("".concat(context, "/material"), this._gltf.materials, primitive.material);
753
755
  promises.push(this._loadMaterialAsync("/materials/".concat(material.index), material, babylonMesh_1, babylonDrawMode, function (babylonMaterial) {
754
756
  babylonMesh_1.material = babylonMaterial;