@needle-tools/materialx 1.0.0-next.12f185d → 1.0.0-next.1935162

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 +3 -10
  2. package/src/materialx.ts +4 -21
package/package.json CHANGED
@@ -1,24 +1,17 @@
1
1
  {
2
2
  "name": "@needle-tools/materialx",
3
- "version": "1.0.0-next.12f185d",
3
+ "version": "1.0.0-next.1935162",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "exports": {
7
- ".": {
8
- "import": "./index.ts",
9
- "require": "./index.js"
10
- },
11
- "./package.json": "./package.json"
12
- },
6
+ "dependencies": {},
13
7
  "peerDependencies": {
14
8
  "@needle-tools/engine": "4.x",
15
9
  "three": "npm:@needle-tools/three@^0.169.5"
16
10
  },
17
11
  "devDependencies": {
18
12
  "@needle-tools/engine": "4.x",
19
- "@types/three": "0.169.0",
20
13
  "three": "npm:@needle-tools/three@^0.169.5",
21
- "vite": "^7.0.3"
14
+ "@types/three": "0.169.0"
22
15
  },
23
16
  "publishConfig": {
24
17
  "access": "public",
package/src/materialx.ts CHANGED
@@ -5,14 +5,6 @@ import { renderPMREMToEquirect } from "./textureHelper.js";
5
5
  import { Light, MeshBasicMaterial, Object3D, PMREMGenerator } from "three";
6
6
  import { registerLights } from "./helper.js";
7
7
 
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&inline";
14
-
15
-
16
8
  // Configure MaterialX with the correct path for its data files
17
9
  const materialXConfig = {
18
10
  locateFile: (path: string, scriptDirectory: string) => {
@@ -20,20 +12,11 @@ const materialXConfig = {
20
12
 
21
13
  // Return the correct path for MaterialX data files
22
14
  if (path.endsWith('.data') || path.endsWith('.wasm')) {
23
- if(path.includes("JsMaterialXCore.wasm")) {
24
- return coreWasmUrl; // Use the URL for the core WASM file
25
- }
26
- else if (path.includes("JsMaterialXGenShader.wasm")) {
27
- return shaderWasmUrl; // Use the URL for the shader WASM file
28
- }
29
- else if (path.includes("JsMaterialXGenShader.data")) {
30
- return shaderDataUrl; // Use the URL for the shader data file
31
- }
32
15
  // For Vite dev server, we need to use the correct module path
33
- // const url = new URL(`../bin/${path}?url`, import.meta.url);
34
- // const correctPath = url.href;
35
- // if (debug) console.debug("MaterialX locateFile resolved:", correctPath, { url, meta_url: import.meta.url });
36
- // return correctPath;
16
+ const url = new URL(`../bin/${path}?url`, import.meta.url);
17
+ const correctPath = url.href;
18
+ if (debug) console.debug("MaterialX locateFile resolved:", correctPath, { url, meta_url: import.meta.url });
19
+ return correctPath;
37
20
  }
38
21
  return scriptDirectory + path;
39
22
  },