@shapediver/viewer.data-engine.geometry-engine
Advanced tools
Comparing version 3.2.7 to 3.2.8
@@ -326,2 +326,4 @@ "use strict"; | ||
const loadedTexture = this._textureLoader.getTexture(textureId); | ||
if (!loadedTexture) | ||
return; | ||
return new viewer_shared_types_1.MapData(loadedTexture.image, { | ||
@@ -328,0 +330,0 @@ blob: loadedTexture.blob, |
@@ -33,4 +33,2 @@ "use strict"; | ||
throw new Error('TextureLoader.getTexture: Texture not available.'); | ||
if (!this._loaded[textureId]) | ||
throw new Error('TextureLoader.getTexture: Texture not loaded.'); | ||
return this._loaded[textureId]; | ||
@@ -79,19 +77,24 @@ } | ||
.then(response => { | ||
if (typeof window !== 'undefined') { | ||
viewer_shared_services_1.Converter.instance.responseToImage(response).then(img => { | ||
if (!response) { | ||
resolve(); | ||
} | ||
else { | ||
if (typeof window !== 'undefined') { | ||
viewer_shared_services_1.Converter.instance.responseToImage(response).then(img => { | ||
this._loaded[textureId] = { | ||
image: img, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
}) | ||
.catch(e => reject(e)); | ||
} | ||
else { | ||
this._loaded[textureId] = { | ||
image: img, | ||
image: response.data.buffer, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
}) | ||
.catch(e => reject(e)); | ||
} | ||
} | ||
else { | ||
this._loaded[textureId] = { | ||
image: response.data.buffer, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
} | ||
}) | ||
@@ -98,0 +101,0 @@ .catch(e => reject(e)); |
{ | ||
"name": "@shapediver/viewer.data-engine.geometry-engine", | ||
"version": "3.2.7", | ||
"version": "3.2.8", | ||
"description": "", | ||
@@ -43,10 +43,10 @@ "keywords": [], | ||
"@shapediver/sdk.geometry-api-sdk-v2": "1.10.0", | ||
"@shapediver/viewer.data-engine.material-engine": "3.2.7", | ||
"@shapediver/viewer.data-engine.shared-types": "3.2.7", | ||
"@shapediver/viewer.rendering-engine.camera-engine": "3.2.7", | ||
"@shapediver/viewer.rendering-engine.light-engine": "3.2.7", | ||
"@shapediver/viewer.shared.build-data": "3.2.7", | ||
"@shapediver/viewer.shared.node-tree": "3.2.7", | ||
"@shapediver/viewer.shared.services": "3.2.7", | ||
"@shapediver/viewer.shared.types": "3.2.7", | ||
"@shapediver/viewer.data-engine.material-engine": "3.2.8", | ||
"@shapediver/viewer.data-engine.shared-types": "3.2.8", | ||
"@shapediver/viewer.rendering-engine.camera-engine": "3.2.8", | ||
"@shapediver/viewer.rendering-engine.light-engine": "3.2.8", | ||
"@shapediver/viewer.shared.build-data": "3.2.8", | ||
"@shapediver/viewer.shared.node-tree": "3.2.8", | ||
"@shapediver/viewer.shared.services": "3.2.8", | ||
"@shapediver/viewer.shared.types": "3.2.8", | ||
"axios": "^1.2.6", | ||
@@ -60,3 +60,3 @@ "gl-matrix": "3.3.0" | ||
}, | ||
"gitHead": "d21783f03fd4f64b1e44708998c55c1685f76701" | ||
"gitHead": "a8c27c745498812d103635aeec6d5311d6e8c8e3" | ||
} |
@@ -352,3 +352,3 @@ import { Converter, HttpClient } from '@shapediver/viewer.shared.services'; | ||
private loadMap(textureId: number, properties?: { offset?: number[], scale?: number[], rotation?: number, texCoord?: number }): IMapData { | ||
private loadMap(textureId: number, properties?: { offset?: number[], scale?: number[], rotation?: number, texCoord?: number }): IMapData | undefined { | ||
if (!this._content.textures) throw new Error('Textures not available.'); | ||
@@ -360,2 +360,5 @@ const texture = this._content.textures[textureId]; | ||
if(!loadedTexture) | ||
return; | ||
return new MapData( | ||
@@ -362,0 +365,0 @@ loadedTexture.image, |
@@ -35,3 +35,2 @@ import { IGLTF_v2 } from '@shapediver/viewer.data-engine.shared-types'; | ||
if (!this._content.textures[textureId]) throw new Error('TextureLoader.getTexture: Texture not available.'); | ||
if (!this._loaded[textureId]) throw new Error('TextureLoader.getTexture: Texture not loaded.'); | ||
return this._loaded[textureId]; | ||
@@ -87,17 +86,21 @@ } | ||
.then(response => { | ||
if(typeof window !== 'undefined') { | ||
Converter.instance.responseToImage(response).then(img => { | ||
if (!response) { | ||
resolve(); | ||
} else { | ||
if (typeof window !== 'undefined') { | ||
Converter.instance.responseToImage(response).then(img => { | ||
this._loaded[textureId] = { | ||
image: img, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
}) | ||
.catch(e => reject(e)); | ||
} else { | ||
this._loaded[textureId] = { | ||
image: img, | ||
image: response.data.buffer, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
}) | ||
.catch(e => reject(e)); | ||
} else { | ||
this._loaded[textureId] = { | ||
image: response.data.buffer, | ||
blob: response.data.blob | ||
}; | ||
resolve(); | ||
} | ||
} | ||
@@ -104,0 +107,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7763496
62442
+ Added@shapediver/viewer.data-engine.material-engine@3.2.8(transitive)
+ Added@shapediver/viewer.data-engine.shared-types@3.2.8(transitive)
+ Added@shapediver/viewer.rendering-engine.camera-engine@3.2.8(transitive)
+ Added@shapediver/viewer.rendering-engine.light-engine@3.2.8(transitive)
+ Added@shapediver/viewer.rendering-engine.rendering-engine@3.2.8(transitive)
+ Added@shapediver/viewer.shared.build-data@3.2.8(transitive)
+ Added@shapediver/viewer.shared.math@3.2.8(transitive)
+ Added@shapediver/viewer.shared.node-tree@3.2.8(transitive)
+ Added@shapediver/viewer.shared.services@3.2.8(transitive)
+ Added@shapediver/viewer.shared.types@3.2.8(transitive)
- Removed@shapediver/viewer.data-engine.material-engine@3.2.7(transitive)
- Removed@shapediver/viewer.data-engine.shared-types@3.2.7(transitive)
- Removed@shapediver/viewer.rendering-engine.camera-engine@3.2.7(transitive)
- Removed@shapediver/viewer.rendering-engine.light-engine@3.2.7(transitive)
- Removed@shapediver/viewer.rendering-engine.rendering-engine@3.2.7(transitive)
- Removed@shapediver/viewer.shared.build-data@3.2.7(transitive)
- Removed@shapediver/viewer.shared.math@3.2.7(transitive)
- Removed@shapediver/viewer.shared.node-tree@3.2.7(transitive)
- Removed@shapediver/viewer.shared.services@3.2.7(transitive)
- Removed@shapediver/viewer.shared.types@3.2.7(transitive)
Updated@shapediver/viewer.rendering-engine.camera-engine@3.2.8
Updated@shapediver/viewer.rendering-engine.light-engine@3.2.8