@openusd-wasm/three-loader 0.0.3 → 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/dist/openusd_three_loader.js +10 -9
- package/package.json +3 -3
|
@@ -206,17 +206,18 @@ function materialBinding(pxr, prim) {
|
|
|
206
206
|
const binding = new pxr.UsdShade.MaterialBindingAPI(prim);
|
|
207
207
|
try {
|
|
208
208
|
if (!isValid$1(binding)) return null;
|
|
209
|
-
const computed = binding.ComputeBoundMaterial(
|
|
209
|
+
const computed = binding.ComputeBoundMaterial();
|
|
210
210
|
if (!Array.isArray(computed)) return null;
|
|
211
211
|
const [material, bindingRel] = computed;
|
|
212
212
|
try {
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
213
|
+
if (isValid$1(bindingRel)) {
|
|
214
|
+
const resolvedPath = pxr.UsdShade.MaterialBindingAPI.GetResolvedTargetPathFromBindingRel(bindingRel);
|
|
215
|
+
try {
|
|
216
|
+
const path = pathToString(resolvedPath);
|
|
217
|
+
if (path) return path;
|
|
218
|
+
} finally {
|
|
219
|
+
dispose$1(resolvedPath);
|
|
220
|
+
}
|
|
220
221
|
}
|
|
221
222
|
if (!material || !isValid$1(material)) return null;
|
|
222
223
|
const materialPrim = material.GetPrim();
|
|
@@ -919,7 +920,7 @@ function shaderPathFromConnection(value) {
|
|
|
919
920
|
function findTexture(material, options, connectionSuffixes, fallbackToAnyTexture = false) {
|
|
920
921
|
if (!material) return null;
|
|
921
922
|
const connectedPath = shaderPathFromConnection(firstInput(material, connectionSuffixes));
|
|
922
|
-
const textureShader = material.shaders.find((shader) => shader.id === "UsdUVTexture" &&
|
|
923
|
+
const textureShader = connectedPath ? material.shaders.find((shader) => shader.id === "UsdUVTexture" && shader.path === connectedPath) : fallbackToAnyTexture ? material.shaders.find((shader) => shader.id === "UsdUVTexture") : null;
|
|
923
924
|
if (!textureShader) return null;
|
|
924
925
|
const url = publicUrlFromAsset(textureShader.inputs["inputs:file"], options, material, textureShader);
|
|
925
926
|
if (!url) return null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openusd-wasm/three-loader",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "Three.js loader for OpenUSD assets backed by @openusd-wasm/pxr.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/openusd-wasm/openusd-pxr-wasm",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"three": ">=0.160 <1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@openusd-wasm/pxr": "0.0.
|
|
32
|
-
"@openusd-wasm/utils": "0.0.
|
|
31
|
+
"@openusd-wasm/pxr": "0.0.4",
|
|
32
|
+
"@openusd-wasm/utils": "0.0.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/node": "^25.6.2",
|