@nebula-spatial/viewer 0.5.13 → 0.5.14
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 +26 -0
- package/README.md +32 -34
- package/dist/assets/types.d.ts +10 -1
- package/dist/{collision-debug-Aey5D_9r.js → collision-debug-B2bN8P2g.js} +1 -1
- package/dist/{index-DbJbq4N_.js → index-BSDalKkd.js} +846 -832
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{mjcf-visual-B3UBh_gG.js → mjcf-visual-D6T3a1uQ.js} +1 -1
- package/dist/{mujoco-runtime-BPCq2bmg.js → mujoco-runtime-CFQQsRmc.js} +1 -1
- package/dist/runtime-paths-Dj0itY6G.js +8 -0
- package/dist/{session-C0KFNp50.js → session-BUarD9PA.js} +132 -129
- package/dist/{session-52jx0mHi.js → session-Ciaw522_.js} +7 -7
- package/dist/simulation/usd-preload.d.ts +2 -0
- package/dist/simulation/usd-prewarm.d.ts +6 -0
- package/dist/{stage-PhbBBoMY.js → stage-CvP0yaff.js} +1 -1
- package/dist/{urdf-session-DPOKRNNw.js → urdf-session-DcGOHFg2.js} +5 -5
- package/dist/{usd-session-Co9oFkxC.js → usd-session-DSFtJk4b.js} +193 -195
- package/dist/version.d.ts +1 -1
- package/dist/{xacro-B50iFe4M.js → xacro-bURYAikr.js} +1 -1
- package/draco/draco_decoder.wasm +0 -0
- package/draco/draco_wasm_wrapper.js +117 -0
- package/package.json +28 -4
- package/runtime-assets.d.mts +9 -0
- package/runtime-assets.mjs +11 -0
- package/vite.d.mts +7 -0
- package/vite.mjs +115 -0
|
@@ -2,14 +2,15 @@ var Ii = Object.defineProperty;
|
|
|
2
2
|
var Ui = (e, t, n) => t in e ? Ii(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Zt = (e, t, n) => Ui(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { Mesh as Ce, MeshPhysicalMaterial as ne, FrontSide as Us, DoubleSide as kt, Box3 as Lt, Vector3 as J, DataTexture as Gs, UnsignedByteType as Hs, RGBAFormat as Ys, NoColorSpace as Re, Color as me, Float32BufferAttribute as Mi, TextureLoader as kn, Texture as Vt, Ray as Ms, BufferAttribute as Jo, Matrix4 as ft, Matrix3 as Zo, ShaderChunk as Ti, SRGBColorSpace as ns, RepeatWrapping as Me, MeshStandardMaterial as Ts, ClampToEdgeWrapping as on, MirroredRepeatWrapping as Ai, CanvasTexture as Oi, Group as sn, Quaternion as Ye, SkinnedMesh as mn, Skeleton as Ni, AnimationMixer as Ri, LoopRepeat as Pi, Sphere as Ci } from "three";
|
|
5
|
-
import { r as xi, o as Di, i as Ei, c as $i, a as Qo, b as ki, d as Li, e as Bi, U as Fi, f as Vi, g as er, h as tr, j as As, k as Nt, l as zi, m as ji, n as Wi, p as nr, q as sr, s as Gi } from "./index-
|
|
6
|
-
import { r as or, M as Os, n as wt, u as Hi, c as Ks, a as Xs, b as rr, d as Yi, p as Ki, S as qs, e as Xi, C as Js, f as qi } from "./collision-debug-
|
|
5
|
+
import { r as xi, o as Di, i as Ei, c as $i, a as Qo, b as ki, d as Li, e as Bi, U as Fi, f as Vi, g as er, h as tr, j as As, k as Nt, l as zi, m as ji, n as Wi, p as nr, q as sr, s as Gi } from "./index-BSDalKkd.js";
|
|
6
|
+
import { r as or, M as Os, n as wt, u as Hi, c as Ks, a as Xs, b as rr, d as Yi, p as Ki, S as qs, e as Xi, C as Js, f as qi } from "./collision-debug-B2bN8P2g.js";
|
|
7
7
|
import { ConvexGeometry as Ji } from "three/examples/jsm/geometries/ConvexGeometry.js";
|
|
8
8
|
import { buildUSDScene as Zi, createUSDLoadedModel as Qi } from "@openusd-wasm/three-loader";
|
|
9
9
|
import { disposeModelResources as ir } from "./resources-CHhCm2f7.js";
|
|
10
10
|
import { KTX2Loader as ea } from "three/addons/loaders/KTX2Loader.js";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import { r as ta } from "./runtime-paths-Dj0itY6G.js";
|
|
12
|
+
const na = /* @__PURE__ */ new Set(["default", "render"]);
|
|
13
|
+
function sa(e) {
|
|
13
14
|
const t = new Map(e.data.view.prims.map((n) => [
|
|
14
15
|
n.path,
|
|
15
16
|
xi(n)
|
|
@@ -21,7 +22,7 @@ function na(e) {
|
|
|
21
22
|
for (; s && !o; )
|
|
22
23
|
o = (i = s.userData.usd) == null ? void 0 : i.path, s = s.parent;
|
|
23
24
|
if (!o) return;
|
|
24
|
-
const r = !
|
|
25
|
+
const r = !na.has(t.get(o) ?? "default");
|
|
25
26
|
n.userData.usdPurposeExcluded = r, r ? ((a = n.userData).usdPurposeLayerMask ?? (a.usdPurposeLayerMask = n.layers.mask), n.layers.disableAll()) : n.userData.usdPurposeLayerMask !== void 0 && (n.layers.mask = n.userData.usdPurposeLayerMask, delete n.userData.usdPurposeLayerMask);
|
|
26
27
|
});
|
|
27
28
|
}
|
|
@@ -59,25 +60,25 @@ function Ns(e, t, n) {
|
|
|
59
60
|
for (const { asset: o, values: r } of s) Object.assign(o, r);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
+
const oa = 67324752, ra = 33639248, ia = 101010256, Hn = 4294967295, aa = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "webp"]);
|
|
63
64
|
function lr(e) {
|
|
64
65
|
return e.length > 3 && e[0] === 80 && e[1] === 75;
|
|
65
66
|
}
|
|
66
67
|
async function pr(e, t = {}) {
|
|
67
|
-
const n = new DataView(e.buffer, e.byteOffset, e.byteLength), s =
|
|
68
|
+
const n = new DataView(e.buffer, e.byteOffset, e.byteLength), s = da(n);
|
|
68
69
|
if (s < 0) throw new Error("Not a zip package: end of central directory not found.");
|
|
69
70
|
const o = n.getUint16(s + 10, !0);
|
|
70
71
|
let r = n.getUint32(s + 16, !0);
|
|
71
72
|
if (o === 65535 || r === Hn) throw new Error("ZIP64 usdz packages are not supported.");
|
|
72
73
|
const i = /* @__PURE__ */ new Map(), a = [];
|
|
73
74
|
for (let c = 0; c < o; c += 1) {
|
|
74
|
-
if (r + 46 > n.byteLength || n.getUint32(r, !0) !==
|
|
75
|
+
if (r + 46 > n.byteLength || n.getUint32(r, !0) !== ra)
|
|
75
76
|
throw new Error(`Corrupt zip central directory at entry ${c}.`);
|
|
76
77
|
const u = n.getUint16(r + 10, !0), l = n.getUint32(r + 20, !0), f = n.getUint16(r + 28, !0), _ = n.getUint16(r + 30, !0), h = n.getUint16(r + 32, !0), b = n.getUint32(r + 42, !0);
|
|
77
78
|
if (l === Hn || b === Hn)
|
|
78
79
|
throw new Error("ZIP64 usdz packages are not supported.");
|
|
79
80
|
const y = new TextDecoder().decode(e.subarray(r + 46, r + 46 + f));
|
|
80
|
-
r += 46 + f + _ + h, !y.endsWith("/") && (t.include && !t.include(y) || a.push(
|
|
81
|
+
r += 46 + f + _ + h, !y.endsWith("/") && (t.include && !t.include(y) || a.push(ua(e, n, b, l, u).then((w) => ({ name: y, data: w }))));
|
|
81
82
|
}
|
|
82
83
|
for (const { name: c, data: u } of await Promise.all(a)) i.set(c, u);
|
|
83
84
|
return i;
|
|
@@ -95,12 +96,12 @@ function fr(e) {
|
|
|
95
96
|
let a = s.get(i);
|
|
96
97
|
if (!a) {
|
|
97
98
|
const c = t.get(i);
|
|
98
|
-
a = URL.createObjectURL(new Blob([new Uint8Array(c)], { type:
|
|
99
|
+
a = URL.createObjectURL(new Blob([new Uint8Array(c)], { type: fa(i) })), s.set(i, a);
|
|
99
100
|
}
|
|
100
101
|
return a;
|
|
101
102
|
}, r = (i) => {
|
|
102
103
|
if (!i) return null;
|
|
103
|
-
const a = la(
|
|
104
|
+
const a = pa(la(i));
|
|
104
105
|
if (!a) return null;
|
|
105
106
|
if (t.has(a)) return o(a);
|
|
106
107
|
const c = [...t.keys()].filter((f) => f.endsWith(`/${a}`));
|
|
@@ -120,27 +121,27 @@ function fr(e) {
|
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
|
-
async function
|
|
124
|
+
async function ca(e) {
|
|
124
125
|
return lr(e) ? fr(await pr(e, {
|
|
125
126
|
include: Ln
|
|
126
127
|
})) : null;
|
|
127
128
|
}
|
|
128
129
|
function Ln(e) {
|
|
129
|
-
return
|
|
130
|
+
return aa.has(dr(e));
|
|
130
131
|
}
|
|
131
|
-
async function
|
|
132
|
-
if (t.getUint32(n, !0) !==
|
|
132
|
+
async function ua(e, t, n, s, o) {
|
|
133
|
+
if (t.getUint32(n, !0) !== oa) throw new Error("Corrupt zip local file header.");
|
|
133
134
|
const r = t.getUint16(n + 26, !0), i = t.getUint16(n + 28, !0), a = n + 30 + r + i, c = e.subarray(a, a + s);
|
|
134
135
|
if (o === 0) return c.slice();
|
|
135
136
|
if (o !== 8) throw new Error(`Unsupported zip compression method ${o}.`);
|
|
136
137
|
const u = new Blob([new Uint8Array(c)]).stream().pipeThrough(new DecompressionStream("deflate-raw"));
|
|
137
138
|
return new Uint8Array(await new Response(u).arrayBuffer());
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function la(e) {
|
|
140
141
|
const t = e.indexOf("[");
|
|
141
142
|
return t >= 0 && e.endsWith("]") ? e.slice(t + 1, -1) : e;
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function pa(e) {
|
|
144
145
|
const t = [];
|
|
145
146
|
for (const n of e.replaceAll("\\", "/").split("/"))
|
|
146
147
|
!n || n === "." || (n === ".." ? t.pop() : t.push(n));
|
|
@@ -150,7 +151,7 @@ function dr(e) {
|
|
|
150
151
|
const t = e.split(/[?#]/)[0] ?? e, n = t.lastIndexOf(".");
|
|
151
152
|
return n < 0 ? "" : t.slice(n + 1).toLowerCase();
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
+
function fa(e) {
|
|
154
155
|
switch (dr(e)) {
|
|
155
156
|
case "png":
|
|
156
157
|
return "image/png";
|
|
@@ -163,19 +164,19 @@ function pa(e) {
|
|
|
163
164
|
return "application/octet-stream";
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function da(e) {
|
|
167
168
|
const t = Math.max(0, e.byteLength - 65535 - 22);
|
|
168
169
|
for (let n = e.byteLength - 22; n >= t; n -= 1)
|
|
169
|
-
if (e.getUint32(n, !0) ===
|
|
170
|
+
if (e.getUint32(n, !0) === ia) return n;
|
|
170
171
|
return -1;
|
|
171
172
|
}
|
|
172
|
-
const
|
|
173
|
-
function
|
|
173
|
+
const ma = /^physics$/i, ha = /^(newton|mjc|mujoco)(?:[_-]|$)/i, _a = /^(physx|newton|mjc|mujoco)(?:[_-]|)/i;
|
|
174
|
+
function ga(e, t = []) {
|
|
174
175
|
const n = new Set(t.map(Qs)), s = [];
|
|
175
176
|
for (const o of e) {
|
|
176
|
-
if (!
|
|
177
|
-
const r = o.variantNames.map((c, u) => ({ selection: c, index: u, rank:
|
|
178
|
-
if (r.length === 0 || o.selection &&
|
|
177
|
+
if (!ma.test(o.setName) || n.has(Qs(o))) continue;
|
|
178
|
+
const r = o.variantNames.map((c, u) => ({ selection: c, index: u, rank: ya(c) })).filter((c) => c.rank !== null);
|
|
179
|
+
if (r.length === 0 || o.selection && ha.test(o.selection)) continue;
|
|
179
180
|
const i = Yn(o.selection), a = [...r].sort((c, u) => {
|
|
180
181
|
const l = i !== null && Yn(c.selection) === i, f = i !== null && Yn(u.selection) === i;
|
|
181
182
|
return Number(f) - Number(l) || c.rank - u.rank || c.index - u.index;
|
|
@@ -188,16 +189,16 @@ function _a(e, t = []) {
|
|
|
188
189
|
}
|
|
189
190
|
return s;
|
|
190
191
|
}
|
|
191
|
-
function
|
|
192
|
+
function ya(e) {
|
|
192
193
|
return /^newton(?:[_-]|$)/i.test(e) ? 0 : /^mjc(?:[_-]|$)/i.test(e) ? 1 : /^mujoco(?:[_-]|$)/i.test(e) ? 2 : null;
|
|
193
194
|
}
|
|
194
195
|
function Yn(e) {
|
|
195
|
-
return e && e.replace(
|
|
196
|
+
return e && e.replace(_a, "").toLowerCase() || null;
|
|
196
197
|
}
|
|
197
198
|
function Qs(e) {
|
|
198
199
|
return `${e.primPath}\0${e.setName}`;
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
+
function ba(e) {
|
|
201
202
|
let t = 0;
|
|
202
203
|
const n = () => {
|
|
203
204
|
for (; t < e.length; ) {
|
|
@@ -297,8 +298,8 @@ function ya(e) {
|
|
|
297
298
|
}
|
|
298
299
|
return new Map([...r].filter(([, c]) => c.schemas.length || c.relationships.size));
|
|
299
300
|
}
|
|
300
|
-
const
|
|
301
|
-
async function
|
|
301
|
+
const wa = /* @__PURE__ */ new Set(["usd", "usda", "usdc", "usdz"]);
|
|
302
|
+
async function va(e) {
|
|
302
303
|
const t = await import(
|
|
303
304
|
/* @vite-ignore */
|
|
304
305
|
e.moduleUrl
|
|
@@ -307,7 +308,7 @@ async function wa(e) {
|
|
|
307
308
|
return ki(e.wasmModule, w, d);
|
|
308
309
|
}
|
|
309
310
|
} : {
|
|
310
|
-
wasmBinary: await (typeof e.wasmBinary == "function" ? e.wasmBinary() : e.wasmBinary ??
|
|
311
|
+
wasmBinary: await (typeof e.wasmBinary == "function" ? e.wasmBinary() : e.wasmBinary ?? Ra(e.wasmUrl))
|
|
311
312
|
}, o = await n(s), r = e.apiVersion ?? Di.apiVersion, i = Number(o.ccall("usd_probe_api_version", "number", [], []));
|
|
312
313
|
if (i !== r)
|
|
313
314
|
throw Object.assign(
|
|
@@ -341,7 +342,7 @@ async function wa(e) {
|
|
|
341
342
|
})(), h);
|
|
342
343
|
}
|
|
343
344
|
async function y(w, d) {
|
|
344
|
-
const m = new URL(d.sourcePath, "file:///"), p = `${a}/load-${++_}`, g = Ht(m.href, p), v = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), I = d.readTextureBytes ?? !0, U = d.collectTextureUrls ?? !I, D = U || I ? mr :
|
|
345
|
+
const m = new URL(d.sourcePath, "file:///"), p = `${a}/load-${++_}`, g = Ht(m.href, p), v = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map(), I = d.readTextureBytes ?? !0, U = d.collectTextureUrls ?? !I, D = U || I ? mr : Oa, A = /* @__PURE__ */ new Map();
|
|
345
346
|
let k, P = null, T = null;
|
|
346
347
|
const B = () => {
|
|
347
348
|
k !== void 0 && l.delete(k) && u("usd_probe_stage_release", ["number"], [k]), P == null || P.dispose(), gr(o.FS, p);
|
|
@@ -360,7 +361,7 @@ async function wa(e) {
|
|
|
360
361
|
let N = {};
|
|
361
362
|
if (!R && d.autoResolveAssets !== !1) {
|
|
362
363
|
const $ = d.resolveBytes ?? ((E) => c(E));
|
|
363
|
-
N = await
|
|
364
|
+
N = await Ma(
|
|
364
365
|
o,
|
|
365
366
|
m,
|
|
366
367
|
p,
|
|
@@ -403,7 +404,7 @@ async function wa(e) {
|
|
|
403
404
|
throw new Error(String($.error ?? "Failed to enumerate USD variants."));
|
|
404
405
|
x = $.variants ?? [], F = [
|
|
405
406
|
...le,
|
|
406
|
-
...
|
|
407
|
+
...ga(x, le)
|
|
407
408
|
];
|
|
408
409
|
}
|
|
409
410
|
for (const $ of F) {
|
|
@@ -434,7 +435,7 @@ async function wa(e) {
|
|
|
434
435
|
}
|
|
435
436
|
E.size > 0 && (F = F.filter((X) => !E.has(Kn(X))));
|
|
436
437
|
}
|
|
437
|
-
const fe = await
|
|
438
|
+
const fe = await Sa(o, ee.stageId, g, {
|
|
438
439
|
batchSize: d.geometryBatchSize,
|
|
439
440
|
onProgress: d.onGeometryProgress
|
|
440
441
|
});
|
|
@@ -541,7 +542,7 @@ function eo(e, t = /* @__PURE__ */ new Map(), n) {
|
|
|
541
542
|
if (n && typeof p == "function") {
|
|
542
543
|
const g = e.ccall("usd_probe_flatten_stage", "string", ["string"], [n]);
|
|
543
544
|
if (typeof g != "string" || !g.startsWith("#usda")) throw new Error("Unable to read flattened USD joint metadata");
|
|
544
|
-
r =
|
|
545
|
+
r = ba(g);
|
|
545
546
|
} else
|
|
546
547
|
r = /* @__PURE__ */ new Map();
|
|
547
548
|
}
|
|
@@ -672,7 +673,7 @@ function eo(e, t = /* @__PURE__ */ new Map(), n) {
|
|
|
672
673
|
openStage: l
|
|
673
674
|
};
|
|
674
675
|
}
|
|
675
|
-
async function
|
|
676
|
+
async function Sa(e, t, n, s = {}) {
|
|
676
677
|
var a;
|
|
677
678
|
if (typeof e._usd_probe_scene_visual != "function" || typeof e._usd_probe_scene_geometry != "function" || typeof e._usd_probe_scene_geometry_end != "function")
|
|
678
679
|
throw Object.assign(
|
|
@@ -700,23 +701,23 @@ async function va(e, t, n, s = {}) {
|
|
|
700
701
|
));
|
|
701
702
|
if (!_.ok) throw new Error(_.error ?? `Failed to stream USD geometry for ${u.path}`);
|
|
702
703
|
u.geometry = Object.fromEntries(
|
|
703
|
-
Object.entries(_.geometry ?? {}).map(([h, b]) => [h,
|
|
704
|
-
), (a = s.onProgress) == null || a.call(s, c + 1, r.elements.length, u.path), (c + 1) % i === 0 && await
|
|
704
|
+
Object.entries(_.geometry ?? {}).map(([h, b]) => [h, Ua(e, b)])
|
|
705
|
+
), (a = s.onProgress) == null || a.call(s, c + 1, r.elements.length, u.path), (c + 1) % i === 0 && await Ia();
|
|
705
706
|
}
|
|
706
707
|
} finally {
|
|
707
708
|
e.ccall("usd_probe_scene_geometry_end", "string", ["number"], [t]);
|
|
708
709
|
}
|
|
709
710
|
return r;
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function Ia() {
|
|
712
713
|
return new Promise((e) => setTimeout(e, 0));
|
|
713
714
|
}
|
|
714
|
-
function
|
|
715
|
+
function Ua(e, t) {
|
|
715
716
|
if (!t || typeof t != "object") return t ?? null;
|
|
716
717
|
const { ptr: n, length: s, kind: o } = t;
|
|
717
718
|
return typeof n != "number" ? t : s ? (o === "i32" ? new Int32Array(e.HEAP32.buffer, n, s) : new Float32Array(e.HEAPF32.buffer, n, s)).slice() : o === "i32" ? new Int32Array() : new Float32Array();
|
|
718
719
|
}
|
|
719
|
-
async function
|
|
720
|
+
async function Ma(e, t, n, s, o, r, i, a, c, u, l, f, _, h, b, y, w) {
|
|
720
721
|
const d = {}, m = [...h];
|
|
721
722
|
let p = [
|
|
722
723
|
{ url: t, depth: 0, recurse: !0, absolute: !1 }
|
|
@@ -734,7 +735,7 @@ async function Ua(e, t, n, s, o, r, i, a, c, u, l, f, _, h, b, y, w) {
|
|
|
734
735
|
g.add(D), O.push({ item: U, identifier: D });
|
|
735
736
|
}
|
|
736
737
|
}
|
|
737
|
-
p = (await
|
|
738
|
+
p = (await Ta(
|
|
738
739
|
O,
|
|
739
740
|
Math.max(1, f),
|
|
740
741
|
async ({ item: U, identifier: D }) => {
|
|
@@ -761,7 +762,7 @@ async function Ua(e, t, n, s, o, r, i, a, c, u, l, f, _, h, b, y, w) {
|
|
|
761
762
|
} catch {
|
|
762
763
|
continue;
|
|
763
764
|
}
|
|
764
|
-
const Y = /^(?:[a-z][a-z\d+.-]*:|\/)/i.test(T), M = Ht(B.href, n), se = or(M, m), R = (se == null ? void 0 : se.paths.length) === 1 ? se.paths[0] : null, N = R ?? M, C = U.absolute || Y, Q = C ? B.href : to(B.href, t), ee =
|
|
765
|
+
const Y = /^(?:[a-z][a-z\d+.-]*:|\/)/i.test(T), M = Ht(B.href, n), se = or(M, m), R = (se == null ? void 0 : se.paths.length) === 1 ? se.paths[0] : null, N = R ?? M, C = U.absolute || Y, Q = C ? B.href : to(B.href, t), ee = Aa(B.pathname);
|
|
765
766
|
if (R && i.set(R, Q), _ === "package" && se && se.paths.length > 1) {
|
|
766
767
|
const le = `${n}/__deferred_udim__/${encodeURIComponent(Q)}`;
|
|
767
768
|
d[A][T] = le, i.set(le, Q);
|
|
@@ -790,7 +791,7 @@ async function Ua(e, t, n, s, o, r, i, a, c, u, l, f, _, h, b, y, w) {
|
|
|
790
791
|
}
|
|
791
792
|
return d;
|
|
792
793
|
}
|
|
793
|
-
async function
|
|
794
|
+
async function Ta(e, t, n) {
|
|
794
795
|
const s = new Array(e.length);
|
|
795
796
|
let o = 0;
|
|
796
797
|
const r = Array.from({ length: Math.min(t, e.length) }, async () => {
|
|
@@ -801,16 +802,16 @@ async function Ma(e, t, n) {
|
|
|
801
802
|
});
|
|
802
803
|
return await Promise.all(r), s;
|
|
803
804
|
}
|
|
804
|
-
function
|
|
805
|
+
function Aa(e) {
|
|
805
806
|
var n, s;
|
|
806
807
|
const t = (s = (n = e.split(/[?#]/, 1)[0]) == null ? void 0 : n.split(".").pop()) == null ? void 0 : s.toLowerCase();
|
|
807
|
-
return t != null &&
|
|
808
|
+
return t != null && wa.has(t);
|
|
808
809
|
}
|
|
809
810
|
function mr(e) {
|
|
810
811
|
return hr(e) ? e.includes(64) : !0;
|
|
811
812
|
}
|
|
812
|
-
function
|
|
813
|
-
return hr(e) ?
|
|
813
|
+
function Oa(e) {
|
|
814
|
+
return hr(e) ? Na(e, [
|
|
814
815
|
"subLayers",
|
|
815
816
|
"references",
|
|
816
817
|
"payload",
|
|
@@ -823,7 +824,7 @@ function hr(e) {
|
|
|
823
824
|
for (; t < e.length && t < 64 && /\s/.test(String.fromCharCode(e[t])); ) t += 1;
|
|
824
825
|
return e[t] === 35 && e[t + 1] === 117 && e[t + 2] === 115 && e[t + 3] === 100 && e[t + 4] === 97;
|
|
825
826
|
}
|
|
826
|
-
function
|
|
827
|
+
function Na(e, t) {
|
|
827
828
|
const n = /* @__PURE__ */ new Map();
|
|
828
829
|
let s = 1;
|
|
829
830
|
for (const r of t) {
|
|
@@ -895,12 +896,12 @@ function Kn(e) {
|
|
|
895
896
|
async function no(e) {
|
|
896
897
|
return typeof e == "string" ? new TextEncoder().encode(e) : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : e instanceof ArrayBuffer ? new Uint8Array(e) : new Uint8Array(await e.arrayBuffer());
|
|
897
898
|
}
|
|
898
|
-
async function
|
|
899
|
+
async function Ra(e) {
|
|
899
900
|
if (!e) throw new Error("createSingleThreadUsd needs wasmUrl or wasmBinary.");
|
|
900
901
|
return (await fetch(e)).arrayBuffer();
|
|
901
902
|
}
|
|
902
|
-
function
|
|
903
|
-
if (!
|
|
903
|
+
function Pa(e) {
|
|
904
|
+
if (!Ca(e)) return;
|
|
904
905
|
const t = new Map(e.data.elements.map((s) => [s.path, s])), n = /* @__PURE__ */ new Map();
|
|
905
906
|
e.scene.traverse((s) => {
|
|
906
907
|
var i;
|
|
@@ -909,9 +910,9 @@ function Ra(e) {
|
|
|
909
910
|
if (typeof o != "string" || n.has(o)) return;
|
|
910
911
|
const r = t.get(o);
|
|
911
912
|
r && n.set(o, tr(r) ? !!r.doubleSided : void 0);
|
|
912
|
-
}),
|
|
913
|
+
}), xa(e, n);
|
|
913
914
|
}
|
|
914
|
-
function
|
|
915
|
+
function Ca(e) {
|
|
915
916
|
let t = !1;
|
|
916
917
|
return e.scene.traverse((n) => {
|
|
917
918
|
if (!(t || !(n instanceof Ce))) {
|
|
@@ -923,7 +924,7 @@ function Pa(e) {
|
|
|
923
924
|
}
|
|
924
925
|
}), t;
|
|
925
926
|
}
|
|
926
|
-
function
|
|
927
|
+
function xa(e, t) {
|
|
927
928
|
const n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
928
929
|
e.scene.traverse((o) => {
|
|
929
930
|
var u;
|
|
@@ -949,8 +950,8 @@ function Ca(e, t) {
|
|
|
949
950
|
});
|
|
950
951
|
for (const o of s) o.dispose();
|
|
951
952
|
}
|
|
952
|
-
const
|
|
953
|
-
function
|
|
953
|
+
const Da = 0.85, so = -0.5, Ea = 4;
|
|
954
|
+
function $a(e) {
|
|
954
955
|
const t = new Map(e.data.elements.map((o) => [o.path, o])), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
955
956
|
e.scene.traverse((o) => {
|
|
956
957
|
var l;
|
|
@@ -959,7 +960,7 @@ function Ea(e) {
|
|
|
959
960
|
if (typeof r != "string") return;
|
|
960
961
|
const i = t.get(r);
|
|
961
962
|
if (!i || tr(i)) return;
|
|
962
|
-
const a = Array.isArray(o.material) ? o.material : [o.material], c =
|
|
963
|
+
const a = Array.isArray(o.material) ? o.material : [o.material], c = ka(o, a);
|
|
963
964
|
if (c.size === 0) return;
|
|
964
965
|
const u = (f, _) => {
|
|
965
966
|
if (!c.has(_) || f.side !== Us) return f;
|
|
@@ -980,10 +981,10 @@ function Ea(e) {
|
|
|
980
981
|
});
|
|
981
982
|
for (const o of s) o.dispose();
|
|
982
983
|
}
|
|
983
|
-
function
|
|
984
|
+
function ka(e, t) {
|
|
984
985
|
const n = /* @__PURE__ */ new Set();
|
|
985
986
|
if (!t.some(oo)) return n;
|
|
986
|
-
const s = e.geometry.groups.length > 0 ? e.geometry.groups : [{ start: 0, count:
|
|
987
|
+
const s = e.geometry.groups.length > 0 ? e.geometry.groups : [{ start: 0, count: La(e.geometry), materialIndex: 0 }], o = e.geometry.getAttribute("position"), r = new Lt();
|
|
987
988
|
for (let a = 0; a < o.count; a++)
|
|
988
989
|
r.expandByPoint(new J(
|
|
989
990
|
o.getX(a),
|
|
@@ -993,11 +994,11 @@ function $a(e, t) {
|
|
|
993
994
|
const i = r.getCenter(new J());
|
|
994
995
|
for (const a of s) {
|
|
995
996
|
const c = a.materialIndex ?? 0, u = t[c];
|
|
996
|
-
!u || !oo(u) || n.has(c) ||
|
|
997
|
+
!u || !oo(u) || n.has(c) || Ba(e.geometry, i, a.start, a.count) && n.add(c);
|
|
997
998
|
}
|
|
998
999
|
return n;
|
|
999
1000
|
}
|
|
1000
|
-
function
|
|
1001
|
+
function La(e) {
|
|
1001
1002
|
var t;
|
|
1002
1003
|
return ((t = e.getIndex()) == null ? void 0 : t.count) ?? e.getAttribute("position").count;
|
|
1003
1004
|
}
|
|
@@ -1005,7 +1006,7 @@ function oo(e) {
|
|
|
1005
1006
|
const t = e;
|
|
1006
1007
|
return !!t.map && !e.transparent && !(typeof t.transmission == "number" && t.transmission > 0);
|
|
1007
1008
|
}
|
|
1008
|
-
function
|
|
1009
|
+
function Ba(e, t, n, s) {
|
|
1009
1010
|
const o = e.getAttribute("position"), r = e.getIndex(), i = (l) => (r == null ? void 0 : r.getX(l)) ?? l;
|
|
1010
1011
|
let a = 0, c = 0, u = 0;
|
|
1011
1012
|
for (let l = n; l + 2 < n + s; l += 3) {
|
|
@@ -1016,9 +1017,9 @@ function La(e, t, n, s) {
|
|
|
1016
1017
|
const C = (P * M + T * se + B * R) / (Y * N);
|
|
1017
1018
|
Math.abs(C) < 0.2 || (c++, u += C, C <= so && a++);
|
|
1018
1019
|
}
|
|
1019
|
-
return c >=
|
|
1020
|
+
return c >= Ea && a / c >= Da && u / c <= so;
|
|
1020
1021
|
}
|
|
1021
|
-
const
|
|
1022
|
+
const Fa = Object.freeze({
|
|
1022
1023
|
diffuse: "diffuse",
|
|
1023
1024
|
metal: "metal",
|
|
1024
1025
|
scratched_metal: "metal",
|
|
@@ -1041,26 +1042,26 @@ const Ba = Object.freeze({
|
|
|
1041
1042
|
});
|
|
1042
1043
|
function an(e) {
|
|
1043
1044
|
var o, r, i;
|
|
1044
|
-
if (((r = (o =
|
|
1045
|
-
const n = (i =
|
|
1045
|
+
if (((r = (o = ja(e.inputs["info:mdl:sourceAsset"])) == null ? void 0 : o.replaceAll("\\", "/").split("/").at(-1)) == null ? void 0 : r.toLowerCase()) !== "core_definitions.mdl") return null;
|
|
1046
|
+
const n = (i = za(
|
|
1046
1047
|
e.inputs["info:mdl:sourceAsset:subIdentifier"]
|
|
1047
1048
|
)) == null ? void 0 : i.toLowerCase();
|
|
1048
1049
|
if (n) {
|
|
1049
|
-
const a =
|
|
1050
|
+
const a = Fa[n];
|
|
1050
1051
|
return a ? { exportName: n, kind: a } : null;
|
|
1051
1052
|
}
|
|
1052
|
-
const s = (a) =>
|
|
1053
|
+
const s = (a) => Va(e, a);
|
|
1053
1054
|
return s("surface_color") && s("translucency") && s("translucent_color") ? { exportName: "thin_translucent_v2", kind: "thin-translucent" } : s("transmission_color") && s("volume_color") && s("volume_scattering") ? { exportName: "thick_translucent_v2", kind: "thick-translucent" } : s("transmission_color") && s("glass_color") && s("base_thickness") ? { exportName: "thick_glass_v2", kind: "thick-glass" } : s("transmission_color") && s("base_thickness") && s("ior") && !s("base_color") && !s("volume_color") && !s("volume_scattering") && !s("reflectivity") && !s("transmission_roughness") && !s("is_metal") ? { exportName: "thick_glass_v2", kind: "thick-glass" } : s("glass_color") && s("ior") && !s("base_color") ? { exportName: "thin_glass_v2", kind: "thin-glass" } : s("base_color") && s("normal_reflectivity") && s("grazing_reflectivity") ? { exportName: "retroreflective", kind: "retroreflective" } : s("base_color") && s("flake_color") && s("coat_roughness") ? { exportName: "flake_paint", kind: "flake-paint" } : s("base_color") && s("is_metal") && s("transmission_color") && s("transmission_roughness") ? { exportName: "flex_material_v2", kind: "flex-material" } : s("metal_color") && s("glossy_weight") ? { exportName: s("anisotropy") ? "scratched_metal_v2" : "metal", kind: "metal" } : s("diffuse_color") && s("reflectivity") ? { exportName: "scratched_plastic_v2", kind: "plastic" } : s("diffuse_color") && s("roughness") ? { exportName: "diffuse", kind: "diffuse" } : null;
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
+
function Va(e, t) {
|
|
1056
1057
|
const n = `inputs:${t}`;
|
|
1057
1058
|
return e.inputs[n] !== void 0 || e.inputs[`${n}.connect`] !== void 0 || e.inputs[`${n}.resolvedConnect`] !== void 0;
|
|
1058
1059
|
}
|
|
1059
|
-
function
|
|
1060
|
+
function za(e) {
|
|
1060
1061
|
const t = Array.isArray(e) ? e[0] : e;
|
|
1061
1062
|
return typeof t == "string" && t.length ? t : null;
|
|
1062
1063
|
}
|
|
1063
|
-
function
|
|
1064
|
+
function ja(e) {
|
|
1064
1065
|
const t = Array.isArray(e) ? e[0] : e;
|
|
1065
1066
|
if (typeof t == "string") return t;
|
|
1066
1067
|
if (!t || typeof t != "object") return null;
|
|
@@ -1071,24 +1072,24 @@ function za(e) {
|
|
|
1071
1072
|
}
|
|
1072
1073
|
return null;
|
|
1073
1074
|
}
|
|
1074
|
-
const
|
|
1075
|
+
const Wa = [1, 1, 1, 1], Ga = [0, 0, 0, 0], Ha = [2, 2, 2, 1], Ya = [-1, -1, -1, 0], Rs = 32;
|
|
1075
1076
|
function Xn(e, t, n = 1) {
|
|
1076
1077
|
const s = [], o = e.shaders.map((a) => ({
|
|
1077
1078
|
path: a.path,
|
|
1078
1079
|
id: a.id,
|
|
1079
1080
|
inputs: Object.freeze({ ...a.inputs }),
|
|
1080
1081
|
connections: br(a)
|
|
1081
|
-
})), r = t ?
|
|
1082
|
+
})), r = t ? sc(e, t, s) : [], i = As(e) ?? [];
|
|
1082
1083
|
return Object.freeze({
|
|
1083
1084
|
schemaVersion: 1,
|
|
1084
1085
|
materialPath: e.path,
|
|
1085
1086
|
surfacePath: (t == null ? void 0 : t.path) ?? null,
|
|
1086
1087
|
surfaceShaderId: (t == null ? void 0 : t.id) ?? null,
|
|
1087
1088
|
surfaceTerminals: i,
|
|
1088
|
-
dialect:
|
|
1089
|
-
workflow:
|
|
1089
|
+
dialect: cc(t),
|
|
1090
|
+
workflow: uc(e, t),
|
|
1090
1091
|
materialInputs: Object.freeze({ ...e.inputs }),
|
|
1091
|
-
alpha:
|
|
1092
|
+
alpha: lc(e, t),
|
|
1092
1093
|
nodes: Object.freeze(o),
|
|
1093
1094
|
textures: Object.freeze(r),
|
|
1094
1095
|
semantics: Ps(e, t, r, n),
|
|
@@ -1096,7 +1097,7 @@ function Xn(e, t, n = 1) {
|
|
|
1096
1097
|
program: null
|
|
1097
1098
|
});
|
|
1098
1099
|
}
|
|
1099
|
-
const
|
|
1100
|
+
const Ka = Object.freeze({
|
|
1100
1101
|
baseWeight: 1,
|
|
1101
1102
|
baseColor: [0.8, 0.8, 0.8],
|
|
1102
1103
|
diffuseRoughness: 0,
|
|
@@ -1127,7 +1128,7 @@ const Ya = Object.freeze({
|
|
|
1127
1128
|
transmissionScatterAnisotropy: 0,
|
|
1128
1129
|
transmissionDispersion: 0,
|
|
1129
1130
|
thinWalled: !1
|
|
1130
|
-
}),
|
|
1131
|
+
}), Xa = Object.freeze({
|
|
1131
1132
|
baseWeight: 1,
|
|
1132
1133
|
baseColor: [0.8, 0.8, 0.8],
|
|
1133
1134
|
diffuseRoughness: 0,
|
|
@@ -1161,12 +1162,12 @@ const Ya = Object.freeze({
|
|
|
1161
1162
|
});
|
|
1162
1163
|
function Ps(e, t, n = [], s = 1) {
|
|
1163
1164
|
var p;
|
|
1164
|
-
const o =
|
|
1165
|
+
const o = qa(t), r = o === "openpbr" ? Ka : Xa, i = [], a = (g, v) => Qa(
|
|
1165
1166
|
e,
|
|
1166
1167
|
t,
|
|
1167
1168
|
g,
|
|
1168
1169
|
v
|
|
1169
|
-
), c = (g, v, S) =>
|
|
1170
|
+
), c = (g, v, S) => Ja(
|
|
1170
1171
|
e,
|
|
1171
1172
|
t,
|
|
1172
1173
|
g,
|
|
@@ -1174,12 +1175,12 @@ function Ps(e, t, n = [], s = 1) {
|
|
|
1174
1175
|
S,
|
|
1175
1176
|
s,
|
|
1176
1177
|
i
|
|
1177
|
-
), u = (g, v) =>
|
|
1178
|
+
), u = (g, v) => ec(
|
|
1178
1179
|
e,
|
|
1179
1180
|
t,
|
|
1180
1181
|
g,
|
|
1181
1182
|
v
|
|
1182
|
-
), l = (g, v) =>
|
|
1183
|
+
), l = (g, v) => tc(
|
|
1183
1184
|
e,
|
|
1184
1185
|
t,
|
|
1185
1186
|
g,
|
|
@@ -1330,7 +1331,7 @@ function Ps(e, t, n = [], s = 1) {
|
|
|
1330
1331
|
diagnostics: Object.freeze([...new Set(i)])
|
|
1331
1332
|
});
|
|
1332
1333
|
}
|
|
1333
|
-
function
|
|
1334
|
+
function qa(e) {
|
|
1334
1335
|
return e ? /open.?pbr/i.test(e.id ?? "") ? "openpbr" : /standard.?surface/i.test(e.id ?? "") ? "materialx-standard-surface" : "other" : "other";
|
|
1335
1336
|
}
|
|
1336
1337
|
const yr = /* @__PURE__ */ new Map([
|
|
@@ -1373,7 +1374,7 @@ const yr = /* @__PURE__ */ new Map([
|
|
|
1373
1374
|
["feet", 0.3048],
|
|
1374
1375
|
["ft", 0.3048]
|
|
1375
1376
|
]);
|
|
1376
|
-
function
|
|
1377
|
+
function Ja(e, t, n, s, o, r, i) {
|
|
1377
1378
|
const a = cn(e, t, n);
|
|
1378
1379
|
if (a.connection)
|
|
1379
1380
|
return Object.freeze({
|
|
@@ -1386,7 +1387,7 @@ function qa(e, t, n, s, o, r, i) {
|
|
|
1386
1387
|
unitSource: a.unit ? "authored" : o === "stage" ? "stage" : "default",
|
|
1387
1388
|
meters: null
|
|
1388
1389
|
});
|
|
1389
|
-
const c = Bt(a.value), u =
|
|
1390
|
+
const c = Bt(a.value), u = Za(a.unit), l = Number.isFinite(r) && r > 0 ? r : 1;
|
|
1390
1391
|
let f, _, h;
|
|
1391
1392
|
u === "stage" ? (_ = "stage", f = "stage", h = l) : u ? (_ = u, f = "authored", h = yr.get(u)) : o === "centimeter" ? (_ = "centimeter", f = "default", h = 0.01) : (_ = "stage", f = "stage", h = l), a.unit && u === null && i.push(`UNSUPPORTED_LENGTH_UNIT:${a.unit}`);
|
|
1392
1393
|
const b = c ?? s;
|
|
@@ -1401,7 +1402,7 @@ function qa(e, t, n, s, o, r, i) {
|
|
|
1401
1402
|
meters: b * h
|
|
1402
1403
|
});
|
|
1403
1404
|
}
|
|
1404
|
-
function
|
|
1405
|
+
function Za(e) {
|
|
1405
1406
|
if (!e) return null;
|
|
1406
1407
|
const t = e.trim().toLowerCase().replaceAll(" ", "").replaceAll("-", "");
|
|
1407
1408
|
if (t === "stage" || t === "scene" || t === "stageunit" || t === "sceneunit")
|
|
@@ -1411,7 +1412,7 @@ function Ja(e) {
|
|
|
1411
1412
|
return n === "metre" || n === "meter" || n === "m" || n === "metres" || n === "meters" ? "meter" : n === "centimetre" || n === "centimeter" || n === "cm" || n === "centimetres" || n === "centimeters" ? "centimeter" : n === "millimetre" || n === "millimeter" || n === "mm" || n === "millimetres" || n === "millimeters" ? "millimeter" : n === "micrometre" || n === "micrometer" || n === "micron" || n === "um" || n === "micrometres" || n === "micrometers" || n === "microns" ? "micrometer" : n === "nanometre" || n === "nanometer" || n === "nm" || n === "nanometres" || n === "nanometers" ? "nanometer" : n === "kilometre" || n === "kilometer" || n === "km" || n === "kilometres" || n === "kilometers" ? "kilometer" : n === "inch" || n === "inches" || n === "in" ? "inch" : n;
|
|
1412
1413
|
return null;
|
|
1413
1414
|
}
|
|
1414
|
-
function
|
|
1415
|
+
function Qa(e, t, n, s) {
|
|
1415
1416
|
const o = cn(e, t, n);
|
|
1416
1417
|
if (o.connection) return io("connected", o, null);
|
|
1417
1418
|
const r = Bt(o.value);
|
|
@@ -1422,10 +1423,10 @@ function Za(e, t, n, s) {
|
|
|
1422
1423
|
connection: null
|
|
1423
1424
|
});
|
|
1424
1425
|
}
|
|
1425
|
-
function
|
|
1426
|
+
function ec(e, t, n, s) {
|
|
1426
1427
|
const o = cn(e, t, n);
|
|
1427
1428
|
if (o.connection) return ao("connected", o, null);
|
|
1428
|
-
const r =
|
|
1429
|
+
const r = nc(o.value);
|
|
1429
1430
|
return r ? ao("authored", o, r) : Object.freeze({
|
|
1430
1431
|
state: "default",
|
|
1431
1432
|
inputName: o.inputName,
|
|
@@ -1433,7 +1434,7 @@ function Qa(e, t, n, s) {
|
|
|
1433
1434
|
connection: null
|
|
1434
1435
|
});
|
|
1435
1436
|
}
|
|
1436
|
-
function
|
|
1437
|
+
function tc(e, t, n, s) {
|
|
1437
1438
|
const o = cn(e, t, n);
|
|
1438
1439
|
return o.connection ? co("connected", o, null) : typeof o.value == "boolean" ? co("authored", o, o.value) : Object.freeze({
|
|
1439
1440
|
state: "default",
|
|
@@ -1551,7 +1552,7 @@ function _n(e, t) {
|
|
|
1551
1552
|
const n = e[`inputs:${t}.unitType`];
|
|
1552
1553
|
return typeof n == "string" && n.length > 0 ? n : null;
|
|
1553
1554
|
}
|
|
1554
|
-
function
|
|
1555
|
+
function nc(e) {
|
|
1555
1556
|
return !Array.isArray(e) || e.length < 3 || e.slice(0, 3).some((t) => typeof t != "number" || !Number.isFinite(t)) ? null : Object.freeze([
|
|
1556
1557
|
e[0],
|
|
1557
1558
|
e[1],
|
|
@@ -1584,7 +1585,7 @@ function br(e) {
|
|
|
1584
1585
|
for (const s of Object.keys(e.inputs)) n(s, !1);
|
|
1585
1586
|
return Object.freeze([...t.values()]);
|
|
1586
1587
|
}
|
|
1587
|
-
function
|
|
1588
|
+
function sc(e, t, n) {
|
|
1588
1589
|
const s = [];
|
|
1589
1590
|
for (const o of br(t)) {
|
|
1590
1591
|
let r = o.sourcePath, i = o.outputName;
|
|
@@ -1628,7 +1629,7 @@ function nc(e, t, n) {
|
|
|
1628
1629
|
continue;
|
|
1629
1630
|
}
|
|
1630
1631
|
if (u.kind === "constant") continue;
|
|
1631
|
-
const l = u.shader, f = u.sourceChannel, _ = o.inputName === "opacity" && /standard.?surface/i.test(t.id ?? "") && f === "rgb" ? "color" :
|
|
1632
|
+
const l = u.shader, f = u.sourceChannel, _ = o.inputName === "opacity" && /standard.?surface/i.test(t.id ?? "") && f === "rgb" ? "color" : vc(o.inputName), h = dc(l) ?? (_ === "normal" ? mt(Ge(l, ["texture"])) : null);
|
|
1632
1633
|
if (!h) {
|
|
1633
1634
|
On(l) ? n.push({
|
|
1634
1635
|
code: "MISSING_TEXTURE_ASSET",
|
|
@@ -1641,22 +1642,22 @@ function nc(e, t, n) {
|
|
|
1641
1642
|
});
|
|
1642
1643
|
continue;
|
|
1643
1644
|
}
|
|
1644
|
-
const b = Mr(l), y = b ?
|
|
1645
|
+
const b = Mr(l), y = b ? Ha : u.scale, w = b ? Ya : u.bias;
|
|
1645
1646
|
s.push(Object.freeze({
|
|
1646
1647
|
surfaceInput: o.inputName,
|
|
1647
1648
|
shaderPath: l.path,
|
|
1648
1649
|
path: h,
|
|
1649
1650
|
sourceChannel: f,
|
|
1650
1651
|
semantic: _,
|
|
1651
|
-
sourceColorSpace:
|
|
1652
|
+
sourceColorSpace: Mc(l, _),
|
|
1652
1653
|
scale: y,
|
|
1653
1654
|
bias: w,
|
|
1654
|
-
uvSet:
|
|
1655
|
-
uvTransform:
|
|
1655
|
+
uvSet: mc(e, l),
|
|
1656
|
+
uvTransform: hc(e, l, n),
|
|
1656
1657
|
wrapS: mo(l, "wrapS", "wrap_s", "uaddressmode"),
|
|
1657
1658
|
wrapT: mo(l, "wrapT", "wrap_t", "vaddressmode"),
|
|
1658
|
-
fallback:
|
|
1659
|
-
...
|
|
1659
|
+
fallback: Ic(l, ["fallback", "value"]),
|
|
1660
|
+
...Tc(l)
|
|
1660
1661
|
}));
|
|
1661
1662
|
}
|
|
1662
1663
|
return s;
|
|
@@ -1670,13 +1671,13 @@ function gt(e, t, n, s) {
|
|
|
1670
1671
|
const i = e.shaders.find((w) => w.path === t);
|
|
1671
1672
|
if (!i) return null;
|
|
1672
1673
|
if (On(i)) {
|
|
1673
|
-
const w =
|
|
1674
|
+
const w = oc(i, n);
|
|
1674
1675
|
return w ? {
|
|
1675
1676
|
kind: "texture",
|
|
1676
1677
|
shader: i,
|
|
1677
1678
|
sourceChannel: w,
|
|
1678
|
-
scale: fo(i, "scale",
|
|
1679
|
-
bias: fo(i, "bias",
|
|
1679
|
+
scale: fo(i, "scale", Wa),
|
|
1680
|
+
bias: fo(i, "bias", Ga)
|
|
1680
1681
|
} : null;
|
|
1681
1682
|
}
|
|
1682
1683
|
const a = i.id ?? "", c = Se(i, ["out", "result"]);
|
|
@@ -1706,7 +1707,7 @@ function gt(e, t, n, s) {
|
|
|
1706
1707
|
r
|
|
1707
1708
|
);
|
|
1708
1709
|
if (!d || d.kind === "constant") return d;
|
|
1709
|
-
const m =
|
|
1710
|
+
const m = rc(a, d.sourceChannel);
|
|
1710
1711
|
return m ? { ...d, sourceChannel: m } : null;
|
|
1711
1712
|
}
|
|
1712
1713
|
if (/^ND_swizzle_/i.test(a)) {
|
|
@@ -1719,7 +1720,7 @@ function gt(e, t, n, s) {
|
|
|
1719
1720
|
r
|
|
1720
1721
|
);
|
|
1721
1722
|
if (!d || d.kind === "constant") return d;
|
|
1722
|
-
const m =
|
|
1723
|
+
const m = ic(i, a, d.sourceChannel);
|
|
1723
1724
|
return m ? { ...d, sourceChannel: m } : null;
|
|
1724
1725
|
}
|
|
1725
1726
|
if (/^ND_separate4_color4$/i.test(a)) {
|
|
@@ -1807,7 +1808,7 @@ function gt(e, t, n, s) {
|
|
|
1807
1808
|
const y = /^ND_(multiply|add|subtract|divide)_(float|color3|color4|vector3|vector4)$/i.exec(a);
|
|
1808
1809
|
if (y) {
|
|
1809
1810
|
const w = y[1].toLowerCase(), d = et(e, i, "in1", r), m = et(e, i, "in2", r), p = (d == null ? void 0 : d.kind) === "texture" ? d : null, g = (m == null ? void 0 : m.kind) === "texture" ? m : null;
|
|
1810
|
-
return p && (m == null ? void 0 : m.kind) === "constant" ? lo(p, w, m.value, !1) : g && (d == null ? void 0 : d.kind) === "constant" && w !== "divide" ? lo(g, w, d.value, !0) : (d == null ? void 0 : d.kind) === "constant" && (m == null ? void 0 : m.kind) === "constant" ? { kind: "constant", value:
|
|
1811
|
+
return p && (m == null ? void 0 : m.kind) === "constant" ? lo(p, w, m.value, !1) : g && (d == null ? void 0 : d.kind) === "constant" && w !== "divide" ? lo(g, w, d.value, !0) : (d == null ? void 0 : d.kind) === "constant" && (m == null ? void 0 : m.kind) === "constant" ? { kind: "constant", value: ac(w, d.value, m.value) } : null;
|
|
1811
1812
|
}
|
|
1812
1813
|
if (/^ND_constant_/i.test(a)) {
|
|
1813
1814
|
const w = Ge(i, ["value"]);
|
|
@@ -1815,17 +1816,17 @@ function gt(e, t, n, s) {
|
|
|
1815
1816
|
}
|
|
1816
1817
|
return null;
|
|
1817
1818
|
}
|
|
1818
|
-
function
|
|
1819
|
+
function oc(e, t) {
|
|
1819
1820
|
const n = Sr(t);
|
|
1820
1821
|
return n === "rgb" && /^ND_(?:image|tiledimage)_float$/i.test(e.id ?? "") ? "r" : n;
|
|
1821
1822
|
}
|
|
1822
|
-
function
|
|
1823
|
+
function rc(e, t) {
|
|
1823
1824
|
const n = /^ND_convert_(?:color|vector|float)([34]?)_(?:color|vector|float)([34]?)$/i.exec(e);
|
|
1824
1825
|
if (!n) return null;
|
|
1825
1826
|
const s = n[1] ? Number(n[1]) : 1, o = n[2] ? Number(n[2]) : 1, r = t === "rgb" ? 3 : 1;
|
|
1826
1827
|
return r === 3 && s >= 3 && o === 3 ? "rgb" : r === 1 && s === 1 && o === 1 ? t : null;
|
|
1827
1828
|
}
|
|
1828
|
-
function
|
|
1829
|
+
function ic(e, t, n) {
|
|
1829
1830
|
var u;
|
|
1830
1831
|
const s = /^ND_swizzle_(float|color3|color4|vector3|vector4)_(float|color3|color4|vector3|vector4)$/i.exec(t);
|
|
1831
1832
|
if (!s) return null;
|
|
@@ -1921,7 +1922,7 @@ function ot(e, t, n) {
|
|
|
1921
1922
|
const s = n === "mono" ? 0 : "rgba".indexOf(n);
|
|
1922
1923
|
return s >= 0 && e.length > s ? e[s] : null;
|
|
1923
1924
|
}
|
|
1924
|
-
function
|
|
1925
|
+
function ac(e, t, n) {
|
|
1925
1926
|
const s = Bt(t), o = Bt(n);
|
|
1926
1927
|
return s !== null && o !== null ? e === "multiply" ? s * o : e === "add" ? s + o : e === "subtract" ? s - o : o === 0 ? null : s / o : null;
|
|
1927
1928
|
}
|
|
@@ -1929,7 +1930,7 @@ function Cs(e, t) {
|
|
|
1929
1930
|
const n = /^(.*)\.inputs:([^/.]+)$/.exec(t);
|
|
1930
1931
|
return (n == null ? void 0 : n[1]) === e.path && n[2] ? n[2] : null;
|
|
1931
1932
|
}
|
|
1932
|
-
function
|
|
1933
|
+
function cc(e) {
|
|
1933
1934
|
var i;
|
|
1934
1935
|
if (!e) return "unknown";
|
|
1935
1936
|
const t = e.id ?? "";
|
|
@@ -1940,16 +1941,16 @@ function ac(e) {
|
|
|
1940
1941
|
const n = mt(e.inputs["info:mdl:sourceAsset"]), s = (i = n == null ? void 0 : n.split(/[\\/]/).at(-1)) == null ? void 0 : i.toLowerCase(), o = qt(e, "info:mdl:sourceAsset:subIdentifier"), r = an(e);
|
|
1941
1942
|
return r ? r.kind === "thin-translucent" ? "thin-translucent-v2" : "core-definitions" : s === "omnipbr.mdl" ? "omnipbr" : Tr(e) ? "omni-pbr-base" : s === "omniglass.mdl" ? "omniglass" : s === "omnisurfacebase.mdl" || (o == null ? void 0 : o.toLowerCase()) === "omnisurfacebase" ? "omni-surface-base" : Es(e) ? "gltf-material" : "unknown";
|
|
1942
1943
|
}
|
|
1943
|
-
function
|
|
1944
|
+
function uc(e, t) {
|
|
1944
1945
|
if (!t) return "unknown";
|
|
1945
1946
|
if (Es(t)) return "metallic";
|
|
1946
1947
|
const n = an(t);
|
|
1947
|
-
return n ? n.kind === "thin-translucent" || n.kind === "thin-glass" || n.kind === "thick-glass" || n.kind === "thick-translucent" ? "specular" : "metallic" :
|
|
1948
|
+
return n ? n.kind === "thin-translucent" || n.kind === "thin-glass" || n.kind === "thick-glass" || n.kind === "thick-translucent" ? "specular" : "metallic" : Uc(t) ? "specular" : Tr(t) ? "metallic" : /UsdPreviewSurface/i.test(t.id ?? "") ? Mt(e, t, ["useSpecularWorkflow"]).value === !0 ? "specular" : "metallic" : "unknown";
|
|
1948
1949
|
}
|
|
1949
|
-
function
|
|
1950
|
+
function lc(e, t) {
|
|
1950
1951
|
if (!t) return Object.freeze({ mode: "opaque", cutoff: 0, opacityMode: null });
|
|
1951
|
-
if (Es(t)) return
|
|
1952
|
-
if (
|
|
1952
|
+
if (Es(t)) return pc(e, t);
|
|
1953
|
+
if (fc(t) && !Ir(t, "enable_opacity", !1))
|
|
1953
1954
|
return Object.freeze({ mode: "opaque", cutoff: 0, opacityMode: null });
|
|
1954
1955
|
const n = Bt(Mt(
|
|
1955
1956
|
e,
|
|
@@ -1958,7 +1959,7 @@ function uc(e, t) {
|
|
|
1958
1959
|
).value) ?? 0, s = Mt(e, t, ["opacityMode"]).value, o = Bn(s);
|
|
1959
1960
|
if (n > 0)
|
|
1960
1961
|
return Object.freeze({ mode: "mask", cutoff: ps(n), opacityMode: o });
|
|
1961
|
-
const i =
|
|
1962
|
+
const i = Sc(Mt(
|
|
1962
1963
|
e,
|
|
1963
1964
|
t,
|
|
1964
1965
|
["opacity", "presence", "geometry_opacity", "opacity_constant"]
|
|
@@ -1972,7 +1973,7 @@ function uc(e, t) {
|
|
|
1972
1973
|
function Bn(e) {
|
|
1973
1974
|
return e === "presence" || e === 1 || e === !0 ? "presence" : e === "transparent" || e === 0 || e === !1 ? "transparent" : null;
|
|
1974
1975
|
}
|
|
1975
|
-
function
|
|
1976
|
+
function pc(e, t) {
|
|
1976
1977
|
const n = Mt(e, t, ["alpha_mode"]).value, s = n === 1 || n === "mask" ? "mask" : n === 2 || n === "blend" ? "blend" : "opaque";
|
|
1977
1978
|
if (s === "mask") {
|
|
1978
1979
|
const o = Bt(Mt(
|
|
@@ -1997,15 +1998,15 @@ function lc(e, t) {
|
|
|
1997
1998
|
}
|
|
1998
1999
|
return Object.freeze({ mode: s, cutoff: 0, opacityMode: null, opacity: null });
|
|
1999
2000
|
}
|
|
2000
|
-
function
|
|
2001
|
+
function fc(e) {
|
|
2001
2002
|
var n, s;
|
|
2002
2003
|
const t = (s = (n = mt(e.inputs["info:mdl:sourceAsset"])) == null ? void 0 : n.split(/[\\/]/).at(-1)) == null ? void 0 : s.toLowerCase();
|
|
2003
2004
|
return t === "omnipbr.mdl" || t === "omnipbrbase.mdl" || t === "omniglass.mdl";
|
|
2004
2005
|
}
|
|
2005
|
-
function
|
|
2006
|
+
function dc(e) {
|
|
2006
2007
|
return On(e) ? mt(Ge(e, ["file", "filename", "texture"])) : null;
|
|
2007
2008
|
}
|
|
2008
|
-
function
|
|
2009
|
+
function mc(e, t) {
|
|
2009
2010
|
if (un(t)) {
|
|
2010
2011
|
const o = st(t, ["tex_coord_index"]);
|
|
2011
2012
|
return o !== null && Number.isInteger(o) && o >= 0 ? `texcoord${o}` : null;
|
|
@@ -2015,10 +2016,10 @@ function dc(e, t) {
|
|
|
2015
2016
|
const s = us(e, n.path);
|
|
2016
2017
|
return s ? xs(s, ["varname", "geomprop"]) : null;
|
|
2017
2018
|
}
|
|
2018
|
-
function
|
|
2019
|
-
const s =
|
|
2019
|
+
function hc(e, t, n) {
|
|
2020
|
+
const s = gc(e, t, n), o = yc(e, t, n);
|
|
2020
2021
|
if (s && o) {
|
|
2021
|
-
const r =
|
|
2022
|
+
const r = _c(s, o);
|
|
2022
2023
|
return r || (n.push({
|
|
2023
2024
|
code: "TEXTURE_UV_UNSUPPORTED",
|
|
2024
2025
|
sourcePath: t.path,
|
|
@@ -2027,7 +2028,7 @@ function mc(e, t, n) {
|
|
|
2027
2028
|
}
|
|
2028
2029
|
return o ?? s;
|
|
2029
2030
|
}
|
|
2030
|
-
function
|
|
2031
|
+
function _c(e, t) {
|
|
2031
2032
|
if (e.bakedInGeometry || t.bakedInGeometry) return null;
|
|
2032
2033
|
const n = cs(
|
|
2033
2034
|
as(e),
|
|
@@ -2035,7 +2036,7 @@ function hc(e, t) {
|
|
|
2035
2036
|
);
|
|
2036
2037
|
return vr(e.sourcePath, n, !1);
|
|
2037
2038
|
}
|
|
2038
|
-
function
|
|
2039
|
+
function gc(e, t, n) {
|
|
2039
2040
|
if (Mr(t)) {
|
|
2040
2041
|
if (["scale", "rotate", "offset", "pivot", "operationorder"].some((u) => Se(t, [u])))
|
|
2041
2042
|
return n.push({
|
|
@@ -2095,7 +2096,7 @@ function _c(e, t, n) {
|
|
|
2095
2096
|
return null;
|
|
2096
2097
|
}
|
|
2097
2098
|
const os = Object.freeze([1, 0, 0, 0, 1, 0]), rs = 1e-9;
|
|
2098
|
-
function
|
|
2099
|
+
function yc(e, t, n) {
|
|
2099
2100
|
const s = Se(t, ["st", "texcoord", "texCoord"]);
|
|
2100
2101
|
if (!s) return null;
|
|
2101
2102
|
const o = e.shaders.find((i) => i.path === s.path);
|
|
@@ -2211,7 +2212,7 @@ function is(e, t, n) {
|
|
|
2211
2212
|
return u([h, b, 0, -b, h, 0], y);
|
|
2212
2213
|
}
|
|
2213
2214
|
if (/^ND_transformmatrix_vector2M3$/i.test(o)) {
|
|
2214
|
-
const f =
|
|
2215
|
+
const f = bc(e, t, "mat");
|
|
2215
2216
|
return f ? u([
|
|
2216
2217
|
f[0],
|
|
2217
2218
|
f[3],
|
|
@@ -2307,14 +2308,14 @@ function us(e, t, n = /* @__PURE__ */ new Set()) {
|
|
|
2307
2308
|
}
|
|
2308
2309
|
function qn(e, t, n, s) {
|
|
2309
2310
|
if (Se(t, [n]))
|
|
2310
|
-
return
|
|
2311
|
+
return wc(e, n, t);
|
|
2311
2312
|
const o = Ge(t, [n]);
|
|
2312
2313
|
return o === void 0 ? s : typeof o == "number" && Number.isFinite(o) ? o : null;
|
|
2313
2314
|
}
|
|
2314
2315
|
function po(e, t, n, s) {
|
|
2315
2316
|
return Se(t, [n]) ? ls(e, n, t) : Ge(t, [n]) === void 0 ? s : ls(e, n, t);
|
|
2316
2317
|
}
|
|
2317
|
-
function
|
|
2318
|
+
function bc(e, t, n) {
|
|
2318
2319
|
var a;
|
|
2319
2320
|
const s = Se(t, [n]), o = s ? e.shaders.find((c) => c.path === s.path) : t;
|
|
2320
2321
|
if (!o || s && !/^ND_constant_matrix33$/i.test(o.id ?? "")) return null;
|
|
@@ -2327,7 +2328,7 @@ function yc(e, t, n) {
|
|
|
2327
2328
|
)) == null ? void 0 : a.map(Number);
|
|
2328
2329
|
return (i == null ? void 0 : i.length) === 9 && i.every(Number.isFinite) ? i : null;
|
|
2329
2330
|
}
|
|
2330
|
-
function
|
|
2331
|
+
function wc(e, t, n) {
|
|
2331
2332
|
const s = Se(n, [t]);
|
|
2332
2333
|
if (!s) return st(n, [t]);
|
|
2333
2334
|
const o = e.shaders.find((r) => r.path === s.path);
|
|
@@ -2345,7 +2346,7 @@ function ls(e, t, n) {
|
|
|
2345
2346
|
function Sr(e) {
|
|
2346
2347
|
return !e || /^(?:out|result)$/i.test(e) ? "rgb" : /^(?:mono|resultMono)$/i.test(e) ? "mono" : /^(?:tint|resultTint)$/i.test(e) ? "rgb" : /^(?:r|resultR)$/i.test(e) ? "r" : /^(?:g|resultG)$/i.test(e) ? "g" : /^(?:b|resultB)$/i.test(e) ? "b" : /^(?:a|resultA|alpha)$/i.test(e) ? "a" : /^(?:rgb|resultRGB)$/i.test(e) ? "rgb" : null;
|
|
2347
2348
|
}
|
|
2348
|
-
function
|
|
2349
|
+
function vc(e) {
|
|
2349
2350
|
return /(?:roughness|metalness|metallic|occlusion|opacity|transmission|thickness)$/i.test(e) || /(?:^|\.)(?:specular|specular_weight|sheen|fuzz_weight|coat|coat_weight|emission_luminance|emission_strength)$/i.test(e) ? "scalar" : /(?:^|\.)(?:normal|normal_texture|normalmap_texture|normalCamera|geometry_normal|coat_normal|coatNormal|geometry_coat_normal)$/i.test(e) ? "normal" : /(?:diffuse|base.?color|surface.?color|translucent.?color|metal.?color|glass.?color|transmission.?color|volume.?color|flake.?color|reflection.?color|emission|emissive|sheen|fuzz|specular.?color|coat.?color)/i.test(e) ? "color" : "scalar";
|
|
2350
2351
|
}
|
|
2351
2352
|
function Ge(e, t) {
|
|
@@ -2378,7 +2379,7 @@ function Mt(e, t, n) {
|
|
|
2378
2379
|
function Bt(e) {
|
|
2379
2380
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
2380
2381
|
}
|
|
2381
|
-
function
|
|
2382
|
+
function Sc(e) {
|
|
2382
2383
|
return typeof e == "number" && Number.isFinite(e) ? [e] : Array.isArray(e) ? e.every((t) => typeof t == "number" && Number.isFinite(t)) ? e : [] : [];
|
|
2383
2384
|
}
|
|
2384
2385
|
function xs(e, t) {
|
|
@@ -2397,7 +2398,7 @@ function tt(e, t, n) {
|
|
|
2397
2398
|
const s = Ge(e, [t]);
|
|
2398
2399
|
return Array.isArray(s) && s.length >= 2 && typeof s[0] == "number" && Number.isFinite(s[0]) && typeof s[1] == "number" && Number.isFinite(s[1]) ? Object.freeze([s[0], s[1]]) : n;
|
|
2399
2400
|
}
|
|
2400
|
-
function
|
|
2401
|
+
function Ic(e, t) {
|
|
2401
2402
|
const n = Ge(e, t);
|
|
2402
2403
|
return Array.isArray(n) && n.every((s) => typeof s == "number" && Number.isFinite(s)) ? Object.freeze([...n]) : null;
|
|
2403
2404
|
}
|
|
@@ -2444,7 +2445,7 @@ function Es(e) {
|
|
|
2444
2445
|
"inputs:normal_texture.connect"
|
|
2445
2446
|
].some((r) => e.inputs[r] !== void 0);
|
|
2446
2447
|
}
|
|
2447
|
-
function
|
|
2448
|
+
function Uc(e) {
|
|
2448
2449
|
var n;
|
|
2449
2450
|
const t = (n = mt(e.inputs["info:mdl:sourceAsset"])) == null ? void 0 : n.replaceAll("\\", "/");
|
|
2450
2451
|
return /(?:^|\/)OmniSurface\/OmniSurfaceBase\.mdl$/i.test(t ?? "") || (qt(e, "info:mdl:sourceAsset:subIdentifier") ?? "").toLowerCase() === "omnisurfacebase";
|
|
@@ -2463,11 +2464,11 @@ function Tr(e) {
|
|
|
2463
2464
|
function Fn(e) {
|
|
2464
2465
|
return qt(e, "info:mdl:sourceAsset:subIdentifier") ?? e.id ?? "";
|
|
2465
2466
|
}
|
|
2466
|
-
function
|
|
2467
|
+
function Mc(e, t) {
|
|
2467
2468
|
const n = xs(e, ["sourceColorSpace", "fileColorSpace"]);
|
|
2468
2469
|
return n && n.toLowerCase() !== "auto" ? n : t === "normal" ? "raw" : Ur(e) || Ds(e) || un(e) || (n == null ? void 0 : n.toLowerCase()) === "auto" ? t === "color" ? "sRGB" : "raw" : null;
|
|
2469
2470
|
}
|
|
2470
|
-
function
|
|
2471
|
+
function Tc(e) {
|
|
2471
2472
|
return Ds(e) ? {
|
|
2472
2473
|
monoSource: st(e, ["mono_source"]),
|
|
2473
2474
|
brightness: st(e, ["brightness"]) ?? 1,
|
|
@@ -2496,27 +2497,27 @@ function mt(e) {
|
|
|
2496
2497
|
}
|
|
2497
2498
|
return null;
|
|
2498
2499
|
}
|
|
2499
|
-
const
|
|
2500
|
-
async function
|
|
2500
|
+
const Ac = /^outputs:(?:([^:]+):)?surface$/, ho = ["mtlx", "universal", "mdl"];
|
|
2501
|
+
async function Oc(e, t = {}) {
|
|
2501
2502
|
const n = Nt(e), s = /* @__PURE__ */ new Map();
|
|
2502
2503
|
for (const o of e.data.materials) {
|
|
2503
2504
|
const r = As(o), i = r === null ? [] : r.map((u) => ({
|
|
2504
2505
|
...u,
|
|
2505
2506
|
shader: o.shaders.find((l) => l.path === u.sourcePath) ?? null
|
|
2506
|
-
})), a = r === null && n ? await
|
|
2507
|
+
})), a = r === null && n ? await Nc(n, o) : [], c = i.length ? i : a.length ? a : Rc(o);
|
|
2507
2508
|
s.set(o.path, Object.freeze({
|
|
2508
2509
|
terminals: Object.freeze(c),
|
|
2509
|
-
selected:
|
|
2510
|
+
selected: Pc(c, t.isSupported),
|
|
2510
2511
|
source: i.length ? "probe" : a.length ? "stage" : c.length ? "material-inputs" : "none"
|
|
2511
2512
|
}));
|
|
2512
2513
|
}
|
|
2513
2514
|
return s;
|
|
2514
2515
|
}
|
|
2515
2516
|
function fs(e) {
|
|
2516
|
-
const t =
|
|
2517
|
+
const t = Ac.exec(e);
|
|
2517
2518
|
return t ? { renderContext: t[1] ?? null } : null;
|
|
2518
2519
|
}
|
|
2519
|
-
async function
|
|
2520
|
+
async function Nc(e, t) {
|
|
2520
2521
|
return (await Ar(e, t)).map((s) => ({
|
|
2521
2522
|
...s,
|
|
2522
2523
|
shader: t.shaders.find((o) => o.path === s.sourcePath) ?? null
|
|
@@ -2538,7 +2539,7 @@ async function Ar(e, t) {
|
|
|
2538
2539
|
}
|
|
2539
2540
|
return Or(s);
|
|
2540
2541
|
}
|
|
2541
|
-
function
|
|
2542
|
+
function Rc(e) {
|
|
2542
2543
|
const t = /* @__PURE__ */ new Map();
|
|
2543
2544
|
for (const s of Object.keys(e.inputs))
|
|
2544
2545
|
s.endsWith(".resolvedConnect") && t.set(
|
|
@@ -2573,7 +2574,7 @@ function Or(e) {
|
|
|
2573
2574
|
}
|
|
2574
2575
|
return [...t.values()];
|
|
2575
2576
|
}
|
|
2576
|
-
function
|
|
2577
|
+
function Pc(e, t) {
|
|
2577
2578
|
const n = e.filter((o) => o.shader !== null && ((t == null ? void 0 : t(o.shader)) ?? !0));
|
|
2578
2579
|
if (!n.length) return null;
|
|
2579
2580
|
const s = n.map((o) => ({
|
|
@@ -2588,7 +2589,7 @@ function Rc(e, t) {
|
|
|
2588
2589
|
(o, r) => o.attributeName.localeCompare(r.attributeName) || o.sourcePath.localeCompare(r.sourcePath)
|
|
2589
2590
|
)[0];
|
|
2590
2591
|
}
|
|
2591
|
-
async function
|
|
2592
|
+
async function Cc(e, t) {
|
|
2592
2593
|
const n = Nt(e);
|
|
2593
2594
|
if (!n || t.shaders.length) return null;
|
|
2594
2595
|
try {
|
|
@@ -2604,7 +2605,7 @@ async function Pc(e, t) {
|
|
|
2604
2605
|
...t.inputs,
|
|
2605
2606
|
...r
|
|
2606
2607
|
};
|
|
2607
|
-
|
|
2608
|
+
Dc(t.path, i);
|
|
2608
2609
|
const a = [], c = /* @__PURE__ */ new Set();
|
|
2609
2610
|
for (const u of o)
|
|
2610
2611
|
await Nr(
|
|
@@ -2624,7 +2625,7 @@ async function Nr(e, t, n, s, o, r) {
|
|
|
2624
2625
|
if (o.has(t) || !(await e.primInfo(t)).valid) return;
|
|
2625
2626
|
o.add(t);
|
|
2626
2627
|
const a = await Rr(e, t, /^(?:inputs|info):/);
|
|
2627
|
-
|
|
2628
|
+
xc(a, n, s);
|
|
2628
2629
|
const c = typeof a["info:id"] == "string" ? a["info:id"] : null, u = { path: t, id: c, inputs: a };
|
|
2629
2630
|
r.push(u);
|
|
2630
2631
|
const l = Cr(Object.entries(a).filter(([f]) => f.endsWith(".connect")).map(([, f]) => {
|
|
@@ -2655,7 +2656,7 @@ async function Rr(e, t, n) {
|
|
|
2655
2656
|
}
|
|
2656
2657
|
return s;
|
|
2657
2658
|
}
|
|
2658
|
-
function
|
|
2659
|
+
function xc(e, t, n) {
|
|
2659
2660
|
for (const [s, o] of Object.entries(e)) {
|
|
2660
2661
|
if (!s.startsWith("inputs:") || !s.endsWith(".connect") && !s.endsWith(".resolvedConnect")) continue;
|
|
2661
2662
|
const r = Pr(
|
|
@@ -2691,7 +2692,7 @@ function Pr(e, t, n, s) {
|
|
|
2691
2692
|
value: n[`inputs:${i}`]
|
|
2692
2693
|
} : { connection: null, hasValue: !1 };
|
|
2693
2694
|
}
|
|
2694
|
-
function
|
|
2695
|
+
function Dc(e, t) {
|
|
2695
2696
|
const n = Cr(Object.keys(t).filter((i) => i.startsWith("inputs:")).map((i) => i.replace(/\.(?:resolvedConnect|connect)$/, "").slice(7))), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = (i) => {
|
|
2696
2697
|
if (o.has(i)) return;
|
|
2697
2698
|
if (s.has(i)) throw new Error("Cyclic material interface");
|
|
@@ -2731,7 +2732,7 @@ function At(e, t, n = 1, s = 0, o = "rgb") {
|
|
|
2731
2732
|
const f = new Gs(u, i, a, Ys, Hs);
|
|
2732
2733
|
return f.wrapS = e.wrapS, f.wrapT = e.wrapT, f.offset.copy(e.offset), f.repeat.copy(e.repeat), f.center.copy(e.center), f.rotation = e.rotation, f.matrix.copy(e.matrix), f.matrixAutoUpdate = e.matrixAutoUpdate, f.channel = e.channel, f.flipY = e.flipY, f.minFilter = e.minFilter, f.magFilter = e.magFilter, f.anisotropy = e.anisotropy, f.generateMipmaps = e.generateMipmaps, f.colorSpace = Re, f.needsUpdate = !0, f;
|
|
2733
2734
|
}
|
|
2734
|
-
function
|
|
2735
|
+
function Ec(e, t, n, s = 1) {
|
|
2735
2736
|
const o = [], r = [], i = [];
|
|
2736
2737
|
let a = !1;
|
|
2737
2738
|
const c = [], u = {}, l = Ps(
|
|
@@ -2866,7 +2867,7 @@ function Dc(e, t, n, s = 1) {
|
|
|
2866
2867
|
].includes(E))
|
|
2867
2868
|
};
|
|
2868
2869
|
}
|
|
2869
|
-
function
|
|
2870
|
+
function $c(e, t) {
|
|
2870
2871
|
var n;
|
|
2871
2872
|
for (const s of e) {
|
|
2872
2873
|
const o = t.fields;
|
|
@@ -2912,7 +2913,7 @@ function gn(e) {
|
|
|
2912
2913
|
function _o(e) {
|
|
2913
2914
|
return !Array.isArray(e) || e.length < 3 ? null : e.slice(0, 3).every((t) => typeof t == "number" && Number.isFinite(t)) ? new me(e[0], e[1], e[2]) : null;
|
|
2914
2915
|
}
|
|
2915
|
-
function
|
|
2916
|
+
function kc(e, t, n, s = [], o = !1) {
|
|
2916
2917
|
if (e.some((u) => !Number.isInteger(u) || u < 0) || e.reduce((u, l) => u + l, 0) !== t.length || s.some((u) => !Number.isInteger(u) || u < 0 || u >= e.length))
|
|
2917
2918
|
throw new Error("Invalid authored face topology");
|
|
2918
2919
|
const r = [], i = [], a = new Set(s);
|
|
@@ -2925,14 +2926,14 @@ function $c(e, t, n, s = [], o = !1) {
|
|
|
2925
2926
|
throw new Error("Authored polygon/loader corner correspondence unavailable");
|
|
2926
2927
|
return { corners: r, faces: i };
|
|
2927
2928
|
}
|
|
2928
|
-
function
|
|
2929
|
+
function Lc(e, t, n) {
|
|
2929
2930
|
if (t.length !== n || t.some((o) => !Number.isInteger(o) || o < 0 || o >= e.length))
|
|
2930
2931
|
throw new Error("Invalid faceVarying UV indices");
|
|
2931
2932
|
const s = t.flatMap((o) => e[o]);
|
|
2932
2933
|
if (s.length !== n * 2 || !s.every(Number.isFinite)) throw new Error("Invalid UV values");
|
|
2933
2934
|
return s;
|
|
2934
2935
|
}
|
|
2935
|
-
function
|
|
2936
|
+
function Bc(e, t) {
|
|
2936
2937
|
const n = Array(e).fill(0);
|
|
2937
2938
|
for (const s of t) for (const o of s.faces) {
|
|
2938
2939
|
if (!Number.isInteger(o) || o < 0 || o >= e || n[o] !== 0)
|
|
@@ -2941,7 +2942,7 @@ function Lc(e, t) {
|
|
|
2941
2942
|
}
|
|
2942
2943
|
return n;
|
|
2943
2944
|
}
|
|
2944
|
-
async function
|
|
2945
|
+
async function Fc(e, t, n, s) {
|
|
2945
2946
|
const o = Nt(e);
|
|
2946
2947
|
if (!o) return;
|
|
2947
2948
|
const r = (c, u) => t.warnings.push({
|
|
@@ -2954,7 +2955,7 @@ async function Bc(e, t, n, s) {
|
|
|
2954
2955
|
};
|
|
2955
2956
|
for (const c of e.data.elements) {
|
|
2956
2957
|
const u = e.index.objectsByPath.get(c.path);
|
|
2957
|
-
if (u instanceof Ce &&
|
|
2958
|
+
if (u instanceof Ce && Vc(u))
|
|
2958
2959
|
try {
|
|
2959
2960
|
const l = e.index.primsByPath.get(c.path);
|
|
2960
2961
|
if (!l || l.typeName !== "Mesh") continue;
|
|
@@ -2967,7 +2968,7 @@ async function Bc(e, t, n, s) {
|
|
|
2967
2968
|
}
|
|
2968
2969
|
const m = await a(c.path, "faceVertexCounts"), p = await a(c.path, "faceVertexIndices");
|
|
2969
2970
|
if (!m || !p || u.geometry.index) throw new Error("Authored face topology unavailable");
|
|
2970
|
-
const g =
|
|
2971
|
+
const g = kc(
|
|
2971
2972
|
m,
|
|
2972
2973
|
p,
|
|
2973
2974
|
c.geometry.pointIndices ?? [],
|
|
@@ -2977,7 +2978,7 @@ async function Bc(e, t, n, s) {
|
|
|
2977
2978
|
if (u.geometry.getAttribute("position").count !== g.corners.length)
|
|
2978
2979
|
throw new Error("Loader geometry corner count mismatch");
|
|
2979
2980
|
if (w && d) {
|
|
2980
|
-
const A =
|
|
2981
|
+
const A = Lc(w, d, p.length), k = g.corners.flatMap((T) => [A[T * 2], A[T * 2 + 1]]), P = u.geometry.getAttribute("uv");
|
|
2981
2982
|
(!P || P.array.length !== k.length || k.some((T, B) => Math.abs(T - P.array[B]) > 1e-6)) && (u.geometry.setAttribute("uv", new Mi(k, 2)), c.geometry.uvs = k);
|
|
2982
2983
|
}
|
|
2983
2984
|
if (!h) continue;
|
|
@@ -2987,7 +2988,7 @@ async function Bc(e, t, n, s) {
|
|
|
2987
2988
|
if (!k || !e.index.materialsByPath.has(k))
|
|
2988
2989
|
throw new Error("Unresolved subset material");
|
|
2989
2990
|
return { materialPath: k, faces: A.indices };
|
|
2990
|
-
}), S = [...new Set(v.map((A) => A.materialPath))], O =
|
|
2991
|
+
}), S = [...new Set(v.map((A) => A.materialPath))], O = Bc(m.length, v.map((A) => ({ faces: A.faces, slot: S.indexOf(A.materialPath) + 1 })));
|
|
2991
2992
|
let I = g.faces.map((A) => O[A]);
|
|
2992
2993
|
const U = [u.material];
|
|
2993
2994
|
try {
|
|
@@ -3015,7 +3016,7 @@ async function Bc(e, t, n, s) {
|
|
|
3015
3016
|
}
|
|
3016
3017
|
}
|
|
3017
3018
|
}
|
|
3018
|
-
function
|
|
3019
|
+
function Vc(e) {
|
|
3019
3020
|
let t = e;
|
|
3020
3021
|
for (; t; ) {
|
|
3021
3022
|
if (!t.visible || t.userData.usdPurposeExcluded) return !1;
|
|
@@ -3026,7 +3027,7 @@ function Fc(e) {
|
|
|
3026
3027
|
const Dr = "usdTextureDeferred";
|
|
3027
3028
|
class Er extends Vt {
|
|
3028
3029
|
constructor() {
|
|
3029
|
-
super(
|
|
3030
|
+
super(Wc());
|
|
3030
3031
|
Zt(this, "clones", /* @__PURE__ */ new Set());
|
|
3031
3032
|
}
|
|
3032
3033
|
clone() {
|
|
@@ -3068,7 +3069,7 @@ async function ds(e, t, n, s, o) {
|
|
|
3068
3069
|
throw r && Ut(r), a;
|
|
3069
3070
|
}
|
|
3070
3071
|
}
|
|
3071
|
-
class
|
|
3072
|
+
class zc extends Map {
|
|
3072
3073
|
constructor() {
|
|
3073
3074
|
super(...arguments);
|
|
3074
3075
|
Zt(this, "readiness", /* @__PURE__ */ new WeakMap());
|
|
@@ -3111,7 +3112,7 @@ function ln(e) {
|
|
|
3111
3112
|
function $r(e) {
|
|
3112
3113
|
return (e == null ? void 0 : e.userData[Dr]) === !0;
|
|
3113
3114
|
}
|
|
3114
|
-
function
|
|
3115
|
+
function jc(e) {
|
|
3115
3116
|
const {
|
|
3116
3117
|
requestRender: t,
|
|
3117
3118
|
resolveSourcePath: n,
|
|
@@ -3250,7 +3251,7 @@ function zc(e) {
|
|
|
3250
3251
|
}
|
|
3251
3252
|
return new h(s);
|
|
3252
3253
|
}
|
|
3253
|
-
function
|
|
3254
|
+
function Wc() {
|
|
3254
3255
|
return typeof ImageData > "u" ? null : new ImageData(new Uint8ClampedArray([255, 255, 255, 255]), 1, 1);
|
|
3255
3256
|
}
|
|
3256
3257
|
async function go(e, t) {
|
|
@@ -3258,7 +3259,7 @@ async function go(e, t) {
|
|
|
3258
3259
|
const n = e instanceof Er ? e.variants() : [e];
|
|
3259
3260
|
for (const s of n) await t(s);
|
|
3260
3261
|
}
|
|
3261
|
-
function
|
|
3262
|
+
function Gc(e, t) {
|
|
3262
3263
|
const s = [], o = /* @__PURE__ */ new Set();
|
|
3263
3264
|
let r = null, i = !1;
|
|
3264
3265
|
const a = (l) => {
|
|
@@ -3312,19 +3313,19 @@ function Wc(e, t) {
|
|
|
3312
3313
|
}
|
|
3313
3314
|
};
|
|
3314
3315
|
}
|
|
3315
|
-
function
|
|
3316
|
+
function Hc(e) {
|
|
3316
3317
|
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
3317
3318
|
let o = null, r = null, i = !1;
|
|
3318
3319
|
const a = () => (o ?? (o = Promise.resolve().then(() => {
|
|
3319
3320
|
if (i) throw Lr();
|
|
3320
|
-
return r = new ea().setTranscoderPath(e.transcoderPath ??
|
|
3321
|
+
return r = new ea().setTranscoderPath(e.transcoderPath ?? ta("basis")).setWorkerLimit(e.workerLimit ?? 2).detectSupport(e.renderer), r;
|
|
3321
3322
|
})), o), c = async (u, l) => {
|
|
3322
3323
|
var b, y, w, d;
|
|
3323
3324
|
(b = e.signal) == null || b.throwIfAborted();
|
|
3324
3325
|
const f = e.maxTextureSize ?? ((y = e.renderer.capabilities) == null ? void 0 : y.maxTextureSize) ?? 0;
|
|
3325
3326
|
if (f > 0) {
|
|
3326
3327
|
let m = n.get(u);
|
|
3327
|
-
m || (m =
|
|
3328
|
+
m || (m = Yc(u, e.signal), n.set(u, m));
|
|
3328
3329
|
const p = await m;
|
|
3329
3330
|
if ((w = e.signal) == null || w.throwIfAborted(), p && Math.max(p.width, p.height) > f)
|
|
3330
3331
|
throw new kr(
|
|
@@ -3364,7 +3365,7 @@ class kr extends Error {
|
|
|
3364
3365
|
this.url = n, this.width = s, this.height = o, this.maxTextureSize = r, this.name = "UsdKtx2TextureLimitError";
|
|
3365
3366
|
}
|
|
3366
3367
|
}
|
|
3367
|
-
async function
|
|
3368
|
+
async function Yc(e, t) {
|
|
3368
3369
|
let n;
|
|
3369
3370
|
try {
|
|
3370
3371
|
n = await fetch(e, { signal: t });
|
|
@@ -3390,14 +3391,14 @@ async function Hc(e, t) {
|
|
|
3390
3391
|
let a = 0;
|
|
3391
3392
|
for (const u of o)
|
|
3392
3393
|
i.set(u, a), a += u.length;
|
|
3393
|
-
if (!
|
|
3394
|
+
if (!Kc.every((u, l) => i[l] === u)) return null;
|
|
3394
3395
|
const c = new DataView(i.buffer, i.byteOffset, i.byteLength);
|
|
3395
3396
|
return {
|
|
3396
3397
|
width: c.getUint32(20, !0),
|
|
3397
3398
|
height: c.getUint32(24, !0)
|
|
3398
3399
|
};
|
|
3399
3400
|
}
|
|
3400
|
-
const yo = 80,
|
|
3401
|
+
const yo = 80, Kc = new Uint8Array([
|
|
3401
3402
|
171,
|
|
3402
3403
|
75,
|
|
3403
3404
|
84,
|
|
@@ -3411,9 +3412,6 @@ const yo = 80, Yc = new Uint8Array([
|
|
|
3411
3412
|
26,
|
|
3412
3413
|
10
|
|
3413
3414
|
]);
|
|
3414
|
-
function Kc() {
|
|
3415
|
-
return typeof document > "u" ? "basis/" : new URL("/basis/", document.baseURI).href;
|
|
3416
|
-
}
|
|
3417
3415
|
function Lr() {
|
|
3418
3416
|
return Object.assign(new Error("USD texture loading aborted."), {
|
|
3419
3417
|
name: "AbortError",
|
|
@@ -4087,10 +4085,10 @@ async function hu(e, t) {
|
|
|
4087
4085
|
To(e.scene), gu(e.scene), Ao(e.scene);
|
|
4088
4086
|
const n = /* @__PURE__ */ new Set();
|
|
4089
4087
|
for (const m of e.data.materials) {
|
|
4090
|
-
const p = await
|
|
4088
|
+
const p = await Cc(e, m);
|
|
4091
4089
|
p && (m.shaders = p.shaders, e.index.materialsByPath.set(m.path, m), n.add(m.path));
|
|
4092
4090
|
}
|
|
4093
|
-
const s = await
|
|
4091
|
+
const s = await Oc(e, {
|
|
4094
4092
|
isSupported: Vu
|
|
4095
4093
|
}), o = (m) => {
|
|
4096
4094
|
var p, g;
|
|
@@ -4168,7 +4166,7 @@ async function hu(e, t) {
|
|
|
4168
4166
|
if (m instanceof Ce) for (const p of Array.isArray(m.material) ? m.material : [m.material]) c.delete(p);
|
|
4169
4167
|
});
|
|
4170
4168
|
for (const m of c) m.dispose();
|
|
4171
|
-
await
|
|
4169
|
+
await Fc(e, t.diagnostics, (m) => {
|
|
4172
4170
|
const p = e.index.materialsByPath.get(m);
|
|
4173
4171
|
if (!p || !rl(p)) return !1;
|
|
4174
4172
|
const g = p && Ro(p, o(m));
|
|
@@ -4186,7 +4184,7 @@ async function hu(e, t) {
|
|
|
4186
4184
|
for (const x of p) x.userData.usdMaterialIR = I;
|
|
4187
4185
|
const U = I.issues.map((x) => `${x.code}:${x.sourcePath}`), D = Ue(p.flatMap((x) => wn(x.userData.usdMaterialDiagnostics))), A = ct(v.userData.usdSurfaceShaderId), k = I.surfacePath ? I.surfaceShaderId ?? "" : A;
|
|
4188
4186
|
if (k && (jn.test(k) || Wr.test(k))) {
|
|
4189
|
-
const x = I.surfacePath ? g.shaders.find((z) => z.path === I.surfacePath) ?? null : null, F = !!(x && xn(x)), ie = !!(x && gs(x)), H = !!(x && vn(x)), fe = (S == null ? void 0 : S.terminals.map((z) => z.shader).find((z) => !!(z && xn(z)))) ?? (F ? x : null), we = ie ? x : null, oe = we ?
|
|
4187
|
+
const x = I.surfacePath ? g.shaders.find((z) => z.path === I.surfacePath) ?? null : null, F = !!(x && xn(x)), ie = !!(x && gs(x)), H = !!(x && vn(x)), fe = (S == null ? void 0 : S.terminals.map((z) => z.shader).find((z) => !!(z && xn(z)))) ?? (F ? x : null), we = ie ? x : null, oe = we ? Ec(
|
|
4190
4188
|
g,
|
|
4191
4189
|
we,
|
|
4192
4190
|
fe,
|
|
@@ -4195,7 +4193,7 @@ async function hu(e, t) {
|
|
|
4195
4193
|
(z, Fe, $e) => $e.findIndex((Xe) => Xe.surfacePath === z.surfacePath) === Fe
|
|
4196
4194
|
);
|
|
4197
4195
|
if ((oe != null && oe.needsPhysical || ku(j)) && vt(e, p), oe) {
|
|
4198
|
-
|
|
4196
|
+
$c(
|
|
4199
4197
|
p.filter(de),
|
|
4200
4198
|
oe
|
|
4201
4199
|
);
|
|
@@ -4688,7 +4686,7 @@ async function hu(e, t) {
|
|
|
4688
4686
|
loaderDiagnostics: D
|
|
4689
4687
|
});
|
|
4690
4688
|
}
|
|
4691
|
-
|
|
4689
|
+
$a(e), Pa(e);
|
|
4692
4690
|
const _ = nu(
|
|
4693
4691
|
e.scene,
|
|
4694
4692
|
t.metersPerUnit ?? 1
|
|
@@ -8065,7 +8063,7 @@ const Fo = /* @__PURE__ */ new Map();
|
|
|
8065
8063
|
function kl(e, t, n) {
|
|
8066
8064
|
const s = sr(e, t), o = s.moduleUrl;
|
|
8067
8065
|
let r = Fo.get(o);
|
|
8068
|
-
return r || (r =
|
|
8066
|
+
return r || (r = va({ ...s, wasmModule: n }), Fo.set(o, r)), r;
|
|
8069
8067
|
}
|
|
8070
8068
|
function In(e, t, n) {
|
|
8071
8069
|
for (const s of [t.resolvedPath, t.path, t.url]) {
|
|
@@ -8225,7 +8223,7 @@ function Ql(e, t) {
|
|
|
8225
8223
|
}
|
|
8226
8224
|
};
|
|
8227
8225
|
}
|
|
8228
|
-
async function
|
|
8226
|
+
async function Ap(e, t, n) {
|
|
8229
8227
|
var oe, K, te;
|
|
8230
8228
|
const s = n.hasLocalFiles(), o = e.entryPath ?? e.filename ?? "asset.usd", r = s ? o : await _p(e, o), i = s ? Promise.resolve(n.getBlob(o)) : gp(e), a = o.split("/").pop() || "asset.usd", c = o.split("/").slice(0, -1).join("/"), u = t.options.usdExternalReferenceMode ?? "package", l = t.options.usdVariantSelections, f = t.options.usdVariantSelectionMode === "auto-mujoco", _ = new URL(r, "file:///"), h = qi(), b = new AbortController(), y = () => b.abort();
|
|
8231
8229
|
t.signal.addEventListener("abort", y, { once: !0 }), t.signal.aborted && b.abort();
|
|
@@ -8276,7 +8274,7 @@ async function Tp(e, t, n) {
|
|
|
8276
8274
|
return null;
|
|
8277
8275
|
}, M = () => {
|
|
8278
8276
|
O ? O.request() : t.requestRender();
|
|
8279
|
-
}, se = new
|
|
8277
|
+
}, se = new zc(), R = jc({
|
|
8280
8278
|
requestRender: M,
|
|
8281
8279
|
resolveSourcePath: Y,
|
|
8282
8280
|
signal: b.signal,
|
|
@@ -8388,7 +8386,7 @@ async function Tp(e, t, n) {
|
|
|
8388
8386
|
);
|
|
8389
8387
|
return;
|
|
8390
8388
|
}
|
|
8391
|
-
if (S =
|
|
8389
|
+
if (S = Gc(
|
|
8392
8390
|
(Ne = t.getRenderer) == null ? void 0 : Ne.call(t),
|
|
8393
8391
|
b.signal
|
|
8394
8392
|
), O = Ql(
|
|
@@ -8427,7 +8425,7 @@ async function Tp(e, t, n) {
|
|
|
8427
8425
|
onReferenceSkipped: d,
|
|
8428
8426
|
onResourceFailed: g
|
|
8429
8427
|
}),
|
|
8430
|
-
De.then(
|
|
8428
|
+
De.then(ca)
|
|
8431
8429
|
]);
|
|
8432
8430
|
I = ge, F = ke, ie = ge.textureURLs, await Ae(ge.data, ie);
|
|
8433
8431
|
const He = () => Qi(
|
|
@@ -8470,7 +8468,7 @@ async function Tp(e, t, n) {
|
|
|
8470
8468
|
}
|
|
8471
8469
|
}, t.signal.aborted) throw xt();
|
|
8472
8470
|
const he = await dp(C);
|
|
8473
|
-
C.scene.scale.multiplyScalar(he.metersPerUnit), C.data.stage.upAxis.toUpperCase() === "Y" && C.scene.quaternion.setFromAxisAngle(new J(1, 0, 0), Math.PI / 2), C.scene.updateMatrixWorld(!0), tp(C),
|
|
8471
|
+
C.scene.scale.multiplyScalar(he.metersPerUnit), C.data.stage.upAxis.toUpperCase() === "Y" && C.scene.quaternion.setFromAxisAngle(new J(1, 0, 0), Math.PI / 2), C.scene.updateMatrixWorld(!0), tp(C), sa(C);
|
|
8474
8472
|
let V = !1;
|
|
8475
8473
|
const _e = () => {
|
|
8476
8474
|
v && (O == null || O.request());
|
|
@@ -8523,7 +8521,7 @@ async function Tp(e, t, n) {
|
|
|
8523
8521
|
throw Object.assign(new Error("USD KTX2 texture loading requires an initialized WebGL renderer."), {
|
|
8524
8522
|
code: "E_USD_KTX2_RENDERER_UNAVAILABLE"
|
|
8525
8523
|
});
|
|
8526
|
-
Q ?? (Q =
|
|
8524
|
+
Q ?? (Q = Hc({
|
|
8527
8525
|
renderer: dt,
|
|
8528
8526
|
transcoderPath: t.options.ktx2TranscoderPath,
|
|
8529
8527
|
signal: b.signal
|
|
@@ -8615,7 +8613,7 @@ async function Tp(e, t, n) {
|
|
|
8615
8613
|
for (const Ie of qe.approximations)
|
|
8616
8614
|
h.approximations.push({ ...Ie, source: "usd-physics" });
|
|
8617
8615
|
(zs = lt.massOverrides) != null && zs.length && h.approximations.push({ code: "USD_INFERRED_INERTIA", message: "保留显式总质量;惯量按碰撞几何的密度分布推导并同比缩放,重叠体积会重复计入。", source: "usd-physics" });
|
|
8618
|
-
const { MujocoRuntime: q } = await import("./mujoco-runtime-
|
|
8616
|
+
const { MujocoRuntime: q } = await import("./mujoco-runtime-CFQQsRmc.js");
|
|
8619
8617
|
ee = new q(), await ee.initialize(lt, {
|
|
8620
8618
|
baseUrl: t.options.mujocoBaseUrl,
|
|
8621
8619
|
wasmModule: t.options.mujocoWasmModule
|
|
@@ -8843,7 +8841,7 @@ const sp = /* @__PURE__ */ new Set([
|
|
|
8843
8841
|
"E_USD_CONSTRAINED_INITIAL_VELOCITY",
|
|
8844
8842
|
"E_USD_UNSUPPORTED_APPROXIMATION"
|
|
8845
8843
|
]);
|
|
8846
|
-
function
|
|
8844
|
+
function Op(e) {
|
|
8847
8845
|
const t = op(e);
|
|
8848
8846
|
return t !== null && sp.has(t);
|
|
8849
8847
|
}
|
|
@@ -9340,7 +9338,7 @@ function Is(e, t, n) {
|
|
|
9340
9338
|
a.delete(), i.delete(), r.delete(), o.delete();
|
|
9341
9339
|
}
|
|
9342
9340
|
}
|
|
9343
|
-
function
|
|
9341
|
+
function Np(e, t, n) {
|
|
9344
9342
|
var i, a;
|
|
9345
9343
|
const s = new Map(t.map((c) => [c.path, c])), o = /* @__PURE__ */ new Map(), r = e.stage;
|
|
9346
9344
|
if (!r || !((a = (i = e.pxr) == null ? void 0 : i.Sdf) != null && a.Path)) return o;
|
|
@@ -9621,11 +9619,11 @@ export {
|
|
|
9621
9619
|
Vo as estimateUsdVisualWorkload,
|
|
9622
9620
|
Wo as firstUsdVisualWarning,
|
|
9623
9621
|
ts as hasUsdCollisionGeometry,
|
|
9624
|
-
|
|
9625
|
-
|
|
9622
|
+
Op as isUsdPhysicsFallbackEligible,
|
|
9623
|
+
Ap as loadUsdSimulation,
|
|
9626
9624
|
li as parseUsdReferenceMetadata,
|
|
9627
9625
|
Zl as probeUsdRemoteTextureBytes,
|
|
9628
|
-
|
|
9626
|
+
Np as readUsdMimicRelations,
|
|
9629
9627
|
Xl as readUsdTextureNetworkProfile,
|
|
9630
9628
|
In as resolvePackageTexture,
|
|
9631
9629
|
fi as resolveUsdJoints,
|