@needle-tools/materialx 1.0.0-next.a660bbe → 1.0.0-next.c8c3181

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/materialx.ts +9 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/materialx",
3
- "version": "1.0.0-next.a660bbe",
3
+ "version": "1.0.0-next.c8c3181",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "exports": {
package/src/materialx.ts CHANGED
@@ -5,15 +5,13 @@ import { renderPMREMToEquirect } from "./textureHelper.js";
5
5
  import { Light, MeshBasicMaterial, Object3D, PMREMGenerator } from "three";
6
6
  import { registerLights } from "./helper.js";
7
7
 
8
- const coreWasmUrl = new URL('../bin/JsMaterialXCore.wasm', import.meta.url).href;
9
- const shaderDataUrl = new URL('../bin/JsMaterialXGenShader.data', import.meta.url).href;
10
- const shaderWasmUrl = new URL('../bin/JsMaterialXGenShader.wasm', import.meta.url).href;
8
+ // @ts-ignore
9
+ import coreWasmUrl from "../bin/JsMaterialXCore.wasm?url";
10
+ // @ts-ignore
11
+ import shaderWasmUrl from "../bin/JsMaterialXGenShader.wasm?url";
12
+ // @ts-ignore
13
+ import shaderDataUrl from "../bin/JsMaterialXGenShader.data?url";
11
14
 
12
- // const moduleUrls = import.meta.glob('../bin/JsMaterialXCore.wasm', {
13
- // query: '?url',
14
- // import: 'default',
15
- // })
16
- // import jsMaterialCoreUrl from "../bin/JsMaterialXCore.wasm?url";
17
15
 
18
16
  // Configure MaterialX with the correct path for its data files
19
17
  const materialXConfig = {
@@ -25,12 +23,12 @@ const materialXConfig = {
25
23
  if(path.includes("JsMaterialXCore.wasm")) {
26
24
  return coreWasmUrl; // Use the URL for the core WASM file
27
25
  }
28
- else if (path.includes("JsMaterialXGenShader.data")) {
29
- return shaderDataUrl; // Use the URL for the shader data file
30
- }
31
26
  else if (path.includes("JsMaterialXGenShader.wasm")) {
32
27
  return shaderWasmUrl; // Use the URL for the shader WASM file
33
28
  }
29
+ else if (path.includes("JsMaterialXGenShader.data")) {
30
+ return shaderDataUrl; // Use the URL for the shader data file
31
+ }
34
32
  // For Vite dev server, we need to use the correct module path
35
33
  const url = new URL(`../bin/${path}?url`, import.meta.url);
36
34
  const correctPath = url.href;