@crystaldesign/real-time-viewer 24.10.0-rc.1 → 24.10.0-rc.2

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.
@@ -2066,6 +2066,9 @@ var customMat = /*#__PURE__*/function () {
2066
2066
  mat,
2067
2067
  res,
2068
2068
  parsedMat,
2069
+ baseTexture,
2070
+ mRTexture,
2071
+ nTexture,
2069
2072
  found,
2070
2073
  _args = arguments;
2071
2074
  return _regeneratorRuntime.wrap(function _callee$(_context) {
@@ -2095,9 +2098,12 @@ var customMat = /*#__PURE__*/function () {
2095
2098
  res = _context.sent;
2096
2099
  parsedMat = PBRMetallicRoughnessMaterial.Parse(res, _customMat.scene, '');
2097
2100
  parsedMat.name = _customMat.name;
2098
- parsedMat.baseTexture._mimeType = 'image/jpeg';
2099
- parsedMat.metallicRoughnessTexture._mimeType = 'image/jpeg';
2100
- parsedMat.normalTexture._mimeType = 'image/jpeg';
2101
+ baseTexture = parsedMat.baseTexture;
2102
+ mRTexture = parsedMat.metallicRoughnessTexture;
2103
+ nTexture = parsedMat.normalTexture;
2104
+ if (baseTexture) baseTexture._mimeType = baseTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2105
+ if (mRTexture) mRTexture._mimeType = mRTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2106
+ if (nTexture) nTexture._mimeType = nTexture.url.endsWith('.jpg') ? 'image/jpeg' : 'image/png';
2101
2107
  found = !!parsedMat.baseTexture;
2102
2108
  if (!found) LOG$1.error(new DivaError('MISSING_MATERIAL: could not get material ' + _customMat.name + ' for iln ' + _customMat.blob, {
2103
2109
  code: 'RTS_0002'
@@ -2114,8 +2120,8 @@ var customMat = /*#__PURE__*/function () {
2114
2120
  mat: parsedMat,
2115
2121
  found: true
2116
2122
  });
2117
- case 26:
2118
- _context.prev = 26;
2123
+ case 29:
2124
+ _context.prev = 29;
2119
2125
  _context.t0 = _context["catch"](8);
2120
2126
  if (setDataRow) useUtilStoreContext().setAnalyzeDataRow({
2121
2127
  type: 'MAT',
@@ -2125,16 +2131,16 @@ var customMat = /*#__PURE__*/function () {
2125
2131
  path: _customMat.blob,
2126
2132
  sizeMb: 0
2127
2133
  });
2128
- case 29:
2134
+ case 32:
2129
2135
  return _context.abrupt("return", {
2130
2136
  mat: new PBRMetallicRoughnessMaterial(_customMat.name, _customMat.scene),
2131
2137
  found: true
2132
2138
  });
2133
- case 30:
2139
+ case 33:
2134
2140
  case "end":
2135
2141
  return _context.stop();
2136
2142
  }
2137
- }, _callee, null, [[8, 26]]);
2143
+ }, _callee, null, [[8, 29]]);
2138
2144
  }));
2139
2145
  return function customMat(_x) {
2140
2146
  return _ref.apply(this, arguments);
@@ -3085,7 +3091,7 @@ function useRealTimeRenderData (_ref) {
3085
3091
  sceneStore.hasRendered = true;
3086
3092
  }
3087
3093
 
3088
- //sceneStore.scene.debugLayer?.show();
3094
+ // sceneStore.scene.debugLayer?.show();
3089
3095
  sceneStore.scene.onAfterRenderObservable.add(onFirstFrame);
3090
3096
  LOG.successTransaction('BUILD_SCENE');
3091
3097
  case 33:
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CustomMaterial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAI1G,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD,QAAA,MAAM,SAAS,cAAqB,cAAc,eAAc,OAAO,KAAU,QAAQ;IAAE,GAAG,EAAE,4BAA4B,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAkC7I,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/CustomMaterial/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4DAA4D,CAAC;AAI1G,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAGD,QAAA,MAAM,SAAS,cAAqB,cAAc,eAAc,OAAO,KAAU,QAAQ;IAAE,GAAG,EAAE,4BAA4B,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAsC7I,CAAC;AAEF,eAAe,SAAS,CAAC"}