@openusd-wasm/pxr 0.0.2 → 0.0.4

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/README.md CHANGED
@@ -37,12 +37,49 @@ const pxr = await createPxr({
37
37
  ```
38
38
 
39
39
  The returned namespace exposes `Gf`, `Sdf`, `Usd`, `UsdGeom`, `UsdPhysics`,
40
- `UsdUtils`, and `FS` helpers for the virtual filesystem.
40
+ `UsdShade`, `UsdUtils`, and `FS` helpers for the virtual filesystem.
41
41
 
42
- ## Unsupported APIs
42
+ ## API shape
43
43
 
44
- The facade intentionally exposes a small JavaScript-friendly subset of `pxr`.
45
- The following areas are not wrapped yet.
44
+ The facade is an OpenUSD `pxr` binding, so exposed APIs keep pxr-style module,
45
+ class, and method names where possible. For example:
46
+
47
+ ```ts
48
+ const stage = pxr.Usd.Stage.CreateInMemory('scene.usda')
49
+ const path = new pxr.Sdf.Path('/World/Joint')
50
+ const prim = stage.DefinePrim(path, 'PhysicsRevoluteJoint')
51
+
52
+ const joint = new pxr.UsdPhysics.RevoluteJoint(prim)
53
+ const axisAttr = joint.GetAxisAttr()
54
+ ```
55
+
56
+ Wrapped objects own Wasm-side handles. Call `delete()` when you are done with
57
+ objects, or use the installed `using()` helper for short scopes.
58
+
59
+ ## Current binding surface
60
+
61
+ This package is actively expanding toward broader pxr coverage. The current
62
+ surface includes:
63
+
64
+ - `Gf`: vectors, matrices, quaternions, ranges, and bounding boxes used by the
65
+ existing USD bindings.
66
+ - `Sdf`: paths, asset paths, layers, prim specs, value type names, and common
67
+ layer dependency helpers.
68
+ - `Usd`: stages, prims, attributes, relationships, references, payloads, and
69
+ time codes.
70
+ - `UsdGeom`: xforms, meshes, spheres, cubes, xform ops, primvars,
71
+ `PrimvarsAPI`, stage metrics/up-axis helpers, tokens, and `BBoxCache`.
72
+ - `UsdShade`: materials, shaders, inputs, outputs, connectable APIs, material
73
+ binding, source asset helpers, shader IDs, and tokens.
74
+ - `UsdPhysics`: collision and rigid-body APIs, joint schemas, fixed/revolute/
75
+ prismatic/spherical/distance joints, limits, body relationships, local joint
76
+ frames, and `DriveAPI`.
77
+ - `UsdUtils`: external reference/dependency extraction, USDZ packaging,
78
+ localization, and asset path modification helpers.
79
+
80
+ ## Not wrapped yet
81
+
82
+ The following areas still need JS-safe wrappers or schema-driven expansion.
46
83
 
47
84
  ### Gf
48
85
 
@@ -51,12 +88,12 @@ The following areas are not wrapped yet.
51
88
 
52
89
  ### Sdf
53
90
 
54
- - PrimSpec, AttributeSpec, and RelationshipSpec mutation proxies are deferred because list/proxy lifetimes need JS-safe wrappers.
91
+ - AttributeSpec and RelationshipSpec mutation proxies are deferred because list/proxy lifetimes need JS-safe wrappers.
55
92
  - ChangeBlock, LayerOffset, Reference/Payload value classes, VariantSpec, and VariantSetSpec APIs are deferred to the next Sdf expansion.
56
93
 
57
94
  ### Usd
58
95
 
59
- - EditTarget/EditContext, StageCache, StagePopulationMask, StageLoadRules, VariantSets, Payloads, and PrimRange iterator objects are not wrapped yet.
96
+ - EditTarget/EditContext, StageCache, StagePopulationMask, StageLoadRules, VariantSets, and PrimRange iterator objects are not wrapped yet.
60
97
  - Generated Usd schema class coverage beyond concrete schema registration is deferred to schema-driven generation.
61
98
 
62
99
  ### UsdGeom
@@ -66,9 +103,20 @@ The following areas are not wrapped yet.
66
103
 
67
104
  ### UsdPhysics
68
105
 
69
- - Generated schema classes beyond CollisionAPI and RigidBodyAPI are deferred to schema-driven generation.
70
- - Joints, limits, drives, parsing utilities, and metrics helpers are deferred to the next physics expansion.
106
+ - Physics schema coverage beyond the exposed API/joint classes is deferred to
107
+ schema-driven generation.
108
+ - Parsing utilities and metrics helpers are deferred to the next physics expansion.
109
+
110
+ ### UsdShade
111
+
112
+ - NodeGraph, shader registry, shader definition parsing, and deeper
113
+ connectable-interface utilities are deferred to the next shading expansion.
114
+
115
+ ### UsdLux, UsdSkel, UsdRender, UsdVol, and related modules
116
+
117
+ - These modules are not exposed yet. They need module resources, schema type
118
+ registration, C++ wrappers, and TypeScript namespace mappings.
71
119
 
72
120
  ### UsdUtils
73
121
 
74
- - StageCache, SparseValueWriter, Stitch, StitchClips, dependency extraction, FlattenLayerStack, TimeCodeRange, localization, and compliance helpers are deferred.
122
+ - StageCache, SparseValueWriter, Stitch, StitchClips, FlattenLayerStack, TimeCodeRange, and compliance helpers are deferred.
@@ -36,7 +36,7 @@ type PxrFunction = (...args: any[]) => any;
36
36
  type PxrBindingObject = Record<string, any>;
37
37
  type PxrNamespaceValue = PxrClass | PxrFunction | PxrBindingObject;
38
38
  type PxrNamespace = Record<string, PxrNamespaceValue>;
39
- type PxrModuleName = 'Gf' | 'Sdf' | 'Usd' | 'UsdGeom' | 'UsdPhysics' | 'UsdUtils';
39
+ type PxrModuleName = 'Gf' | 'Sdf' | 'Usd' | 'UsdGeom' | 'UsdPhysics' | 'UsdShade' | 'UsdUtils';
40
40
  //#endregion
41
41
  //#region src/modules/gf.d.ts
42
42
  interface PxrGfNamespace {
@@ -81,6 +81,7 @@ interface PxrUsdNamespace {
81
81
  Attribute: PxrClass;
82
82
  Relationship: PxrClass;
83
83
  References: PxrClass;
84
+ Payloads: PxrClass;
84
85
  TimeCode: PxrClass;
85
86
  }
86
87
  //#endregion
@@ -105,11 +106,35 @@ interface PxrUsdGeomNamespace {
105
106
  interface PxrUsdPhysicsNamespace {
106
107
  CollisionAPI: PxrClass;
107
108
  RigidBodyAPI: PxrClass;
109
+ Joint: PxrClass;
110
+ FixedJoint: PxrClass;
111
+ RevoluteJoint: PxrClass;
112
+ PrismaticJoint: PxrClass;
113
+ SphericalJoint: PxrClass;
114
+ DistanceJoint: PxrClass;
115
+ DriveAPI: PxrClass;
116
+ }
117
+ //#endregion
118
+ //#region src/modules/usdShade.d.ts
119
+ interface PxrUsdShadeNamespace {
120
+ Material: PxrClass;
121
+ Shader: PxrClass;
122
+ Input: PxrClass;
123
+ Output: PxrClass;
124
+ ConnectableAPI: PxrClass;
125
+ MaterialBindingAPI: PxrClass;
126
+ Tokens: PxrBindingObject;
108
127
  }
109
128
  //#endregion
110
129
  //#region src/modules/usdUtils.d.ts
111
130
  interface PxrUsdUtilsNamespace {
131
+ ExtractExternalReferencesParams: PxrClass;
132
+ ExtractExternalReferences: PxrFunction;
133
+ ComputeAllDependencies: PxrFunction;
112
134
  CreateNewUsdzPackage: PxrFunction;
135
+ CreateNewARKitUsdzPackage: PxrFunction;
136
+ LocalizeAsset: PxrFunction;
137
+ ModifyAssetPaths: PxrFunction;
113
138
  }
114
139
  //#endregion
115
140
  //#region src/modules/index.d.ts
@@ -119,6 +144,7 @@ interface PxrModuleMap {
119
144
  Usd: PxrUsdNamespace;
120
145
  UsdGeom: PxrUsdGeomNamespace;
121
146
  UsdPhysics: PxrUsdPhysicsNamespace;
147
+ UsdShade: PxrUsdShadeNamespace;
122
148
  UsdUtils: PxrUsdUtilsNamespace;
123
149
  }
124
150
  //#endregion
@@ -105,6 +105,7 @@ function buildUsdNamespace(module) {
105
105
  Attribute: bindClass(module, "Usd", "Attribute"),
106
106
  Relationship: bindClass(module, "Usd", "Relationship"),
107
107
  References: bindClass(module, "Usd", "References"),
108
+ Payloads: bindClass(module, "Usd", "Payloads"),
108
109
  TimeCode: bindClass(module, "Usd", "TimeCode")
109
110
  };
110
111
  }
@@ -132,13 +133,41 @@ function buildUsdGeomNamespace(module) {
132
133
  function buildUsdPhysicsNamespace(module) {
133
134
  return {
134
135
  CollisionAPI: bindClass(module, "UsdPhysics", "CollisionAPI"),
135
- RigidBodyAPI: bindClass(module, "UsdPhysics", "RigidBodyAPI")
136
+ RigidBodyAPI: bindClass(module, "UsdPhysics", "RigidBodyAPI"),
137
+ Joint: bindClass(module, "UsdPhysics", "Joint"),
138
+ FixedJoint: bindClass(module, "UsdPhysics", "FixedJoint"),
139
+ RevoluteJoint: bindClass(module, "UsdPhysics", "RevoluteJoint"),
140
+ PrismaticJoint: bindClass(module, "UsdPhysics", "PrismaticJoint"),
141
+ SphericalJoint: bindClass(module, "UsdPhysics", "SphericalJoint"),
142
+ DistanceJoint: bindClass(module, "UsdPhysics", "DistanceJoint"),
143
+ DriveAPI: bindClass(module, "UsdPhysics", "DriveAPI")
144
+ };
145
+ }
146
+ //#endregion
147
+ //#region src/modules/usdShade.ts
148
+ function buildUsdShadeNamespace(module) {
149
+ return {
150
+ Material: bindClass(module, "UsdShade", "Material"),
151
+ Shader: bindClass(module, "UsdShade", "Shader"),
152
+ Input: bindClass(module, "UsdShade", "Input"),
153
+ Output: bindClass(module, "UsdShade", "Output"),
154
+ ConnectableAPI: bindClass(module, "UsdShade", "ConnectableAPI"),
155
+ MaterialBindingAPI: bindClass(module, "UsdShade", "MaterialBindingAPI"),
156
+ Tokens: bindObject(module, "UsdShade", "Tokens")
136
157
  };
137
158
  }
138
159
  //#endregion
139
160
  //#region src/modules/usdUtils.ts
140
161
  function buildUsdUtilsNamespace(module) {
141
- return { CreateNewUsdzPackage: bindFunction(module, "UsdUtils", "CreateNewUsdzPackage") };
162
+ return {
163
+ ExtractExternalReferencesParams: bindClass(module, "UsdUtils", "ExtractExternalReferencesParams"),
164
+ ExtractExternalReferences: bindFunction(module, "UsdUtils", "ExtractExternalReferences"),
165
+ ComputeAllDependencies: bindFunction(module, "UsdUtils", "ComputeAllDependencies"),
166
+ CreateNewUsdzPackage: bindFunction(module, "UsdUtils", "CreateNewUsdzPackage"),
167
+ CreateNewARKitUsdzPackage: bindFunction(module, "UsdUtils", "CreateNewARKitUsdzPackage"),
168
+ LocalizeAsset: bindFunction(module, "UsdUtils", "LocalizeAsset"),
169
+ ModifyAssetPaths: bindFunction(module, "UsdUtils", "ModifyAssetPaths")
170
+ };
142
171
  }
143
172
  //#endregion
144
173
  //#region src/modules/index.ts
@@ -149,6 +178,7 @@ function buildPxrModules(module) {
149
178
  Usd: buildUsdNamespace(module),
150
179
  UsdGeom: buildUsdGeomNamespace(module),
151
180
  UsdPhysics: buildUsdPhysicsNamespace(module),
181
+ UsdShade: buildUsdShadeNamespace(module),
152
182
  UsdUtils: buildUsdUtilsNamespace(module)
153
183
  };
154
184
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openusd-wasm/pxr",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.4",
5
5
  "description": "Community TypeScript facade for OpenUSD pxr WebAssembly bindings.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/openusd-wasm/openusd-pxr-wasm",