@needle-tools/materialx 1.0.0-next.4880afa → 1.0.0-next.5e016a7

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.
@@ -0,0 +1,36 @@
1
+ name: Release Workflow
2
+ on:
3
+ push:
4
+ branches:
5
+ - 'release/stable'
6
+ - 'release/next'
7
+ - 'release/experimental'
8
+
9
+ jobs:
10
+ run-release-script:
11
+ runs-on: ubuntu-latest
12
+ timeout-minutes: 5
13
+ defaults:
14
+ run:
15
+ working-directory: ./
16
+ steps:
17
+ - name: Checkout code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: '22'
24
+
25
+ - name: Install dependencies
26
+ run: npm ci
27
+
28
+ - name: Publish to npm (stable branch)
29
+ if: startsWith(github.ref_name, 'release/stable')
30
+ run: npx --yes needle-publish-helper@stable publish "." --webhook "${{ secrets.DISCORD_WEBHOOK }}" --access-token "${{ secrets.NPM_TOKEN }}" --tag "stable" --create-tag "release/"
31
+
32
+ - name: Publish to npm (next and experimental branches)
33
+ if: ${{ !startsWith(github.ref_name, 'release/stable') }}
34
+ run: npx --yes needle-publish-helper@stable publish "." --webhook "${{ secrets.DISCORD_WEBHOOK }}" --access-token "${{ secrets.NPM_TOKEN }}" --tag "${{ github.ref_name }}" --version+tag --version+hash --create-tag "release/"
35
+
36
+
package/bin/README.md ADDED
@@ -0,0 +1,5 @@
1
+ Source: https://github.com/AcademySoftwareFoundation/MaterialX/tree/gh-pages
2
+
3
+ Edits:
4
+
5
+ - `JsMaterialXGenShader.js` added `export default MaterialX;` at bottom
package/package.json CHANGED
@@ -1,24 +1,17 @@
1
1
  {
2
2
  "name": "@needle-tools/materialx",
3
- "version": "1.0.0-next.4880afa",
3
+ "version": "1.0.0-next.5e016a7",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "exports": {
7
- ".": {
8
- "import": "./src/index.ts",
9
- "require": "./src/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,16 +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
- 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;
11
-
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
-
18
8
  // Configure MaterialX with the correct path for its data files
19
9
  const materialXConfig = {
20
10
  locateFile: (path: string, scriptDirectory: string) => {
@@ -22,19 +12,9 @@ const materialXConfig = {
22
12
 
23
13
  // Return the correct path for MaterialX data files
24
14
  if (path.endsWith('.data') || path.endsWith('.wasm')) {
25
- if(path.includes("JsMaterialXCore.wasm")) {
26
- return coreWasmUrl; // Use the URL for the core WASM file
27
- }
28
- else if (path.includes("JsMaterialXGenShader.data")) {
29
- return shaderDataUrl; // Use the URL for the shader data file
30
- }
31
- else if (path.includes("JsMaterialXGenShader.wasm")) {
32
- return shaderWasmUrl; // Use the URL for the shader WASM file
33
- }
34
15
  // For Vite dev server, we need to use the correct module path
35
- const url = new URL(`../bin/${path}?url`, import.meta.url);
36
- const correctPath = url.href;
37
- if (debug) console.debug("MaterialX locateFile resolved:", correctPath, { url, meta_url: import.meta.url });
16
+ const correctPath = new URL(`../bin/${path}`, import.meta.url).href;
17
+ if (debug) console.log("Resolved path:", correctPath);
38
18
  return correctPath;
39
19
  }
40
20
  return scriptDirectory + path;
@@ -0,0 +1,18 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "."
5
+ },
6
+ {
7
+ "name": "Needle",
8
+ "path": "./node_modules/@needle-tools"
9
+ }
10
+ ],
11
+ "settings": {
12
+ "files.exclude": {
13
+ "**/.git": true,
14
+ "**/.DS_Store": true,
15
+ "**/*.meta": true
16
+ }
17
+ }
18
+ }