@babylonjs/loaders 7.29.0 → 7.30.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1898,10 +1898,18 @@ export class GLTFLoader {
1898
1898
  const name = image.uri || `${this._fileName}#image${image.index}`;
1899
1899
  const dataUrl = `data:${this._uniqueRootUrl}${name}`;
1900
1900
  babylonTexture.updateURL(dataUrl, data);
1901
+ // Set the internal texture label.
1902
+ const internalTexture = babylonTexture.getInternalTexture();
1903
+ if (internalTexture) {
1904
+ internalTexture.label = image.name;
1905
+ }
1901
1906
  }));
1902
1907
  babylonTexture.wrapU = samplerData.wrapU;
1903
1908
  babylonTexture.wrapV = samplerData.wrapV;
1904
1909
  assign(babylonTexture);
1910
+ if (this._parent.useGltfTextureNames) {
1911
+ babylonTexture.name = image.name || image.uri || `image${image.index}`;
1912
+ }
1905
1913
  return Promise.all(promises).then(() => {
1906
1914
  return babylonTexture;
1907
1915
  });