Socket
Socket
Sign inDemoInstall

@shapediver/viewer.data-engine.material-engine

Package Overview
Dependencies
47
Maintainers
5
Versions
188
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.11.0 to 2.12.0

12

dist/MaterialEngine.js

@@ -80,10 +80,10 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
let image;
let imageData;
if (!id) {
image = (yield this._httpClient.loadTexture(url)).data;
imageData = (yield this._httpClient.loadTexture(url)).data;
}
else {
image = (yield this._httpClient.loadTexture('https://viewer.shapediver.com/v2/materials/1024/' + id + '/' + url)).data;
imageData = (yield this._httpClient.loadTexture('https://viewer.shapediver.com/v2/materials/1024/' + id + '/' + url)).data;
}
return new viewer_shared_types_1.MapData(image);
return new viewer_shared_types_1.MapData(imageData.image, { blob: imageData.blob });
});

@@ -93,3 +93,3 @@ }

return __awaiter(this, void 0, void 0, function* () {
const image = (yield this._httpClient.loadTexture(texture.href)).data;
const imageData = (yield this._httpClient.loadTexture(texture.href)).data;
const wrapS = texture.wrapS === 1 ? viewer_shared_types_1.TEXTURE_WRAPPING.CLAMP_TO_EDGE : texture.wrapS === 2 ? viewer_shared_types_1.TEXTURE_WRAPPING.MIRRORED_REPEAT : viewer_shared_types_1.TEXTURE_WRAPPING.REPEAT;

@@ -101,3 +101,3 @@ const wrapT = texture.wrapT === 1 ? viewer_shared_types_1.TEXTURE_WRAPPING.CLAMP_TO_EDGE : texture.wrapT === 2 ? viewer_shared_types_1.TEXTURE_WRAPPING.MIRRORED_REPEAT : viewer_shared_types_1.TEXTURE_WRAPPING.REPEAT;

const repeat = texture.repeat ? gl_matrix_1.vec2.fromValues(texture.repeat[0], texture.repeat[1]) : gl_matrix_1.vec2.fromValues(1, 1);
return new viewer_shared_types_1.MapData(image, wrapS, wrapT, viewer_shared_types_1.TEXTURE_FILTERING.LINEAR_MIPMAP_LINEAR, viewer_shared_types_1.TEXTURE_FILTERING.LINEAR, center, color, offset, repeat, texture.rotation || 0);
return new viewer_shared_types_1.MapData(imageData.image, { blob: imageData.blob, wrapS, wrapT, minFilter: viewer_shared_types_1.TEXTURE_FILTERING.LINEAR_MIPMAP_LINEAR, magFilter: viewer_shared_types_1.TEXTURE_FILTERING.LINEAR, center, color, offset, repeat, rotation: texture.rotation || 0 });
});

@@ -104,0 +104,0 @@ }

{
"name": "@shapediver/viewer.data-engine.material-engine",
"version": "2.11.0",
"version": "2.12.0",
"description": "",

@@ -43,10 +43,10 @@ "keywords": [],

"@shapediver/sdk.geometry-api-sdk-v2": "1.6.0",
"@shapediver/viewer.data-engine.shared-types": "2.11.0",
"@shapediver/viewer.shared.node-tree": "2.11.0",
"@shapediver/viewer.shared.services": "2.11.0",
"@shapediver/viewer.shared.types": "2.11.0",
"@shapediver/viewer.data-engine.shared-types": "2.12.0",
"@shapediver/viewer.shared.node-tree": "2.12.0",
"@shapediver/viewer.shared.services": "2.12.0",
"@shapediver/viewer.shared.types": "2.12.0",
"axios": "^1.2.6",
"gl-matrix": "3.3.0"
},
"gitHead": "abc828ee5f772bc79b737c994716b8ec372503ef"
"gitHead": "4453bb1d704facd5722ffd81518e54b5453d991f"
}

@@ -81,13 +81,13 @@ /* eslint-disable no-prototype-builtins */

public async loadMap(url: string, id?: string): Promise<MapData | null> {
let image: HTMLImageElement;
let imageData;
if (!id) {
image = <HTMLImageElement>(await this._httpClient.loadTexture(url)).data;
imageData = (await this._httpClient.loadTexture(url)).data;
} else {
image = <HTMLImageElement>(await this._httpClient.loadTexture('https://viewer.shapediver.com/v2/materials/1024/' + id + '/' + url)).data;
imageData = (await this._httpClient.loadTexture('https://viewer.shapediver.com/v2/materials/1024/' + id + '/' + url)).data;
}
return new MapData(image);
return new MapData(imageData.image, { blob: imageData.blob });
}
public async loadMapWithProperties(texture: ITexture): Promise<MapData | null> {
const image: HTMLImageElement = <HTMLImageElement>(await this._httpClient.loadTexture(texture.href!)).data;
const imageData = (await this._httpClient.loadTexture(texture.href!)).data;

@@ -101,3 +101,3 @@ const wrapS = texture.wrapS === 1 ? TEXTURE_WRAPPING.CLAMP_TO_EDGE : texture.wrapS === 2 ? TEXTURE_WRAPPING.MIRRORED_REPEAT : TEXTURE_WRAPPING.REPEAT;

return new MapData(image, wrapS, wrapT, TEXTURE_FILTERING.LINEAR_MIPMAP_LINEAR, TEXTURE_FILTERING.LINEAR, center, color, offset, repeat, texture.rotation || 0);
return new MapData(imageData.image, { blob: imageData.blob, wrapS, wrapT, minFilter: TEXTURE_FILTERING.LINEAR_MIPMAP_LINEAR, magFilter: TEXTURE_FILTERING.LINEAR, center, color, offset, repeat, rotation: texture.rotation || 0 });
}

@@ -104,0 +104,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc