@needle-tools/usd 0.0.2-next.de2e82b → 1.0.0-next.d536d99
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/CHANGELOG.md +12 -1
- package/README.md +52 -9
- package/package.json +42 -10
- package/src/bindings/emHdBindings.js +5 -12227
- package/src/bindings/emHdBindings.wasm +0 -0
- package/src/bindings/index.js +130 -47
- package/src/bindings/openusd-build-info.json +40 -0
- package/src/create.three.js +362 -53
- package/src/hydra/ThreeJsRenderDelegate.js +959 -73
- package/src/plugins/index.js +1 -2
- package/src/plugins/needle.js +37 -2
- package/src/types/bindings.d.ts +296 -3
- package/src/types/create.three.d.ts +78 -7
- package/src/types/hydra.d.ts +7 -5
- package/src/types/plugins.d.ts +2 -0
- package/src/types/usd-core-bindings.d.ts +240 -0
- package/src/utils.js +3 -3
- package/examples/index.html +0 -58
- package/examples/package-lock.json +0 -1548
- package/examples/package.json +0 -24
- package/examples/public/HttpReferences copy.usda +0 -46
- package/examples/public/HttpReferences.usda +0 -44
- package/examples/public/gingerbread/GingerbreadHouse.usda +0 -35
- package/examples/public/gingerbread/house/GingerBreadHouse.usdc +0 -0
- package/examples/public/gingerbread/house/textures/color.jpg +0 -0
- package/examples/public/gingerbread/house/textures/metallic_roughness.jpg +0 -0
- package/examples/public/gingerbread/house/textures/normal.jpg +0 -0
- package/examples/public/gingerbread/snowman/Snowman.usdc +0 -0
- package/examples/public/gingerbread/snowman/textures/color.jpg +0 -0
- package/examples/public/gingerbread/snowman/textures/metallic_roughness.jpg +0 -0
- package/examples/public/gingerbread/snowman/textures/normal.jpg +0 -0
- package/examples/public/test.usdz +0 -0
- package/examples/public/vite.svg +0 -1
- package/examples/src/fileHandling.ts +0 -256
- package/examples/src/main.ts +0 -167
- package/examples/src/three.ts +0 -140
- package/examples/src/vite-env.d.ts +0 -1
- package/examples/tsconfig.json +0 -23
- package/examples/vite.config.js +0 -21
- package/src/bindings/emHdBindings.data +0 -19331
- package/src/bindings/emHdBindings.worker.js +0 -124
package/CHANGELOG.md
CHANGED
|
@@ -4,5 +4,16 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.0.0-next.0] - 2026-06-25
|
|
8
|
+
- Modernized the wasm runtime to upstream OpenUSD 26.05 with Hydra imaging enabled for the three.js render delegate.
|
|
9
|
+
- Added the Adobe glTF file-format plugin, MaterialX support through Hydra material documents, and OpenSubdiv-enabled builds.
|
|
10
|
+
- Added generated TypeScript declarations and usdview-style inspection/change APIs for programmatic stage interaction.
|
|
11
|
+
- Switched the client MaterialX shader path to `@needle-tools/materialx@1.7.0`.
|
|
12
|
+
- Added explicit package entrypoints for `@needle-tools/usd/three`, `@needle-tools/usd/plugins`, and `@needle-tools/usd/vite`.
|
|
13
|
+
- Added a Needle Engine browser matrix that validates the USD package through Engine `dist` and package-module runtime shapes.
|
|
14
|
+
- Added a technical demo render-host switch for viewing the same USD samples through plain three.js or a Needle Engine `Context`.
|
|
15
|
+
- Read stage metadata from the live `UsdStage` API so up-axis state remains stable across referenced asset reloads.
|
|
16
|
+
- Changed the license to PolyForm Noncommercial 1.0.0.
|
|
17
|
+
|
|
7
18
|
## [0.0.1-alpha] - 2025-05-14
|
|
8
|
-
- initial release
|
|
19
|
+
- initial release
|
package/README.md
CHANGED
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
# Needle USD
|
|
2
2
|
|
|
3
|
-
USD wasm runtime and three.js
|
|
4
|
-
Developed & maintained by [Needle](https://needle.tools)
|
|
5
|
-
|
|
3
|
+
USD wasm runtime and three.js Hydra delegate.
|
|
4
|
+
Developed & maintained by [Needle](https://needle.tools).
|
|
5
|
+
|
|
6
|
+
For commercial use, please contact [hi@needle.tools](mailto:hi@needle.tools).
|
|
6
7
|
|
|
7
8
|
## Install
|
|
8
|
-
`npm install @needle-tools/usd`
|
|
9
9
|
|
|
10
|
+
```sh
|
|
11
|
+
npm install @needle-tools/usd@next three @needle-tools/materialx@1.7.0
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This major prerelease uses upstream OpenUSD 26.05 and ships a Hydra imaging
|
|
15
|
+
bridge for three.js. The wasm bundle includes Adobe `usdGltf`, MaterialX, and
|
|
16
|
+
OpenSubdiv support.
|
|
17
|
+
|
|
18
|
+
## Runtime Requirements
|
|
19
|
+
|
|
20
|
+
This package ships a threaded Emscripten/OpenUSD wasm build. Browser pages that
|
|
21
|
+
use it must be served in a cross-origin isolated context so `SharedArrayBuffer`
|
|
22
|
+
and pthread workers are available:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
res.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
|
|
26
|
+
res.setHeader("Cross-Origin-Opener-Policy", "same-origin");
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For Vite projects, use the package plugin to set these headers during local
|
|
30
|
+
development:
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
import { needleUSD } from "@needle-tools/usd/vite";
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
plugins: [needleUSD()],
|
|
37
|
+
};
|
|
38
|
+
```
|
|
10
39
|
|
|
40
|
+
The modern Emscripten output contains `emHdBindings.js` and
|
|
41
|
+
`emHdBindings.wasm`. It does not ship a separate `emHdBindings.worker.js`; the
|
|
42
|
+
pthread workers load the main generated JavaScript entrypoint directly.
|
|
11
43
|
|
|
12
44
|
## Use with Needle Engine
|
|
13
45
|
|
|
@@ -26,12 +58,15 @@ export function addUsdPlugin() {
|
|
|
26
58
|
```
|
|
27
59
|
|
|
28
60
|
|
|
29
|
-
### Use with
|
|
61
|
+
### Use with three.js
|
|
30
62
|
|
|
31
63
|
|
|
32
|
-
See full example in [examples](
|
|
64
|
+
See full example in [examples](/usd-wasm/examples/src/main.ts)
|
|
33
65
|
|
|
34
66
|
```js
|
|
67
|
+
import { getUsdModule } from "@needle-tools/usd";
|
|
68
|
+
import { createThreeHydra } from "@needle-tools/usd/three";
|
|
69
|
+
|
|
35
70
|
// Load the USD module
|
|
36
71
|
const usd = await getUsdModule();
|
|
37
72
|
// Load a USD file to be rendered by threejs
|
|
@@ -43,9 +78,18 @@ const handle = await createThreeHydra({
|
|
|
43
78
|
// Call handle.update(dt) in your threejs update loop
|
|
44
79
|
```
|
|
45
80
|
|
|
81
|
+
Public package entrypoints:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
import { getUsdModule, loadOpenUsdBuildInfo } from "@needle-tools/usd";
|
|
85
|
+
import { createThreeHydra } from "@needle-tools/usd/three";
|
|
86
|
+
import { addPluginForNeedleEngine } from "@needle-tools/usd/plugins";
|
|
87
|
+
import { needleUSD } from "@needle-tools/usd/vite";
|
|
88
|
+
```
|
|
89
|
+
|
|
46
90
|
|
|
47
91
|
|
|
48
|
-
## Low Level
|
|
92
|
+
## Low Level Usage
|
|
49
93
|
|
|
50
94
|
### Import
|
|
51
95
|
```js
|
|
@@ -85,7 +129,7 @@ driver.Draw();
|
|
|
85
129
|
|
|
86
130
|
## Useful References
|
|
87
131
|
|
|
88
|
-
Uses Asyncify to handle async calls in emscripten.
|
|
132
|
+
Uses `Asyncify` to handle async calls in emscripten.
|
|
89
133
|
> A synchronous call in C that waits for an asynchronous operation in JS to complete.
|
|
90
134
|
https://emscripten.org/docs/porting/asyncify.html
|
|
91
135
|
|
|
@@ -97,4 +141,3 @@ https://emscripten.org/docs/porting/asyncify.html
|
|
|
97
141
|
[Discord](https://discord.needle.tools) •
|
|
98
142
|
[Forum](https://forum.needle.tools) •
|
|
99
143
|
[Youtube](https://www.youtube.com/@needle-tools)
|
|
100
|
-
|
package/package.json
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needle-tools/usd",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-next.d536d99",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"types": "./src/index.d.ts",
|
|
10
|
+
"import": "./src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./three": {
|
|
13
|
+
"types": "./src/types/create.three.d.ts",
|
|
14
|
+
"import": "./src/create.three.js"
|
|
11
15
|
},
|
|
12
16
|
"./plugins": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
17
|
+
"types": "./src/types/plugins.d.ts",
|
|
18
|
+
"import": "./src/plugins/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./vite": {
|
|
21
|
+
"types": "./src/types/vite.d.ts",
|
|
22
|
+
"import": "./src/vite/index.js"
|
|
16
23
|
}
|
|
17
24
|
},
|
|
25
|
+
"files": [
|
|
26
|
+
"src",
|
|
27
|
+
"README.md",
|
|
28
|
+
"CHANGELOG.md"
|
|
29
|
+
],
|
|
18
30
|
"keywords": [
|
|
19
31
|
"needle",
|
|
20
32
|
"usd",
|
|
@@ -23,6 +35,7 @@
|
|
|
23
35
|
"webgl"
|
|
24
36
|
],
|
|
25
37
|
"homepage": "https://needle.tools",
|
|
38
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
26
39
|
"author": {
|
|
27
40
|
"name": "Needle",
|
|
28
41
|
"email": "hi@needle.tools",
|
|
@@ -36,15 +49,34 @@
|
|
|
36
49
|
"url": "https://github.com/needle-tools/usd-viewer/issues"
|
|
37
50
|
},
|
|
38
51
|
"peerDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
52
|
+
"@needle-tools/engine": ">=5.0.0",
|
|
53
|
+
"three": ">=0.160.0"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"@needle-tools/engine": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"needle-engine-matrix:cache": "node scripts/cache-needle-engine-matrix.mjs",
|
|
62
|
+
"three-matrix:cache": "node scripts/cache-three-matrix.mjs",
|
|
63
|
+
"test:bindings": "node --test tests/bindings/*.test.mjs",
|
|
64
|
+
"test:needle-engine-matrix": "npm run needle-engine-matrix:cache && playwright test -c tests/needle-engine-matrix/playwright.config.ts",
|
|
65
|
+
"test:three-matrix": "node scripts/run-three-matrix.mjs",
|
|
66
|
+
"test:viewer-visual": "playwright test -c tests/viewer-visual/playwright.config.ts"
|
|
41
67
|
},
|
|
42
68
|
"devDependencies": {
|
|
43
|
-
"
|
|
44
|
-
"@
|
|
69
|
+
"@needle-tools/engine": "^5.1.2",
|
|
70
|
+
"@needle-tools/three-test-matrix": "^0.1.0",
|
|
71
|
+
"@playwright/test": "^1.60.0",
|
|
72
|
+
"@types/three": "^0.164.1",
|
|
73
|
+
"vite": "^8.1.0"
|
|
45
74
|
},
|
|
46
75
|
"publishConfig": {
|
|
47
76
|
"access": "public",
|
|
48
77
|
"registry": "https://registry.npmjs.org/"
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@needle-tools/materialx": "1.7.0-next.57183d6"
|
|
49
81
|
}
|
|
50
82
|
}
|