@eturnity/eturnity_3d 9.19.0 → 9.25.1-qa-03.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_3d",
3
3
  "private": false,
4
- "version": "9.19.0",
4
+ "version": "9.25.1-qa-03.0",
5
5
  "files": [
6
6
  "dist",
7
7
  "src"
8
8
  ],
9
9
  "main": "./dist/main.umd.js",
10
10
  "module": "./dist/main.es.js",
11
+ "scripts": {
12
+ "dev": "vite",
13
+ "build": "vite build",
14
+ "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src`",
15
+ "prettier": "prettier --write \"**/*.{js,vue}\"",
16
+ "merge-remote-master": "node scripts/merge-remote-master.js"
17
+ },
11
18
  "dependencies": {
12
- "@eturnity/eturnity_maths": "9.19.0",
19
+ "@eturnity/eturnity_maths": "9.25.0-qa-03.0",
13
20
  "@originjs/vite-plugin-commonjs": "1.0.3",
14
21
  "core-js": "3.30.2",
15
22
  "cors": "2.8.5",
@@ -53,12 +60,5 @@
53
60
  "require": "./dist/main.umd.js"
54
61
  },
55
62
  "./src/*": "./src/*"
56
- },
57
- "scripts": {
58
- "dev": "vite",
59
- "build": "vite build",
60
- "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src`",
61
- "prettier": "prettier --write \"**/*.{js,vue}\"",
62
- "merge-remote-master": "node scripts/merge-remote-master.js"
63
63
  }
64
- }
64
+ }
@@ -4,9 +4,12 @@ export default {
4
4
  methods: {
5
5
  loadTextureAsync(url) {
6
6
  return new Promise((resolve) => {
7
- this.loader.load(url, (texture) => {
8
- resolve(texture)
9
- })
7
+ this.loader.load(
8
+ url,
9
+ (texture) => resolve(texture),
10
+ () => {},
11
+ () => resolve(null)
12
+ )
10
13
  })
11
14
  },
12
15
  async loadNewPanelTextures() {
@@ -36,19 +39,27 @@ export default {
36
39
  )
37
40
 
38
41
  await Promise.all(loadTexturesPromises)
42
+ this.renderPanels()
39
43
  return newTexturesLoaded
40
44
  },
41
45
  async loadPanelsTexture() {
42
46
  const promiseArray = this.moduleFields.map(async (mf) => {
43
47
  const pvId = mf.data.component_id_pv_module
44
48
  if (!this.material.panel[pvId]) {
49
+ const defaultPanelMaterial =
50
+ this.material.panel[
51
+ `default_${mf.pvData.module_texture_version_id || 0}`
52
+ ]
45
53
  if (!mf.pvData.texture_img_url) {
46
- this.material.panel[pvId] =
47
- this.material.panel[`default_${this.moduleTextureVersionId}`]
54
+ this.material.panel[pvId] = defaultPanelMaterial
48
55
  } else {
49
56
  const texture = await this.loadTextureAsync(
50
57
  mf.pvData.texture_img_url
51
58
  )
59
+ if (!texture) {
60
+ this.material.panel[pvId] = defaultPanelMaterial
61
+ return
62
+ }
52
63
  texture.encoding = THREE.sRGBEncoding
53
64
  texture.colorSpace = THREE.SRGBColorSpace
54
65
  this.material.panel[pvId] = new THREE.MeshPhongMaterial({
@@ -62,6 +73,7 @@ export default {
62
73
  }
63
74
  })
64
75
  await Promise.all(promiseArray)
76
+ this.renderPanels()
65
77
  },
66
78
  },
67
79
  }