@nebula-spatial/studio 0.1.1 → 0.1.2
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 +2 -0
- package/dist/{builders-BAXRR5o5.js → builders-lydx4-Rh.js} +1 -1
- package/dist/core/session-persistence-controller.d.ts +55 -0
- package/dist/doc/placement-policy.d.ts +4 -0
- package/dist/editor/editor.d.ts +3 -1
- package/dist/editor/index.d.ts +2 -0
- package/dist/editor/session-persistence.d.ts +54 -0
- package/dist/editor.js +727 -490
- package/dist/{export-evidence-DMNRhgL9.js → export-evidence-z2Ne7Trf.js} +654 -972
- package/dist/generalization.js +2 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +226 -219
- package/dist/{mjcf-visual-Bt4bUxd1.js → mjcf-visual-IOy-ucto.js} +1 -1
- package/dist/persist/indexeddb-store.d.ts +22 -2
- package/dist/persist/session.d.ts +22 -0
- package/dist/persist/snapshot.d.ts +24 -0
- package/dist/{physics-facts-tfQYyNTD.js → physics-facts-D-URIBrt.js} +8 -7
- package/dist/{placement-policy-DY_FNRDu.js → placement-policy-C6dV6Tf-.js} +161 -141
- package/dist/ports/persistence.d.ts +45 -1
- package/dist/project/contracts.d.ts +3 -0
- package/dist/remote-asset-resolver-D-UeyDMD.js +311 -0
- package/dist/{scene-graph-DBLKAhxa.js → scene-graph-DVOXjMmp.js} +2 -2
- package/dist/{scene-session-Cy6vDJ1l.js → scene-session-PhoFXFCY.js} +3365 -3340
- package/dist/scene.js +2 -2
- package/dist/{session-BRBrCLdd.js → session-2bp8YOA4.js} +2 -2
- package/dist/{session-q3uuG7OP.js → session-B3WbC7Y2.js} +1 -1
- package/dist/session-B9kEf4xN.js +915 -0
- package/dist/{session-DI5tPJxn.js → session-DYThdzLZ.js} +4 -4
- package/dist/studio/index.d.ts +5 -0
- package/dist/studio/indexeddb-persistence.d.ts +2 -0
- package/dist/studio/indexeddb-session-persistence.d.ts +11 -0
- package/dist/studio/scene-package-asset-sources.d.ts +14 -0
- package/dist/studio.js +1422 -1220
- package/dist/{urdf-session-CQir2nb2.js → urdf-session-CRXL4bHf.js} +3 -3
- package/dist/{usd-session-DZJnEEOs.js → usd-session-CTzInpNy.js} +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/view/scene-session.d.ts +5 -1
- package/dist/{xacro-DLRXyk60.js → xacro-IpPHTMYs.js} +1 -1
- package/package.json +1 -1
- package/dist/asset-source-BExlEcRt.js +0 -444
- package/dist/editorial-BkAFWfbg.js +0 -83
- package/dist/remote-asset-resolver-Cb8cfNmw.js +0 -136
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { W as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
1
|
+
var st = Object.defineProperty;
|
|
2
|
+
var rt = (e, t, s) => t in e ? st(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var T = (e, t, s) => rt(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { W as ot, s as N, e as q, g as U, X as w, a4 as J, a3 as O } from "./builders-lydx4-Rh.js";
|
|
5
|
+
import { n as $, a as m, b as Ce, m as nt, P as at, A as it, Q as ct, r as lt, O as F } from "./session-B9kEf4xN.js";
|
|
6
|
+
import { d as V, Y as dt, u as ut, E as ft } from "./scene-graph-DVOXjMmp.js";
|
|
7
|
+
function pt(e) {
|
|
8
8
|
const t = [...e.resources].map((i) => ({
|
|
9
9
|
...i,
|
|
10
|
-
locator:
|
|
10
|
+
locator: $(i.locator)
|
|
11
11
|
})).sort((i, l) => m(i.locator).localeCompare(m(l.locator)) || i.resourceId.localeCompare(l.resourceId)), s = /* @__PURE__ */ new Map();
|
|
12
12
|
for (const i of e.variantSets ?? []) {
|
|
13
13
|
const l = s.get(i.name);
|
|
@@ -36,10 +36,10 @@ function Rt(e) {
|
|
|
36
36
|
capabilities: e.capabilities,
|
|
37
37
|
...e.bounds ? { bounds: e.bounds } : {},
|
|
38
38
|
...e.category ? { category: e.category } : {},
|
|
39
|
-
...e.hints ? { hints:
|
|
39
|
+
...e.hints ? { hints: mt(e.hints) } : {},
|
|
40
40
|
...e.metrics ? { metrics: e.metrics } : {},
|
|
41
41
|
...e.semantic ? { semantic: e.semantic } : {}
|
|
42
|
-
}, n =
|
|
42
|
+
}, n = ot(o);
|
|
43
43
|
return {
|
|
44
44
|
revisionId: `rev_${n.slice(0, 24)}`,
|
|
45
45
|
...o,
|
|
@@ -47,19 +47,19 @@ function Rt(e) {
|
|
|
47
47
|
provenance: e.provenance ?? { source: "user", repairs: [] }
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function zs(e) {
|
|
51
51
|
const t = e.resources.find((s) => s.resourceId === e.entryResourceId);
|
|
52
52
|
if (!t) throw new Error(`Asset revision ${e.revisionId} has no entry resource.`);
|
|
53
53
|
return t;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Vs(e, t) {
|
|
56
56
|
const s = m(t);
|
|
57
57
|
return e.resources.find((r) => m(r.locator) === s) ?? null;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Fs(e) {
|
|
60
60
|
return e.resources.map((t) => m(t.locator));
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function Bs(e) {
|
|
63
63
|
if (e.variantSets.length === 0) return null;
|
|
64
64
|
const t = {};
|
|
65
65
|
for (const s of e.variantSets) {
|
|
@@ -68,10 +68,10 @@ function ur(e) {
|
|
|
68
68
|
}
|
|
69
69
|
return Object.keys(t).length > 0 ? t : null;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function js(e) {
|
|
72
72
|
return e.layout === "glb" || e.fileKind === "glb";
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function mt(e) {
|
|
75
75
|
return {
|
|
76
76
|
...e.approximateSize ? { approximateSize: e.approximateSize } : {},
|
|
77
77
|
...e.defaultRole ? { defaultRole: e.defaultRole } : {},
|
|
@@ -80,22 +80,22 @@ function _t(e) {
|
|
|
80
80
|
...e.tags ? { tags: [...new Set(e.tags)].sort() } : {}
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function k(e) {
|
|
84
84
|
return e.kind === "package-path" ? e.path : e.url;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function ht(e) {
|
|
87
|
+
return k(e.entryLocator);
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
function
|
|
89
|
+
const yt = [".mdl"];
|
|
90
|
+
function xe(e) {
|
|
91
91
|
const t = e.split(/[?#]/, 1)[0] ?? e;
|
|
92
|
-
return
|
|
92
|
+
return yt.some((s) => t.toLowerCase().endsWith(s));
|
|
93
93
|
}
|
|
94
|
-
const
|
|
95
|
-
function
|
|
94
|
+
const ce = /@(?<target>[^@\r\n]+)@(?:\s*<(?<prim>[^>]*)>)?/g, Le = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;
|
|
95
|
+
function de(e, t) {
|
|
96
96
|
const s = [], r = [];
|
|
97
97
|
for (const n of [...e].sort((i, l) => i.path.localeCompare(l.path))) {
|
|
98
|
-
const i =
|
|
98
|
+
const i = gt(n.path, n.text, t);
|
|
99
99
|
i.length > 0 && r.push(n.path), s.push(...i);
|
|
100
100
|
}
|
|
101
101
|
s.sort((n, i) => n.fromPath.localeCompare(i.fromPath) || n.target.localeCompare(i.target));
|
|
@@ -109,20 +109,20 @@ function he(e, t) {
|
|
|
109
109
|
layers: r
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const s = t.map(
|
|
114
|
-
|
|
112
|
+
function Ks(e, t) {
|
|
113
|
+
const s = t.map($), r = new Set(s.map(m)), o = [], n = [], i = [...e].sort((d, c) => k(d.locator).localeCompare(
|
|
114
|
+
k(c.locator)
|
|
115
115
|
));
|
|
116
|
-
for (const
|
|
117
|
-
const c =
|
|
118
|
-
for (const f of
|
|
119
|
-
const g =
|
|
116
|
+
for (const d of i) {
|
|
117
|
+
const c = $(d.locator), u = k(c), a = [];
|
|
118
|
+
for (const f of Oe(d.text)) {
|
|
119
|
+
const g = xe(f.target) ? "material-module" : "asset", h = Ce(
|
|
120
120
|
c,
|
|
121
121
|
f.target,
|
|
122
122
|
s
|
|
123
|
-
), p = h && r.has(m(h)) ?
|
|
123
|
+
), p = h && r.has(m(h)) ? k(h) : null, I = g === "asset" && h === null && Le.test(f.target);
|
|
124
124
|
a.push({
|
|
125
|
-
fromPath:
|
|
125
|
+
fromPath: u,
|
|
126
126
|
target: f.target,
|
|
127
127
|
resolvedPath: p,
|
|
128
128
|
external: I,
|
|
@@ -131,61 +131,61 @@ function fr(e, t) {
|
|
|
131
131
|
kind: g
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
a.length > 0 && n.push(
|
|
134
|
+
a.length > 0 && n.push(u), o.push(...a);
|
|
135
135
|
}
|
|
136
|
-
o.sort((
|
|
137
|
-
const l = o.filter((
|
|
136
|
+
o.sort((d, c) => d.fromPath.localeCompare(c.fromPath) || d.target.localeCompare(c.target));
|
|
137
|
+
const l = o.filter((d) => d.kind === "asset");
|
|
138
138
|
return {
|
|
139
139
|
references: o,
|
|
140
|
-
missing: l.filter((
|
|
141
|
-
external: l.filter((
|
|
142
|
-
unanchored: l.filter((
|
|
143
|
-
materialModules: o.filter((
|
|
140
|
+
missing: l.filter((d) => !d.external && d.resolvedPath === null),
|
|
141
|
+
external: l.filter((d) => d.external),
|
|
142
|
+
unanchored: l.filter((d) => !d.external && !d.anchored),
|
|
143
|
+
materialModules: o.filter((d) => d.kind === "material-module"),
|
|
144
144
|
layers: n
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function gt(e, t, s) {
|
|
148
148
|
const r = [];
|
|
149
|
-
for (const o of
|
|
150
|
-
const { target: n } = o, i =
|
|
149
|
+
for (const o of Oe(t)) {
|
|
150
|
+
const { target: n } = o, i = Le.test(n), l = xe(n) ? "material-module" : "asset", d = n.startsWith("./") || n.startsWith("../"), c = i ? null : It(e, n, s);
|
|
151
151
|
r.push({
|
|
152
152
|
fromPath: e,
|
|
153
153
|
target: n,
|
|
154
154
|
resolvedPath: c,
|
|
155
155
|
external: i,
|
|
156
|
-
anchored:
|
|
156
|
+
anchored: d,
|
|
157
157
|
primPath: o.primPath,
|
|
158
158
|
kind: l
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
return r;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Oe(e) {
|
|
164
164
|
var r, o, n, i;
|
|
165
165
|
const t = [], s = /* @__PURE__ */ new Set();
|
|
166
|
-
|
|
167
|
-
for (let l =
|
|
168
|
-
const
|
|
169
|
-
if (!
|
|
170
|
-
const c = ((i = (n = l.groups) == null ? void 0 : n.prim) == null ? void 0 : i.trim()) || null,
|
|
171
|
-
s.has(
|
|
166
|
+
ce.lastIndex = 0;
|
|
167
|
+
for (let l = ce.exec(e); l !== null; l = ce.exec(e)) {
|
|
168
|
+
const d = ((o = (r = l.groups) == null ? void 0 : r.target) == null ? void 0 : o.trim()) ?? "";
|
|
169
|
+
if (!d) continue;
|
|
170
|
+
const c = ((i = (n = l.groups) == null ? void 0 : n.prim) == null ? void 0 : i.trim()) || null, u = `${d}\0${c ?? ""}`;
|
|
171
|
+
s.has(u) || (s.add(u), t.push({ target: d, primPath: c }));
|
|
172
172
|
}
|
|
173
173
|
return t;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function It(e, t, s) {
|
|
176
176
|
if (t.startsWith("/")) {
|
|
177
|
-
const o =
|
|
177
|
+
const o = Q(t.slice(1));
|
|
178
178
|
return s.has(o) ? o : null;
|
|
179
179
|
}
|
|
180
180
|
const r = e.split("/");
|
|
181
181
|
r.pop();
|
|
182
182
|
for (let o = r.length; o >= 0; o -= 1) {
|
|
183
|
-
const n = r.slice(0, o).join("/"), i =
|
|
183
|
+
const n = r.slice(0, o).join("/"), i = Q(n ? `${n}/${t}` : t);
|
|
184
184
|
if (s.has(i)) return i;
|
|
185
185
|
}
|
|
186
186
|
return null;
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function Q(e) {
|
|
189
189
|
const t = [];
|
|
190
190
|
for (const s of e.replace(/\\/g, "/").split("/"))
|
|
191
191
|
if (!(!s || s === ".")) {
|
|
@@ -197,23 +197,23 @@ function oe(e) {
|
|
|
197
197
|
}
|
|
198
198
|
return t.join("/");
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Me(e) {
|
|
201
201
|
return e.toLowerCase().endsWith(".usda");
|
|
202
202
|
}
|
|
203
|
-
const
|
|
204
|
-
function
|
|
205
|
-
if (!t || t.byteLength === 0) return
|
|
203
|
+
const vt = "#usda", St = ["PXR-USDC", "PXR-USDA"];
|
|
204
|
+
function pe(e, t) {
|
|
205
|
+
if (!t || t.byteLength === 0) return Me(e);
|
|
206
206
|
if (e.toLowerCase().endsWith(".usdc")) return !1;
|
|
207
207
|
const s = new TextDecoder("utf-8", { fatal: !1 }).decode(t.subarray(0, 16));
|
|
208
|
-
return
|
|
208
|
+
return St.some((r) => s.startsWith(r)) ? !1 : s.trimStart().startsWith(vt);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
const t =
|
|
210
|
+
function Ys(e) {
|
|
211
|
+
const t = Mt(e), s = t ? ee(t, "customLayerData") : null, r = s ? ee(s, "SimReady_Metadata") : null, o = b(t, "defaultPrim"), n = At(e, o);
|
|
212
212
|
return {
|
|
213
213
|
creator: b(t, "creator"),
|
|
214
|
-
startTimeCode:
|
|
215
|
-
endTimeCode:
|
|
216
|
-
timeCodesPerSecond:
|
|
214
|
+
startTimeCode: Y(t, "startTimeCode"),
|
|
215
|
+
endTimeCode: Y(t, "endTimeCode"),
|
|
216
|
+
timeCodesPerSecond: Y(t, "timeCodesPerSecond"),
|
|
217
217
|
rootPrim: n,
|
|
218
218
|
simReady: r || s ? {
|
|
219
219
|
assetName: b(r, "asset_name") ?? b(s, "asset_name"),
|
|
@@ -224,46 +224,46 @@ function pr(e) {
|
|
|
224
224
|
sourceFile: b(r, "source_file") ?? b(s, "source_file"),
|
|
225
225
|
generatedDate: b(r, "usd_date_generated") ?? b(s, "usd_date_generated"),
|
|
226
226
|
qcode: b(r, "qcode"),
|
|
227
|
-
mass:
|
|
228
|
-
extents:
|
|
229
|
-
rigidBodyCount:
|
|
230
|
-
validation:
|
|
227
|
+
mass: Y(r, "mass"),
|
|
228
|
+
extents: zt(r, "asset_extents"),
|
|
229
|
+
rigidBodyCount: Ut(r, "rigid_body_count"),
|
|
230
|
+
validation: Ot(r)
|
|
231
231
|
} : null,
|
|
232
|
-
variantSets:
|
|
232
|
+
variantSets: bt(e)
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
async function
|
|
235
|
+
async function Ws(e) {
|
|
236
236
|
const t = e.find((a) => L(a.path).endsWith("/com.nvidia.simready.packaging.json") || L(a.path) === "com.nvidia.simready.packaging.json"), s = e.find((a) => /(?:^|\/)[^/]+_validation\.json$/i.test(L(a.path))), r = e.find((a) => /(?:^|\/)[^/]+_benchmark\.json$/i.test(L(a.path))), o = e.find((a) => L(a.path).endsWith("/com.nvidia.simready.packaging.bom.json") || L(a.path) === "com.nvidia.simready.packaging.bom.json");
|
|
237
237
|
if (!t && !s && !r) return null;
|
|
238
|
-
const [n, i, l,
|
|
239
|
-
t ?
|
|
240
|
-
s ?
|
|
241
|
-
r ?
|
|
242
|
-
o ?
|
|
243
|
-
]), c = Array.isArray(S(
|
|
238
|
+
const [n, i, l, d] = await Promise.all([
|
|
239
|
+
t ? H(t.blob) : null,
|
|
240
|
+
s ? H(s.blob) : null,
|
|
241
|
+
r ? H(r.blob) : null,
|
|
242
|
+
o ? H(o.blob) : null
|
|
243
|
+
]), c = Array.isArray(S(d, "items")) ? S(d, "items").filter(P) : [], u = Array.isArray(S(n, "metadata")) ? S(n, "metadata").filter(P) : [];
|
|
244
244
|
return {
|
|
245
|
-
formatVersion:
|
|
246
|
-
bomFormatVersion:
|
|
247
|
-
packageId:
|
|
248
|
-
license:
|
|
249
|
-
contentSha256:
|
|
250
|
-
packageSha256:
|
|
251
|
-
metadataFileCount:
|
|
252
|
-
metadataNames:
|
|
245
|
+
formatVersion: A(S(n, "format_version")),
|
|
246
|
+
bomFormatVersion: A(S(d, "format_version")),
|
|
247
|
+
packageId: A(S(n, "package_id")),
|
|
248
|
+
license: A(S(n, "license")),
|
|
249
|
+
contentSha256: A(S(S(n, "content_hash"), "sha256")),
|
|
250
|
+
packageSha256: A(S(S(n, "package_hash"), "sha256")),
|
|
251
|
+
metadataFileCount: u.length,
|
|
252
|
+
metadataNames: u.map((a) => A(S(a, "name"))).filter((a) => !!a),
|
|
253
253
|
loadedFileCount: e.length,
|
|
254
254
|
loadedTotalBytes: e.reduce((a, f) => a + f.blob.size, 0),
|
|
255
255
|
bomFileCount: c.length,
|
|
256
|
-
bomTotalBytes: c.reduce((a, f) => a + (
|
|
257
|
-
validation:
|
|
258
|
-
benchmark:
|
|
256
|
+
bomTotalBytes: c.reduce((a, f) => a + (Vt(S(f, "size")) ?? 0), 0),
|
|
257
|
+
validation: xt(i),
|
|
258
|
+
benchmark: Lt(l)
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
async function
|
|
261
|
+
async function Gs(e) {
|
|
262
262
|
const t = [];
|
|
263
263
|
for (const a of e) {
|
|
264
264
|
if (!/\.(?:usda|usd)$/i.test(a.path)) continue;
|
|
265
265
|
const f = new Uint8Array(await a.blob.arrayBuffer());
|
|
266
|
-
|
|
266
|
+
pe(a.path, f) && t.push({
|
|
267
267
|
path: L(a.path),
|
|
268
268
|
text: new TextDecoder("utf-8").decode(f)
|
|
269
269
|
});
|
|
@@ -272,9 +272,9 @@ async function hr(e) {
|
|
|
272
272
|
const s = /* @__PURE__ */ new Map();
|
|
273
273
|
let r = 0;
|
|
274
274
|
for (const a of t)
|
|
275
|
-
for (const f of
|
|
275
|
+
for (const f of Rt(a.text)) {
|
|
276
276
|
r += 1;
|
|
277
|
-
const g =
|
|
277
|
+
const g = _t(f.header), h = Pt(f.source), p = s.get(f.path) ?? {
|
|
278
278
|
path: f.path,
|
|
279
279
|
typeName: f.typeName,
|
|
280
280
|
layers: /* @__PURE__ */ new Set(),
|
|
@@ -286,8 +286,8 @@ async function hr(e) {
|
|
|
286
286
|
p.typeName === "unknown" && f.typeName !== "unknown" && (p.typeName = f.typeName), p.layers.add(a.path);
|
|
287
287
|
for (const I of g) p.apiSchemas.add(I);
|
|
288
288
|
for (const I of h) {
|
|
289
|
-
const
|
|
290
|
-
|
|
289
|
+
const R = p.properties.get(I.name) ?? /* @__PURE__ */ new Map(), _ = R.get(I.value) ?? /* @__PURE__ */ new Set();
|
|
290
|
+
_.add(a.path), R.set(I.value, _), p.properties.set(I.name, R);
|
|
291
291
|
}
|
|
292
292
|
p.hasDriveAttributes || (p.hasDriveAttributes = h.some((I) => I.name.startsWith("drive:"))), p.hasMimicAttributes || (p.hasMimicAttributes = h.some((I) => /mimic/i.test(I.name))), s.set(f.path, p);
|
|
293
293
|
}
|
|
@@ -295,7 +295,7 @@ async function hr(e) {
|
|
|
295
295
|
path: a.path,
|
|
296
296
|
typeName: a.typeName,
|
|
297
297
|
layers: [...a.layers].sort(),
|
|
298
|
-
apiSchemas: [...a.apiSchemas].filter(
|
|
298
|
+
apiSchemas: [...a.apiSchemas].filter(Dt).sort(),
|
|
299
299
|
properties: [...a.properties.entries()].map(([f, g]) => ({
|
|
300
300
|
name: f,
|
|
301
301
|
values: [...g.entries()].map(([h, p]) => ({
|
|
@@ -305,23 +305,23 @@ async function hr(e) {
|
|
|
305
305
|
})).sort((f, g) => f.name.localeCompare(g.name)),
|
|
306
306
|
hasDriveAttributes: a.hasDriveAttributes,
|
|
307
307
|
hasMimicAttributes: a.hasMimicAttributes
|
|
308
|
-
})).filter((a) => a.apiSchemas.length > 0 ||
|
|
308
|
+
})).filter((a) => a.apiSchemas.length > 0 || _e(a) || a.typeName === "MjcActuator" || a.typeName === "PhysicsScene"), n = /* @__PURE__ */ new Map();
|
|
309
309
|
for (const a of o)
|
|
310
310
|
for (const f of a.apiSchemas)
|
|
311
311
|
n.set(f, (n.get(f) ?? 0) + 1);
|
|
312
|
-
const i = (a) => [...a].sort((f, g) => f.path.localeCompare(g.path)), l = o.filter((a) => a.apiSchemas.some(
|
|
312
|
+
const i = (a) => [...a].sort((f, g) => f.path.localeCompare(g.path)), l = o.filter((a) => a.apiSchemas.some(kt)), d = o.filter((a) => a.apiSchemas.some(Nt)), c = o.filter((a) => a.apiSchemas.some(Tt)), u = o.filter(_e);
|
|
313
313
|
return {
|
|
314
314
|
scannedLayerCount: t.length,
|
|
315
315
|
scannedLayers: t.map((a) => a.path).sort(),
|
|
316
316
|
scannedPrimCount: r,
|
|
317
317
|
physicsPrimCount: o.length,
|
|
318
318
|
apiSchemaCounts: [...n.entries()].map(([a, f]) => ({ schema: a, primCount: f })).sort((a, f) => f.primCount - a.primCount || a.schema.localeCompare(f.schema)),
|
|
319
|
-
colliderApproximationCounts:
|
|
319
|
+
colliderApproximationCounts: $t(l, "physics:approximation"),
|
|
320
320
|
physicsPrims: i(o),
|
|
321
|
-
rigidBodyPrims: i(
|
|
321
|
+
rigidBodyPrims: i(d),
|
|
322
322
|
colliderPrims: i(l),
|
|
323
323
|
articulationRootPrims: i(c),
|
|
324
|
-
jointPrims: i(
|
|
324
|
+
jointPrims: i(u),
|
|
325
325
|
massPrims: i(o.filter((a) => a.apiSchemas.some((f) => /^(?:Physics|Physx|Newton)MassAPI/.test(f)))),
|
|
326
326
|
materialPrims: i(o.filter((a) => a.apiSchemas.some((f) => /^PhysicsMaterialAPI/.test(f)))),
|
|
327
327
|
scenePrims: i(o.filter((a) => a.typeName === "PhysicsScene")),
|
|
@@ -330,61 +330,61 @@ async function hr(e) {
|
|
|
330
330
|
mimicPrimCount: o.filter((a) => a.hasMimicAttributes).length
|
|
331
331
|
};
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
const t =
|
|
333
|
+
function bt(e) {
|
|
334
|
+
const t = Ct(e), s = [], r = /\bvariantSet\s+"([^"]+)"\s*=\s*\{/g;
|
|
335
335
|
for (let o = r.exec(e); o; o = r.exec(e)) {
|
|
336
|
-
const n = o[1], i =
|
|
336
|
+
const n = o[1], i = te(e, e.indexOf("{", o.index));
|
|
337
337
|
if (!i) continue;
|
|
338
|
-
const l = [...i.matchAll(/^\s*"([^"]+)"(?:\s*\([^)]*\))?\s*\{/gm)].map((c) => c[1]).filter((c,
|
|
338
|
+
const l = [...i.matchAll(/^\s*"([^"]+)"(?:\s*\([^)]*\))?\s*\{/gm)].map((c) => c[1]).filter((c, u, a) => a.indexOf(c) === u);
|
|
339
339
|
if (!l.length) continue;
|
|
340
|
-
const
|
|
340
|
+
const d = t[n];
|
|
341
341
|
s.push({
|
|
342
342
|
name: n,
|
|
343
343
|
options: l,
|
|
344
|
-
...
|
|
344
|
+
...d && l.includes(d) ? { authoredDefault: d } : {}
|
|
345
345
|
}), r.lastIndex += i.length;
|
|
346
346
|
}
|
|
347
347
|
return s;
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
const s =
|
|
349
|
+
function At(e, t) {
|
|
350
|
+
const s = ze(e), o = [...e.slice((s == null ? void 0 : s.end) ?? 0).matchAll(
|
|
351
351
|
/^(?:def|over|class)\s+(?:([A-Za-z0-9_:]+)\s+)?"([^"]+)"/gm
|
|
352
352
|
)], n = t ? o.find((a) => a[2] === t) : o[0];
|
|
353
353
|
if (!n) return null;
|
|
354
|
-
const i = ((s == null ? void 0 : s.end) ?? 0) + n.index, l = e.indexOf("{", i),
|
|
354
|
+
const i = ((s == null ? void 0 : s.end) ?? 0) + n.index, l = e.indexOf("{", i), d = l >= 0 ? e.slice(i, l) : n[0], c = [...d.matchAll(/\bapiSchemas\s*=\s*\[([^\]]*)\]/g)].flatMap((a) => [...a[1].matchAll(/"([^"]+)"/g)].map((f) => f[1])), u = n[2];
|
|
355
355
|
return {
|
|
356
|
-
path: t ? `/${t.replace(/^\/+/, "")}` : `/${
|
|
357
|
-
name:
|
|
356
|
+
path: t ? `/${t.replace(/^\/+/, "")}` : `/${u}`,
|
|
357
|
+
name: u,
|
|
358
358
|
typeName: n[1] ?? "unknown",
|
|
359
|
-
kind: b(
|
|
359
|
+
kind: b(d, "kind"),
|
|
360
360
|
apiSchemas: [...new Set(c)].sort()
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Rt(e) {
|
|
364
364
|
const t = [], s = (r, o, n) => {
|
|
365
365
|
const i = /\b(?:def|over|class)\s+(?:([A-Za-z0-9_:]+)\s+)?"([^"]+)"/g;
|
|
366
366
|
for (i.lastIndex = r; i.lastIndex < o; ) {
|
|
367
367
|
const l = i.exec(e);
|
|
368
368
|
if (!l || l.index >= o) break;
|
|
369
|
-
const
|
|
370
|
-
if (
|
|
371
|
-
const c =
|
|
369
|
+
const d = Ue(e, i.lastIndex, o);
|
|
370
|
+
if (d < 0) continue;
|
|
371
|
+
const c = se(e, d, "{", "}");
|
|
372
372
|
if (c < 0) break;
|
|
373
|
-
const
|
|
373
|
+
const u = l[2], a = Et(n, u), f = e.slice(l.index, c + 1);
|
|
374
374
|
t.push({
|
|
375
375
|
path: a,
|
|
376
376
|
typeName: l[1] ?? "unknown",
|
|
377
|
-
header: e.slice(l.index,
|
|
377
|
+
header: e.slice(l.index, d),
|
|
378
378
|
source: f
|
|
379
|
-
}), s(
|
|
379
|
+
}), s(d + 1, c, a), i.lastIndex = c + 1;
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
return s(0, e.length, ""), t;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function Et(e, t) {
|
|
385
385
|
return t.startsWith("/") ? `/${t.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/")}` : `${e}/${t}`.replace(/\/+/g, "/");
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function Ue(e, t, s) {
|
|
388
388
|
let r = 0, o = !1, n = !1;
|
|
389
389
|
for (let i = t; i < s; i += 1) {
|
|
390
390
|
const l = e[i];
|
|
@@ -405,7 +405,7 @@ function Ge(e, t, s) {
|
|
|
405
405
|
}
|
|
406
406
|
return -1;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
408
|
+
function _t(e) {
|
|
409
409
|
const t = /* @__PURE__ */ new Set();
|
|
410
410
|
for (const s of e.matchAll(/\bapiSchemas\s*=\s*\[([^\]]*)\]/g)) {
|
|
411
411
|
const r = e.slice(Math.max(0, (s.index ?? 0) - 16), s.index);
|
|
@@ -417,15 +417,15 @@ function Lt(e) {
|
|
|
417
417
|
}
|
|
418
418
|
return [...t];
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
const t =
|
|
420
|
+
function Pt(e) {
|
|
421
|
+
const t = wt(e), s = [], r = /^\s*(?:(?:custom|uniform|varying|rel|append|prepend|delete)\s+)*(?:(?:[A-Za-z][A-Za-z0-9_:]*(?:\[\])?)\s+)?((?:physics|physx|newton|mjc|drive|state):[A-Za-z0-9_:]+)\s*=\s*(.+?)\s*$/gm;
|
|
422
422
|
for (const o of t.matchAll(r)) {
|
|
423
423
|
const n = o[1], i = o[2].replace(/\s+#.*$/, "").replace(/\s+/g, " ").trim();
|
|
424
424
|
i && s.push({ name: n, value: i });
|
|
425
425
|
}
|
|
426
426
|
return s;
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function wt(e) {
|
|
429
429
|
const t = e.indexOf("{"), s = e.lastIndexOf("}");
|
|
430
430
|
if (t < 0 || s <= t) return "";
|
|
431
431
|
let r = e.slice(t + 1, s);
|
|
@@ -433,15 +433,15 @@ function Ut(e) {
|
|
|
433
433
|
for (; o.lastIndex < r.length; ) {
|
|
434
434
|
const n = o.exec(r);
|
|
435
435
|
if (!n) break;
|
|
436
|
-
const i =
|
|
436
|
+
const i = Ue(r, o.lastIndex, r.length);
|
|
437
437
|
if (i < 0) break;
|
|
438
|
-
const l =
|
|
438
|
+
const l = se(r, i, "{", "}");
|
|
439
439
|
if (l < 0) break;
|
|
440
440
|
r = `${r.slice(0, n.index)}${" ".repeat(l - n.index + 1)}${r.slice(l + 1)}`, o.lastIndex = l + 1;
|
|
441
441
|
}
|
|
442
442
|
return r;
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function $t(e, t) {
|
|
445
445
|
const s = /* @__PURE__ */ new Map();
|
|
446
446
|
for (const r of e) {
|
|
447
447
|
const o = r.properties.find((n) => n.name === t);
|
|
@@ -451,62 +451,62 @@ function zt(e, t) {
|
|
|
451
451
|
}
|
|
452
452
|
return [...s.entries()].map(([r, o]) => ({ value: r, primCount: o })).sort((r, o) => o.primCount - r.primCount || r.value.localeCompare(o.value));
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Dt(e) {
|
|
455
455
|
return /(?:Physics|Physx|Newton|Mjc)/.test(e);
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function kt(e) {
|
|
458
458
|
return /^(?:PhysicsCollisionAPI|PhysxCollisionAPI|NewtonCollisionAPI|MjcCollisionAPI)/.test(e);
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Nt(e) {
|
|
461
461
|
return /^(?:PhysicsRigidBodyAPI|PhysxRigidBodyAPI|NewtonRigidBodyAPI)/.test(e);
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function Tt(e) {
|
|
464
464
|
return /^(?:PhysicsArticulationRootAPI|PhysxArticulationAPI|NewtonArticulationRootAPI)/.test(e);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function _e(e) {
|
|
467
467
|
return e.typeName.endsWith("Joint") || e.apiSchemas.some((t) => /^(?:MjcJointAPI|PhysicsJointStateAPI|PhysxJointStateAPI|NewtonJointStateAPI)/.test(t));
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Ct(e) {
|
|
470
470
|
const t = /\bvariants\s*=\s*\{/.exec(e);
|
|
471
471
|
if (!t) return {};
|
|
472
|
-
const s =
|
|
472
|
+
const s = te(e, e.indexOf("{", t.index));
|
|
473
473
|
return s ? Object.fromEntries([...s.matchAll(
|
|
474
474
|
/\b(?:string|token)\s+([A-Za-z0-9_:]+)\s*=\s*"([^"]+)"/g
|
|
475
475
|
)].map((r) => [r[1], r[2]])) : {};
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
const t =
|
|
479
|
-
if (!
|
|
480
|
-
const o = Object.entries(r).filter((c) =>
|
|
477
|
+
function xt(e) {
|
|
478
|
+
const t = P(e) ? Object.entries(e).find(([, c]) => P(c) && P(S(c, "features_summary"))) ?? null : null, s = (t == null ? void 0 : t[1]) ?? null, r = S(s, "features_summary");
|
|
479
|
+
if (!P(r)) return null;
|
|
480
|
+
const o = Object.entries(r).filter((c) => P(c[1])), n = o.filter(([, c]) => c.blocking_failure === !0 && c.passed !== !0).map(([c]) => c), i = o.filter(([, c]) => c.passed !== !0).map(([c]) => c), l = S(s, "tier_versions"), d = o.filter(([, c]) => c.passed === !0).length;
|
|
481
481
|
return {
|
|
482
482
|
entryPath: (t == null ? void 0 : t[0]) ?? null,
|
|
483
|
-
profileId:
|
|
484
|
-
profileVersion:
|
|
485
|
-
validatorVersion:
|
|
483
|
+
profileId: A(S(s, "profile_id")),
|
|
484
|
+
profileVersion: A(S(s, "profile_version")),
|
|
485
|
+
validatorVersion: A(S(s, "simready_validate_version")),
|
|
486
486
|
totalFeatures: o.length,
|
|
487
|
-
passedFeatures:
|
|
487
|
+
passedFeatures: d,
|
|
488
488
|
blockingFailures: n.length,
|
|
489
489
|
blockingFeatureIds: n,
|
|
490
490
|
failedFeatureIds: i,
|
|
491
|
-
tierVersions:
|
|
492
|
-
status: n.length ? "fail" : o.length === 0 ? "unknown" :
|
|
491
|
+
tierVersions: P(l) ? Object.fromEntries(Object.entries(l).flatMap(([c, u]) => typeof u == "string" && u ? [[c, u]] : [])) : {},
|
|
492
|
+
status: n.length ? "fail" : o.length === 0 ? "unknown" : d === o.length ? "pass" : "partial"
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
if (!
|
|
497
|
-
const t = Array.isArray(e.results) ? e.results.filter((o) =>
|
|
498
|
-
const n =
|
|
495
|
+
function Lt(e) {
|
|
496
|
+
if (!P(e)) return null;
|
|
497
|
+
const t = Array.isArray(e.results) ? e.results.filter((o) => P(o)) : [], s = [...new Set(t.flatMap((o) => {
|
|
498
|
+
const n = A(o.engine), i = A(o.engine_version);
|
|
499
499
|
return n ? [`${n}${i ? ` ${i}` : ""}`] : [];
|
|
500
500
|
}))].sort(), r = t.filter((o) => o.status === "fail").map((o) => ({
|
|
501
|
-
testName:
|
|
502
|
-
engine:
|
|
503
|
-
message:
|
|
501
|
+
testName: A(o.test_name) ?? "unnamed-test",
|
|
502
|
+
engine: A(o.engine) ?? "unknown-engine",
|
|
503
|
+
message: A(o.message) ?? ""
|
|
504
504
|
}));
|
|
505
505
|
return {
|
|
506
|
-
schemaVersion:
|
|
507
|
-
assetName:
|
|
506
|
+
schemaVersion: A(e.schema_version),
|
|
507
|
+
assetName: A(e.asset),
|
|
508
508
|
passed: typeof e.passed == "boolean" ? e.passed : null,
|
|
509
|
-
runTimestamp:
|
|
509
|
+
runTimestamp: A(e.run_timestamp),
|
|
510
510
|
testCount: t.length,
|
|
511
511
|
passedCount: t.filter((o) => o.status === "pass").length,
|
|
512
512
|
failedCount: r.length,
|
|
@@ -515,72 +515,72 @@ function Wt(e) {
|
|
|
515
515
|
engines: s
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
function
|
|
519
|
-
const t =
|
|
518
|
+
function Ot(e) {
|
|
519
|
+
const t = ee(e, "validation");
|
|
520
520
|
if (!t) return null;
|
|
521
|
-
const s =
|
|
521
|
+
const s = ee(t, "validated_features") ?? "", r = [...new Set(
|
|
522
522
|
[...s.matchAll(/dictionary\s+"(\d{4}-\d{2}-\d{2})"\s*=/g)].map((c) => c[1])
|
|
523
523
|
)].sort(), o = /* @__PURE__ */ new Map(), n = /\bdictionary\s+(?:"([^"]+)"|([A-Za-z0-9_:]+))\s*(?:=\s*)?\{/g;
|
|
524
524
|
for (let c = n.exec(s); c; c = n.exec(s)) {
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
const a =
|
|
528
|
-
a && o.set(
|
|
525
|
+
const u = c[1] ?? c[2];
|
|
526
|
+
if (!u.startsWith("FET_")) continue;
|
|
527
|
+
const a = te(s, s.indexOf("{", c.index));
|
|
528
|
+
a && o.set(u, a);
|
|
529
529
|
}
|
|
530
|
-
const i = [...o.values()], l = i.filter((c) =>
|
|
530
|
+
const i = [...o.values()], l = i.filter((c) => le(c, "passed") === !0).length, d = i.filter((c) => le(c, "blocking_failure") === !0 && le(c, "passed") !== !0).length;
|
|
531
531
|
return !r.length && !o.size && !b(t, "profile") ? null : {
|
|
532
532
|
profileId: b(t, "profile"),
|
|
533
533
|
profileVersion: b(t, "profile_version"),
|
|
534
534
|
validatedDates: r,
|
|
535
535
|
featureCount: o.size,
|
|
536
536
|
passedFeatureCount: l,
|
|
537
|
-
blockingFailureCount:
|
|
537
|
+
blockingFailureCount: d
|
|
538
538
|
};
|
|
539
539
|
}
|
|
540
|
-
async function
|
|
540
|
+
async function H(e) {
|
|
541
541
|
try {
|
|
542
542
|
return JSON.parse(await e.text());
|
|
543
543
|
} catch {
|
|
544
544
|
return null;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const t =
|
|
547
|
+
function Mt(e) {
|
|
548
|
+
const t = ze(e);
|
|
549
549
|
return t ? e.slice(t.start, t.end + 1) : null;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function ze(e) {
|
|
552
552
|
const t = /#usda\s+\S+\s*\(/m.exec(e);
|
|
553
553
|
if (!t) return null;
|
|
554
|
-
const s = e.indexOf("(", t.index), r =
|
|
554
|
+
const s = e.indexOf("(", t.index), r = se(e, s, "(", ")");
|
|
555
555
|
return r >= 0 ? { start: s, end: r } : null;
|
|
556
556
|
}
|
|
557
|
-
function
|
|
557
|
+
function ee(e, t) {
|
|
558
558
|
if (!e) return null;
|
|
559
|
-
const s = new RegExp(`(?:\\bdictionary\\s+)?\\b${
|
|
560
|
-
return s ?
|
|
559
|
+
const s = new RegExp(`(?:\\bdictionary\\s+)?\\b${G(t)}\\s*=\\s*\\{`).exec(e);
|
|
560
|
+
return s ? te(e, e.indexOf("{", s.index)) : null;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function te(e, t) {
|
|
563
563
|
if (t < 0 || e[t] !== "{") return null;
|
|
564
|
-
const s =
|
|
564
|
+
const s = se(e, t, "{", "}");
|
|
565
565
|
return s >= 0 ? e.slice(t, s + 1) : null;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function se(e, t, s, r) {
|
|
568
568
|
if (e[t] !== s) return -1;
|
|
569
569
|
let o = 0, n = !1, i = !1;
|
|
570
570
|
for (let l = t; l < e.length; l += 1) {
|
|
571
|
-
const
|
|
571
|
+
const d = e[l];
|
|
572
572
|
if (i) {
|
|
573
|
-
|
|
573
|
+
d === `
|
|
574
574
|
` && (i = !1);
|
|
575
575
|
continue;
|
|
576
576
|
}
|
|
577
|
-
if (
|
|
577
|
+
if (d === "#" && !n) {
|
|
578
578
|
i = !0;
|
|
579
579
|
continue;
|
|
580
580
|
}
|
|
581
|
-
if (
|
|
582
|
-
if (
|
|
583
|
-
else if (
|
|
581
|
+
if (d === '"' && e[l - 1] !== "\\" && (n = !n), !n) {
|
|
582
|
+
if (d === s) o += 1;
|
|
583
|
+
else if (d === r && (o -= 1, o === 0))
|
|
584
584
|
return l;
|
|
585
585
|
}
|
|
586
586
|
}
|
|
@@ -588,77 +588,77 @@ function ie(e, t, s, r) {
|
|
|
588
588
|
}
|
|
589
589
|
function b(e, t) {
|
|
590
590
|
var s;
|
|
591
|
-
return e ? ((s = new RegExp(`\\b(?:string|token)?\\s*${
|
|
591
|
+
return e ? ((s = new RegExp(`\\b(?:string|token)?\\s*${G(t)}\\s*=\\s*"([^"]*)"`).exec(e)) == null ? void 0 : s[1]) ?? null : null;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function Y(e, t) {
|
|
594
594
|
var r;
|
|
595
595
|
if (!e) return null;
|
|
596
|
-
const s = (r = new RegExp(`\\b(?:float|double|int)?\\s*${
|
|
596
|
+
const s = (r = new RegExp(`\\b(?:float|double|int)?\\s*${G(t)}\\s*=\\s*([0-9.eE+-]+)`).exec(e)) == null ? void 0 : r[1];
|
|
597
597
|
return s !== void 0 && Number.isFinite(Number(s)) ? Number(s) : null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
const s =
|
|
599
|
+
function Ut(e, t) {
|
|
600
|
+
const s = Y(e, t);
|
|
601
601
|
return s !== null && Number.isInteger(s) ? s : null;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function le(e, t) {
|
|
604
604
|
var r, o;
|
|
605
605
|
if (!e) return null;
|
|
606
|
-
const s = (o = (r = new RegExp(`\\bbool\\s+${
|
|
606
|
+
const s = (o = (r = new RegExp(`\\bbool\\s+${G(t)}\\s*=\\s*(0|1|true|false)\\b`, "i").exec(e)) == null ? void 0 : r[1]) == null ? void 0 : o.toLowerCase();
|
|
607
607
|
return s === void 0 ? null : s === "1" || s === "true";
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function zt(e, t) {
|
|
610
610
|
var o;
|
|
611
611
|
if (!e) return null;
|
|
612
|
-
const s = (o = new RegExp(`\\bfloat3\\s+${
|
|
612
|
+
const s = (o = new RegExp(`\\bfloat3\\s+${G(t)}\\s*=\\s*\\(([^)]+)\\)`).exec(e)) == null ? void 0 : o[1], r = (s == null ? void 0 : s.trim().split(/\s*,\s*|\s+/).map(Number)) ?? [];
|
|
613
613
|
return r.length === 3 && r.every(Number.isFinite) ? [r[0], r[1], r[2]] : null;
|
|
614
614
|
}
|
|
615
615
|
function S(e, t) {
|
|
616
|
-
return
|
|
616
|
+
return P(e) ? e[t] : null;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function Vt(e) {
|
|
619
619
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function A(e) {
|
|
622
622
|
return typeof e == "string" && e ? e : null;
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function P(e) {
|
|
625
625
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
626
626
|
}
|
|
627
627
|
function L(e) {
|
|
628
628
|
return e.replaceAll("\\", "/").replace(/^\.?\//, "");
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function G(e) {
|
|
631
631
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
632
632
|
}
|
|
633
|
-
const
|
|
634
|
-
function
|
|
633
|
+
const Ft = [".usd", ".usda", ".usdc", ".usdz"], Ve = [".glb", ".gltf"], Fe = ["simready_usd", "asset", "usd"], Be = ["com.nvidia.simready.packaging.json", "manifest.json"];
|
|
634
|
+
function M(e) {
|
|
635
635
|
const t = e.lastIndexOf(".");
|
|
636
636
|
return t < 0 ? "" : e.slice(t).toLowerCase();
|
|
637
637
|
}
|
|
638
|
-
function
|
|
639
|
-
return
|
|
638
|
+
function B(e) {
|
|
639
|
+
return Ft.includes(M(e));
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
const s =
|
|
641
|
+
function Bt(e, t) {
|
|
642
|
+
const s = jt(e);
|
|
643
643
|
if (t === void 0) return s;
|
|
644
|
-
const r = e.files.find((o) => o.path === t && (
|
|
644
|
+
const r = e.files.find((o) => o.path === t && (B(o.path) || Ve.includes(M(o.path))));
|
|
645
645
|
return r ? { ...s, entryPath: r.path, reason: `${s.reason}; explicit entry ${r.path}` } : s;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function jt(e) {
|
|
648
648
|
var l;
|
|
649
|
-
const t = e.files.filter((
|
|
649
|
+
const t = e.files.filter((d) => B(d.path)), s = t.find((d) => M(d.path) === ".usdz");
|
|
650
650
|
if (s)
|
|
651
651
|
return {
|
|
652
652
|
layout: "usdz",
|
|
653
653
|
entryPath: s.path,
|
|
654
654
|
reason: "self-contained .usdz archive"
|
|
655
655
|
};
|
|
656
|
-
const r = e.files.find((
|
|
656
|
+
const r = e.files.find((d) => Be.some((c) => d.path === c || d.path.endsWith(`/${c}`))), o = e.files.filter((d) => /(^|\/)payloads\//.test(d.path) && B(d.path)), n = Fe.some((d) => e.files.some((c) => c.path.startsWith(`${d}/`)));
|
|
657
657
|
if (t.length > 1 && (n || o.length > 0)) {
|
|
658
|
-
const
|
|
658
|
+
const d = Pe(t, e);
|
|
659
659
|
return {
|
|
660
660
|
layout: "simready-package",
|
|
661
|
-
entryPath: (
|
|
661
|
+
entryPath: (d == null ? void 0 : d.path) ?? null,
|
|
662
662
|
reason: n ? "multi-layer package with a SimReady content directory" : "multi-layer package with payloads/"
|
|
663
663
|
};
|
|
664
664
|
}
|
|
@@ -668,7 +668,7 @@ function es(e) {
|
|
|
668
668
|
entryPath: t[0].path,
|
|
669
669
|
reason: r ? "single USD entry with a package manifest" : "single USD file"
|
|
670
670
|
};
|
|
671
|
-
const i = e.files.find((
|
|
671
|
+
const i = e.files.find((d) => Ve.includes(M(d.path)));
|
|
672
672
|
return i ? {
|
|
673
673
|
layout: "glb",
|
|
674
674
|
entryPath: i.path,
|
|
@@ -676,23 +676,23 @@ function es(e) {
|
|
|
676
676
|
reason: "glTF/GLB source needs compilation to USD before export"
|
|
677
677
|
} : t.length > 1 ? {
|
|
678
678
|
layout: "simready-package",
|
|
679
|
-
entryPath: ((l =
|
|
679
|
+
entryPath: ((l = Pe(t, e)) == null ? void 0 : l.path) ?? null,
|
|
680
680
|
reason: "multi-layer USD package without a SimReady marker"
|
|
681
681
|
} : { layout: "single-layer", entryPath: null, reason: "no USD or glTF entry found" };
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
var
|
|
685
|
-
const s = e.filter((c) =>
|
|
683
|
+
function Pe(e, t) {
|
|
684
|
+
var d;
|
|
685
|
+
const s = e.filter((c) => M(c.path) !== ".usdc"), r = s.length > 0 ? s : e, o = (c) => /(^|\/)(payloads|meshes|materials|physics|textures|variants)\//.test(c), n = r.filter((c) => !o(c.path)), i = t.rootName.toLowerCase(), l = (n.length > 0 ? n : r).map((c) => {
|
|
686
686
|
let a = c.path.split("/").length - 1;
|
|
687
|
-
return
|
|
687
|
+
return Fe.some((f) => c.path.startsWith(`${f}/`)) && (a -= 2), c.path.toLowerCase().includes(i) && (a -= 3), M(c.path) === ".usda" && (a -= 1), { file: c, score: a };
|
|
688
688
|
});
|
|
689
|
-
return l.sort((c,
|
|
689
|
+
return l.sort((c, u) => c.score - u.score || c.file.path.localeCompare(u.file.path)), ((d = l[0]) == null ? void 0 : d.file) ?? null;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
692
|
-
const t = e.find((s) =>
|
|
691
|
+
function Xs(e) {
|
|
692
|
+
const t = e.find((s) => Be.some((r) => s.path === r || s.path.endsWith(`/${r}`)));
|
|
693
693
|
return t != null && t.bytes ? new TextDecoder("utf-8").decode(t.bytes) : null;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function Kt(e, t, s) {
|
|
696
696
|
const r = /* @__PURE__ */ new Map(), o = [], n = /* @__PURE__ */ new Map();
|
|
697
697
|
for (const i of t) {
|
|
698
698
|
const l = n.get(i.fromPath) ?? [];
|
|
@@ -701,38 +701,38 @@ function ts(e, t, s) {
|
|
|
701
701
|
for (const i of e) {
|
|
702
702
|
const l = n.get(i.path);
|
|
703
703
|
if (!l || l.length === 0) continue;
|
|
704
|
-
let
|
|
704
|
+
let d = i.text;
|
|
705
705
|
for (const c of l) {
|
|
706
|
-
const
|
|
707
|
-
|
|
706
|
+
const u = `./${c.target}`;
|
|
707
|
+
d = Xt(d, c.target, u), o.push({
|
|
708
708
|
kind: "anchored-mdl-path",
|
|
709
|
-
detail: `${c.fromPath}: @${c.target}@ rewritten as @${
|
|
709
|
+
detail: `${c.fromPath}: @${c.target}@ rewritten as @${u}@`,
|
|
710
710
|
at: s.now()
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
|
|
713
|
+
d !== i.text && r.set(i.path, d);
|
|
714
714
|
}
|
|
715
715
|
return { rewrites: r, repairs: o, unresolved: [] };
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Yt(e, t, s) {
|
|
718
718
|
const r = /* @__PURE__ */ new Map(), o = [], n = [], i = /* @__PURE__ */ new Map();
|
|
719
719
|
for (const l of t) {
|
|
720
|
-
const
|
|
721
|
-
|
|
720
|
+
const d = i.get(l.fromPath) ?? [];
|
|
721
|
+
d.push(l), i.set(l.fromPath, d);
|
|
722
722
|
}
|
|
723
723
|
for (const l of e) {
|
|
724
|
-
const
|
|
725
|
-
if (!
|
|
724
|
+
const d = i.get(l.path);
|
|
725
|
+
if (!d || d.length === 0) continue;
|
|
726
726
|
let c = l.text;
|
|
727
|
-
for (const
|
|
727
|
+
for (const u of d) {
|
|
728
728
|
const a = c;
|
|
729
|
-
if (c =
|
|
730
|
-
n.push(
|
|
729
|
+
if (c = Wt(c, u.target), c === a) {
|
|
730
|
+
n.push(u);
|
|
731
731
|
continue;
|
|
732
732
|
}
|
|
733
733
|
o.push({
|
|
734
734
|
kind: "stripped-external-uri",
|
|
735
|
-
detail: `${
|
|
735
|
+
detail: `${u.fromPath}: removed external reference ${u.target}`,
|
|
736
736
|
at: s.now()
|
|
737
737
|
});
|
|
738
738
|
}
|
|
@@ -740,15 +740,15 @@ function ss(e, t, s) {
|
|
|
740
740
|
}
|
|
741
741
|
return { rewrites: r, repairs: o, unresolved: n };
|
|
742
742
|
}
|
|
743
|
-
function
|
|
744
|
-
const s =
|
|
743
|
+
function Wt(e, t) {
|
|
744
|
+
const s = je(`@${t}@`), r = new RegExp(s), o = e.split(/\r?\n/), n = [];
|
|
745
745
|
let i = !1;
|
|
746
746
|
for (const l of o) {
|
|
747
747
|
if (!r.test(l)) {
|
|
748
748
|
n.push(l);
|
|
749
749
|
continue;
|
|
750
750
|
}
|
|
751
|
-
if (!
|
|
751
|
+
if (!Gt(l, s)) {
|
|
752
752
|
n.push(l);
|
|
753
753
|
continue;
|
|
754
754
|
}
|
|
@@ -757,26 +757,26 @@ function rs(e, t) {
|
|
|
757
757
|
return i ? n.join(`
|
|
758
758
|
`) : e;
|
|
759
759
|
}
|
|
760
|
-
function
|
|
760
|
+
function Gt(e, t) {
|
|
761
761
|
const s = e.trim().replace(/,$/, "");
|
|
762
762
|
return new RegExp(
|
|
763
763
|
`^[A-Za-z_:.]*\\s*(?:prepend|append|add|delete|reorder)?\\s*[A-Za-z_:.]*\\s*=\\s*${t}(?:\\s*<[^>]*>)?\\s*(?:#.*)?$`
|
|
764
764
|
).test(s);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
const r = new RegExp(`@\\s*${
|
|
766
|
+
function Xt(e, t, s) {
|
|
767
|
+
const r = new RegExp(`@\\s*${je(t)}\\s*@`, "g");
|
|
768
768
|
return e.replace(r, `@${s}@`);
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function Zs(e, t, s) {
|
|
771
771
|
return { kind: e, detail: t, at: s() };
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function Zt(e) {
|
|
774
774
|
return [...e].sort((t, s) => t.kind.localeCompare(s.kind) || t.detail.localeCompare(s.detail) || t.at.localeCompare(s.at));
|
|
775
775
|
}
|
|
776
|
-
function
|
|
776
|
+
function je(e) {
|
|
777
777
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
778
778
|
}
|
|
779
|
-
const
|
|
779
|
+
const E = {
|
|
780
780
|
entryMissing: "ASSET_INTAKE_ENTRY_MISSING",
|
|
781
781
|
entryNotUsd: "ASSET_INTAKE_ENTRY_NOT_USD",
|
|
782
782
|
dependencyMissing: "ASSET_INTAKE_DEPENDENCY_MISSING",
|
|
@@ -789,23 +789,23 @@ const _ = {
|
|
|
789
789
|
materialModuleReference: "ASSET_INTAKE_MATERIAL_MODULE",
|
|
790
790
|
resourceBytesMissing: "ASSET_INTAKE_RESOURCE_BYTES_MISSING"
|
|
791
791
|
};
|
|
792
|
-
function
|
|
793
|
-
var
|
|
794
|
-
const r = s.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()), o = [], n = [], i =
|
|
792
|
+
function qs(e, t, s = {}) {
|
|
793
|
+
var Ie, ve, Se, be, Ae;
|
|
794
|
+
const r = s.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()), o = [], n = [], i = Bt(e, s.entryPath);
|
|
795
795
|
if (o.push({
|
|
796
796
|
code: "ASSET_INTAKE_LAYOUT",
|
|
797
797
|
level: "info",
|
|
798
798
|
message: `Detected layout ${i.layout}: ${i.reason}`
|
|
799
799
|
}), !i.entryPath)
|
|
800
800
|
return o.push({
|
|
801
|
-
code:
|
|
801
|
+
code: E.entryMissing,
|
|
802
802
|
level: "error",
|
|
803
803
|
message: `No openable entry found in ${e.rootName}.`
|
|
804
804
|
}), { status: "blocked", record: null, rewrites: /* @__PURE__ */ new Map(), diagnostics: o };
|
|
805
|
-
const l =
|
|
805
|
+
const l = Ht(e), d = new Set(e.files.map((y) => Q(y.path))), c = de(l, d), u = qt(
|
|
806
806
|
i.entryPath,
|
|
807
807
|
c,
|
|
808
|
-
|
|
808
|
+
d,
|
|
809
809
|
l.some((y) => y.path === i.entryPath)
|
|
810
810
|
);
|
|
811
811
|
let a = l;
|
|
@@ -813,104 +813,104 @@ function Ir(e, t, s = {}) {
|
|
|
813
813
|
if (c.unanchored.length > 0)
|
|
814
814
|
for (const y of c.unanchored)
|
|
815
815
|
o.push({
|
|
816
|
-
code:
|
|
816
|
+
code: E.unanchoredReference,
|
|
817
817
|
level: "warning",
|
|
818
818
|
message: `${y.fromPath}: @${y.target}@ is not anchored; USD resolves it via a search path.`
|
|
819
819
|
});
|
|
820
|
-
const g = c.references.filter((y) => !y.external && !y.anchored), h =
|
|
821
|
-
|
|
820
|
+
const g = c.references.filter((y) => !y.external && !y.anchored), h = Kt(a, g, { now: r });
|
|
821
|
+
$e(f, h.rewrites), n.push(...h.repairs), a = we(a, h.rewrites);
|
|
822
822
|
for (const y of c.materialModules)
|
|
823
823
|
o.push({
|
|
824
|
-
code:
|
|
824
|
+
code: E.materialModuleReference,
|
|
825
825
|
level: "info",
|
|
826
826
|
message: `${y.fromPath}: material module ${y.target} resolves from the host MDL search path, not the package.`
|
|
827
827
|
});
|
|
828
|
-
const p =
|
|
829
|
-
|
|
828
|
+
const p = Yt(a, c.external, { now: r });
|
|
829
|
+
$e(f, p.rewrites), n.push(...p.repairs), a = we(a, p.rewrites);
|
|
830
830
|
for (const y of c.external)
|
|
831
831
|
o.push({
|
|
832
|
-
code:
|
|
833
|
-
level: p.unresolved.some((
|
|
832
|
+
code: E.externalReference,
|
|
833
|
+
level: p.unresolved.some((K) => K === y) ? "error" : "warning",
|
|
834
834
|
message: `${y.fromPath}: external reference ${y.target} cannot ship inside the package.`
|
|
835
835
|
});
|
|
836
|
-
const I =
|
|
837
|
-
for (const y of
|
|
836
|
+
const I = de(a, d), R = I.missing;
|
|
837
|
+
for (const y of R)
|
|
838
838
|
o.push({
|
|
839
|
-
code:
|
|
839
|
+
code: E.dependencyMissing,
|
|
840
840
|
level: "error",
|
|
841
841
|
message: `${y.fromPath}: referenced file ${y.target} is not in the package.`
|
|
842
842
|
});
|
|
843
|
-
const
|
|
844
|
-
|
|
843
|
+
const _ = R.length > 0 || p.unresolved.length > 0 || I.external.length > 0;
|
|
844
|
+
_ && s.strict === !1 && o.push({
|
|
845
845
|
code: "ASSET_INTAKE_BLOCKING_OVERRIDDEN",
|
|
846
846
|
level: "warning",
|
|
847
847
|
message: "Structural problems were ignored because strict mode is off."
|
|
848
848
|
});
|
|
849
849
|
for (const y of n)
|
|
850
850
|
o.push({
|
|
851
|
-
code:
|
|
851
|
+
code: E.repairApplied,
|
|
852
852
|
level: "info",
|
|
853
853
|
message: y.detail
|
|
854
854
|
});
|
|
855
855
|
i.layout === "glb" && o.push({
|
|
856
|
-
code:
|
|
856
|
+
code: E.glbNeedsCompilation,
|
|
857
857
|
level: "warning",
|
|
858
858
|
message: "glTF/GLB assets must be compiled to USD before they can be exported."
|
|
859
859
|
});
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
code:
|
|
860
|
+
const D = s.annotations ?? {}, ne = D.slug ?? Qt(e.rootName);
|
|
861
|
+
D.slug || o.push({
|
|
862
|
+
code: E.annotationMissing,
|
|
863
863
|
level: "info",
|
|
864
|
-
message: `slug defaulted to "${
|
|
865
|
-
}),
|
|
866
|
-
code:
|
|
864
|
+
message: `slug defaulted to "${ne}"; confirm it before publishing.`
|
|
865
|
+
}), D.category || o.push({
|
|
866
|
+
code: E.annotationMissing,
|
|
867
867
|
level: "info",
|
|
868
868
|
message: "category is not inferable from file contents and must be annotated."
|
|
869
869
|
});
|
|
870
870
|
const z = (t == null ? void 0 : t.capability) ?? { hasPhysics: !1, hasArticulation: !1, hasColliderGeometry: !1, source: "none" };
|
|
871
871
|
if (t || o.push({
|
|
872
|
-
code:
|
|
872
|
+
code: E.physicsUnknown,
|
|
873
873
|
level: "warning",
|
|
874
874
|
message: "No physics probe was supplied; the asset is recorded as carrying no physics."
|
|
875
|
-
}),
|
|
875
|
+
}), _ && s.strict !== !1)
|
|
876
876
|
return { status: "blocked", record: null, rewrites: f, diagnostics: o };
|
|
877
|
-
const
|
|
878
|
-
for (const y of
|
|
879
|
-
const
|
|
880
|
-
if (!
|
|
877
|
+
const he = [.../* @__PURE__ */ new Set([i.entryPath, ...u])].sort(), Qe = new Map(e.files.map((y) => [Q(y.path), y])), X = [];
|
|
878
|
+
for (const y of he) {
|
|
879
|
+
const K = Qe.get(y), Re = f.get(y), ie = Re === void 0 ? K == null ? void 0 : K.bytes : new TextEncoder().encode(Re);
|
|
880
|
+
if (!ie) {
|
|
881
881
|
o.push({
|
|
882
|
-
code:
|
|
882
|
+
code: E.resourceBytesMissing,
|
|
883
883
|
level: "error",
|
|
884
884
|
message: `${y}: resource bytes are required to calculate the immutable content hash.`
|
|
885
885
|
});
|
|
886
886
|
continue;
|
|
887
887
|
}
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
resourceId:
|
|
888
|
+
const Ee = N(ie);
|
|
889
|
+
X.push({
|
|
890
|
+
resourceId: at({ kind: "package-path", path: y }, Ee),
|
|
891
891
|
locator: { kind: "package-path", path: y },
|
|
892
|
-
mediaType:
|
|
893
|
-
byteSize:
|
|
894
|
-
sha256:
|
|
892
|
+
mediaType: nt(y),
|
|
893
|
+
byteSize: ie.byteLength,
|
|
894
|
+
sha256: Ee
|
|
895
895
|
});
|
|
896
896
|
}
|
|
897
|
-
if (
|
|
897
|
+
if (X.length !== he.length)
|
|
898
898
|
return { status: "blocked", record: null, rewrites: f, diagnostics: o };
|
|
899
|
-
const
|
|
900
|
-
if (!
|
|
899
|
+
const ye = X.find((y) => it(y.locator) === i.entryPath);
|
|
900
|
+
if (!ye)
|
|
901
901
|
return o.push({
|
|
902
|
-
code:
|
|
902
|
+
code: E.resourceBytesMissing,
|
|
903
903
|
level: "error",
|
|
904
904
|
message: `${i.entryPath}: entry resource bytes are unavailable.`
|
|
905
905
|
}), { status: "blocked", record: null, rewrites: f, diagnostics: o };
|
|
906
|
-
const
|
|
907
|
-
assetId: `asset_${
|
|
908
|
-
slug:
|
|
909
|
-
label:
|
|
906
|
+
const ae = D.category ?? "other", ge = D.label ?? e.rootName, Z = [], et = D.category || D.label || D.slug ? "annotated" : "imported", tt = pt({
|
|
907
|
+
assetId: `asset_${ne}`,
|
|
908
|
+
slug: ne,
|
|
909
|
+
label: ge,
|
|
910
910
|
layout: i.layout,
|
|
911
|
-
fileKind:
|
|
912
|
-
entryResourceId:
|
|
913
|
-
resources:
|
|
911
|
+
fileKind: Jt(i.entryPath) ? "glb" : "usd",
|
|
912
|
+
entryResourceId: ye.resourceId,
|
|
913
|
+
resources: X,
|
|
914
914
|
variantSets: (t == null ? void 0 : t.variantSets) ?? [],
|
|
915
915
|
capabilities: {
|
|
916
916
|
rendering: "supported",
|
|
@@ -919,402 +919,94 @@ function Ir(e, t, s = {}) {
|
|
|
919
919
|
rigidBody: z.hasPhysics || z.hasRigidBody === !0,
|
|
920
920
|
colliderGeometry: z.hasColliderGeometry
|
|
921
921
|
},
|
|
922
|
-
...(
|
|
923
|
-
category:
|
|
922
|
+
...(Ie = t == null ? void 0 : t.measured) != null && Ie.bounds ? { bounds: t.measured.bounds } : {},
|
|
923
|
+
category: ae,
|
|
924
924
|
hints: {
|
|
925
925
|
...t != null && t.approximateSize ? { approximateSize: t.approximateSize } : {},
|
|
926
926
|
...t != null && t.forwardAxis ? { forwardAxis: t.forwardAxis } : {},
|
|
927
|
-
...
|
|
927
|
+
...Z.length > 0 ? { tags: Z } : {}
|
|
928
928
|
},
|
|
929
|
-
...((
|
|
929
|
+
...((ve = t == null ? void 0 : t.measured) == null ? void 0 : ve.jointCount) !== void 0 || ((Se = t == null ? void 0 : t.measured) == null ? void 0 : Se.meshCount) !== void 0 ? {
|
|
930
930
|
metrics: {
|
|
931
|
-
...((
|
|
932
|
-
...((
|
|
931
|
+
...((be = t.measured) == null ? void 0 : be.jointCount) !== void 0 ? { jointCount: t.measured.jointCount } : {},
|
|
932
|
+
...((Ae = t.measured) == null ? void 0 : Ae.meshCount) !== void 0 ? { meshCount: t.measured.meshCount } : {}
|
|
933
933
|
}
|
|
934
934
|
} : {},
|
|
935
935
|
semantic: {
|
|
936
|
-
source:
|
|
937
|
-
labels: [
|
|
938
|
-
taxonomy: [
|
|
939
|
-
...
|
|
940
|
-
category:
|
|
936
|
+
source: et,
|
|
937
|
+
labels: [ge],
|
|
938
|
+
taxonomy: [ae],
|
|
939
|
+
...Z.length > 0 ? { tags: Z } : {},
|
|
940
|
+
category: ae
|
|
941
941
|
},
|
|
942
942
|
provenance: {
|
|
943
943
|
source: s.origin ?? "builtin",
|
|
944
944
|
sourceLabel: e.rootName,
|
|
945
945
|
...s.origin === "user" || s.origin === "import" ? { importedAt: r() } : {},
|
|
946
|
-
|
|
947
|
-
repairs:
|
|
946
|
+
...D.externalRef ? { externalRef: { ...D.externalRef } } : {},
|
|
947
|
+
repairs: Zt(n)
|
|
948
948
|
}
|
|
949
949
|
});
|
|
950
950
|
return {
|
|
951
951
|
status: n.length > 0 ? "ready-with-repairs" : "ready",
|
|
952
|
-
record:
|
|
952
|
+
record: tt,
|
|
953
953
|
rewrites: f,
|
|
954
954
|
diagnostics: o
|
|
955
955
|
};
|
|
956
956
|
}
|
|
957
|
-
function
|
|
957
|
+
function qt(e, t, s, r) {
|
|
958
958
|
const o = /* @__PURE__ */ new Map();
|
|
959
959
|
for (const l of t.references) {
|
|
960
960
|
if (l.resolvedPath === null) continue;
|
|
961
|
-
const
|
|
962
|
-
|
|
961
|
+
const d = o.get(l.fromPath) ?? [];
|
|
962
|
+
d.push(l.resolvedPath), o.set(l.fromPath, d);
|
|
963
963
|
}
|
|
964
964
|
const n = /* @__PURE__ */ new Set(), i = [e];
|
|
965
965
|
for (; i.length > 0; ) {
|
|
966
966
|
const l = i.pop();
|
|
967
|
-
for (const
|
|
968
|
-
n.has(
|
|
967
|
+
for (const d of o.get(l) ?? [])
|
|
968
|
+
n.has(d) || !s.has(d) || (n.add(d), i.push(d));
|
|
969
969
|
}
|
|
970
|
-
if (
|
|
970
|
+
if (B(e) && !r) {
|
|
971
971
|
for (const l of s)
|
|
972
972
|
l !== e && n.add(l);
|
|
973
973
|
return [...n].sort();
|
|
974
974
|
}
|
|
975
975
|
for (const l of s)
|
|
976
|
-
|
|
976
|
+
B(l) && !Me(l) && l !== e && n.add(l);
|
|
977
977
|
return [...n].sort();
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function Ht(e) {
|
|
980
980
|
const t = [];
|
|
981
981
|
for (const s of [...e.files].sort((r, o) => r.path.localeCompare(o.path)))
|
|
982
|
-
|
|
982
|
+
B(s.path) && pe(s.path, s.bytes) && s.bytes && t.push({ path: s.path, text: new TextDecoder("utf-8").decode(s.bytes) });
|
|
983
983
|
return t;
|
|
984
984
|
}
|
|
985
|
-
function
|
|
985
|
+
function we(e, t) {
|
|
986
986
|
return e.map((s) => {
|
|
987
987
|
const r = t.get(s.path);
|
|
988
988
|
return r === void 0 ? s : { path: s.path, text: r };
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function $e(e, t) {
|
|
992
992
|
for (const [s, r] of t) e.set(s, r);
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
const t =
|
|
994
|
+
function Jt(e) {
|
|
995
|
+
const t = M(e);
|
|
996
996
|
return t === ".glb" || t === ".gltf";
|
|
997
997
|
}
|
|
998
|
-
function
|
|
998
|
+
function Qt(e) {
|
|
999
999
|
return Array.from(e.normalize("NFKD")).map((s) => /[A-Za-z0-9]/.test(s) ? s.toLowerCase() : "-").join("").replace(/-+/g, "-").replace(/^-+|-+$/g, "") || "asset";
|
|
1000
1000
|
}
|
|
1001
|
-
|
|
1002
|
-
notJson: "SCENE_FILE_NOT_JSON",
|
|
1003
|
-
unsupportedFormat: "SCENE_FILE_UNSUPPORTED_FORMAT",
|
|
1004
|
-
unsupportedVersion: "SCENE_FILE_UNSUPPORTED_VERSION",
|
|
1005
|
-
migrated: "SCENE_FILE_MIGRATED",
|
|
1006
|
-
invalidDocument: "SCENE_FILE_INVALID_DOCUMENT"
|
|
1007
|
-
};
|
|
1008
|
-
function Se(e, t = {}) {
|
|
1009
|
-
const s = {
|
|
1010
|
-
schemaVersion: K,
|
|
1011
|
-
sceneId: e.sceneId,
|
|
1012
|
-
meta: { ...e.meta },
|
|
1013
|
-
coordinateSystem: {
|
|
1014
|
-
...e.coordinateSystem,
|
|
1015
|
-
units: { ...e.coordinateSystem.units },
|
|
1016
|
-
origin: e.coordinateSystem.origin
|
|
1017
|
-
},
|
|
1018
|
-
environment: gs(e.environment),
|
|
1019
|
-
assets: [...e.assets].map(ys).sort((r, o) => r.revisionId.localeCompare(o.revisionId)),
|
|
1020
|
-
visualAssets: [...e.visualAssets].map(hs).sort((r, o) => r.visualRevisionId.localeCompare(o.visualRevisionId)),
|
|
1021
|
-
root: Qe(e.root),
|
|
1022
|
-
...e.semantic ? { semantic: Is(e.semantic) } : {},
|
|
1023
|
-
...e.domains ? { domains: ms(e.domains) } : {},
|
|
1024
|
-
...e.extensions ? { extensions: q(e.extensions) } : {}
|
|
1025
|
-
};
|
|
1026
|
-
return ht(s, t.domainExtensions);
|
|
1027
|
-
}
|
|
1028
|
-
function ye(e, t = {}) {
|
|
1029
|
-
return ds(e, K, t);
|
|
1030
|
-
}
|
|
1031
|
-
function ds(e, t, s = {}) {
|
|
1032
|
-
const r = Se(e, s), o = {
|
|
1033
|
-
...r,
|
|
1034
|
-
schemaVersion: t
|
|
1035
|
-
}, { updatedAt: n, ...i } = r.meta, l = {
|
|
1036
|
-
...o,
|
|
1037
|
-
meta: i
|
|
1038
|
-
};
|
|
1039
|
-
return N(C(l));
|
|
1040
|
-
}
|
|
1041
|
-
function fs(e, t = {}) {
|
|
1042
|
-
const s = Se(e, t), r = Ve(s, t);
|
|
1043
|
-
return r.ok ? {
|
|
1044
|
-
text: `${C(s)}
|
|
1045
|
-
`,
|
|
1046
|
-
contentHash: ye(s, t),
|
|
1047
|
-
diagnostics: r.diagnostics
|
|
1048
|
-
} : {
|
|
1049
|
-
text: "",
|
|
1050
|
-
contentHash: ye(s, t),
|
|
1051
|
-
diagnostics: [
|
|
1052
|
-
{
|
|
1053
|
-
code: F.invalidDocument,
|
|
1054
|
-
level: "error",
|
|
1055
|
-
message: `Scene document does not satisfy schema version ${K}.`
|
|
1056
|
-
},
|
|
1057
|
-
...r.diagnostics
|
|
1058
|
-
]
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
const br = fs;
|
|
1062
|
-
function ps(e, t = {}) {
|
|
1063
|
-
let s;
|
|
1064
|
-
try {
|
|
1065
|
-
s = JSON.parse(e);
|
|
1066
|
-
} catch (n) {
|
|
1067
|
-
return {
|
|
1068
|
-
document: null,
|
|
1069
|
-
contentHash: null,
|
|
1070
|
-
migratedFrom: null,
|
|
1071
|
-
diagnostics: [{
|
|
1072
|
-
code: F.notJson,
|
|
1073
|
-
level: "error",
|
|
1074
|
-
message: `Scene document is not valid JSON: ${n instanceof Error ? n.message : String(n)}`
|
|
1075
|
-
}]
|
|
1076
|
-
};
|
|
1077
|
-
}
|
|
1078
|
-
if (!bs(s))
|
|
1079
|
-
return {
|
|
1080
|
-
document: null,
|
|
1081
|
-
contentHash: null,
|
|
1082
|
-
migratedFrom: null,
|
|
1083
|
-
diagnostics: [{
|
|
1084
|
-
code: F.invalidDocument,
|
|
1085
|
-
level: "error",
|
|
1086
|
-
message: "Scene document must be a JSON object."
|
|
1087
|
-
}]
|
|
1088
|
-
};
|
|
1089
|
-
if ("fileVersion" in s || "doc" in s || "assets" in s && !("schemaVersion" in s))
|
|
1090
|
-
return {
|
|
1091
|
-
document: null,
|
|
1092
|
-
contentHash: null,
|
|
1093
|
-
migratedFrom: null,
|
|
1094
|
-
diagnostics: [{
|
|
1095
|
-
code: F.unsupportedFormat,
|
|
1096
|
-
level: "error",
|
|
1097
|
-
message: "The legacy SceneFile envelope is unsupported. Export it once with the explicit migration tool before opening."
|
|
1098
|
-
}]
|
|
1099
|
-
};
|
|
1100
|
-
if (s.schemaVersion !== K)
|
|
1101
|
-
return {
|
|
1102
|
-
document: null,
|
|
1103
|
-
contentHash: null,
|
|
1104
|
-
migratedFrom: null,
|
|
1105
|
-
diagnostics: [{
|
|
1106
|
-
code: F.unsupportedVersion,
|
|
1107
|
-
level: "error",
|
|
1108
|
-
message: `Scene schema version ${String(s.schemaVersion)} is unsupported; expected ${K}.`
|
|
1109
|
-
}]
|
|
1110
|
-
};
|
|
1111
|
-
const r = Ve(s, t);
|
|
1112
|
-
if (!r.ok)
|
|
1113
|
-
return {
|
|
1114
|
-
document: null,
|
|
1115
|
-
contentHash: null,
|
|
1116
|
-
migratedFrom: null,
|
|
1117
|
-
diagnostics: [
|
|
1118
|
-
{
|
|
1119
|
-
code: F.invalidDocument,
|
|
1120
|
-
level: "error",
|
|
1121
|
-
message: `Scene document does not satisfy schema version ${K}.`
|
|
1122
|
-
},
|
|
1123
|
-
...r.diagnostics
|
|
1124
|
-
]
|
|
1125
|
-
};
|
|
1126
|
-
const o = Se(
|
|
1127
|
-
s,
|
|
1128
|
-
t
|
|
1129
|
-
);
|
|
1130
|
-
return {
|
|
1131
|
-
document: o,
|
|
1132
|
-
contentHash: ye(o, t),
|
|
1133
|
-
migratedFrom: null,
|
|
1134
|
-
diagnostics: r.diagnostics
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
const Er = ps;
|
|
1138
|
-
function Qe(e) {
|
|
1139
|
-
const t = {
|
|
1140
|
-
nodeId: e.nodeId,
|
|
1141
|
-
label: e.label,
|
|
1142
|
-
localTransform: {
|
|
1143
|
-
position: e.localTransform.position,
|
|
1144
|
-
rotation: e.localTransform.rotation,
|
|
1145
|
-
scale: e.localTransform.scale
|
|
1146
|
-
},
|
|
1147
|
-
...e.origin ? { origin: { local: e.origin.local } } : {}
|
|
1148
|
-
};
|
|
1149
|
-
return e.nodeType === "group" ? {
|
|
1150
|
-
...t,
|
|
1151
|
-
nodeType: "group",
|
|
1152
|
-
children: [...e.children].map(Qe).sort((s, r) => s.nodeId.localeCompare(r.nodeId))
|
|
1153
|
-
} : e.nodeType === "visual" ? {
|
|
1154
|
-
...t,
|
|
1155
|
-
nodeType: "visual",
|
|
1156
|
-
visualRevisionId: e.visualRevisionId,
|
|
1157
|
-
visible: e.visible,
|
|
1158
|
-
renderLayer: e.renderLayer,
|
|
1159
|
-
selectionMode: e.selectionMode,
|
|
1160
|
-
...e.appearance ? {
|
|
1161
|
-
appearance: {
|
|
1162
|
-
...e.appearance,
|
|
1163
|
-
...e.appearance.color ? { color: e.appearance.color } : {}
|
|
1164
|
-
}
|
|
1165
|
-
} : {},
|
|
1166
|
-
...e.semantic ? { semantic: j(e.semantic) } : {}
|
|
1167
|
-
} : e.nodeType === "placeholder" ? {
|
|
1168
|
-
...t,
|
|
1169
|
-
nodeType: "placeholder",
|
|
1170
|
-
placeholderVersion: 1,
|
|
1171
|
-
size: e.size,
|
|
1172
|
-
role: e.role,
|
|
1173
|
-
visible: e.visible,
|
|
1174
|
-
...e.assetRevisionId ? { assetRevisionId: e.assetRevisionId } : {},
|
|
1175
|
-
...e.externalRef ? { externalRef: { ...e.externalRef } } : {},
|
|
1176
|
-
...e.semantic ? { semantic: j(e.semantic) } : {}
|
|
1177
|
-
} : e.nodeType === "domain" ? {
|
|
1178
|
-
...t,
|
|
1179
|
-
nodeType: "domain",
|
|
1180
|
-
domainId: e.domainId,
|
|
1181
|
-
dataVersion: e.dataVersion,
|
|
1182
|
-
payload: je(e.payload),
|
|
1183
|
-
visible: e.visible,
|
|
1184
|
-
selectable: e.selectable,
|
|
1185
|
-
...e.bounds ? { bounds: { min: e.bounds.min, max: e.bounds.max } } : {},
|
|
1186
|
-
...e.semantic ? { semantic: j(e.semantic) } : {}
|
|
1187
|
-
} : {
|
|
1188
|
-
...t,
|
|
1189
|
-
nodeType: "asset",
|
|
1190
|
-
assetRevisionId: e.assetRevisionId,
|
|
1191
|
-
role: e.role,
|
|
1192
|
-
visible: e.visible,
|
|
1193
|
-
variantSelections: q(e.variantSelections),
|
|
1194
|
-
...e.appearance ? { appearance: { ...e.appearance } } : {},
|
|
1195
|
-
physics: Ss(e.physics),
|
|
1196
|
-
...e.initialPose ? { initialPose: { joints: q(e.initialPose.joints) } } : {},
|
|
1197
|
-
...e.semantic ? { semantic: j(e.semantic) } : {}
|
|
1198
|
-
};
|
|
1199
|
-
}
|
|
1200
|
-
function ms(e) {
|
|
1201
|
-
return Object.fromEntries(
|
|
1202
|
-
Object.entries(e).sort(([t], [s]) => t.localeCompare(s)).map(([t, s]) => [
|
|
1203
|
-
t,
|
|
1204
|
-
{
|
|
1205
|
-
dataVersion: s.dataVersion,
|
|
1206
|
-
data: je(s.data)
|
|
1207
|
-
}
|
|
1208
|
-
])
|
|
1209
|
-
);
|
|
1210
|
-
}
|
|
1211
|
-
function hs(e) {
|
|
1212
|
-
return {
|
|
1213
|
-
...e,
|
|
1214
|
-
resources: [...e.resources].map((t) => ({
|
|
1215
|
-
...t,
|
|
1216
|
-
locator: R(t.locator)
|
|
1217
|
-
})).sort((t, s) => m(t.locator).localeCompare(m(s.locator)) || t.resourceId.localeCompare(s.resourceId)),
|
|
1218
|
-
suggestedScale: e.suggestedScale,
|
|
1219
|
-
...e.bounds ? { bounds: { min: e.bounds.min, max: e.bounds.max } } : {},
|
|
1220
|
-
...e.metrics ? { metrics: { ...e.metrics } } : {},
|
|
1221
|
-
provenance: { ...e.provenance }
|
|
1222
|
-
};
|
|
1223
|
-
}
|
|
1224
|
-
function ys(e) {
|
|
1225
|
-
return {
|
|
1226
|
-
...e,
|
|
1227
|
-
resources: [...e.resources].map((t) => ({
|
|
1228
|
-
...t,
|
|
1229
|
-
locator: R(t.locator)
|
|
1230
|
-
})).sort((t, s) => m(t.locator).localeCompare(m(s.locator)) || t.resourceId.localeCompare(s.resourceId)),
|
|
1231
|
-
variantSets: [...e.variantSets].map((t) => ({
|
|
1232
|
-
...t,
|
|
1233
|
-
options: [...new Set(t.options)].sort()
|
|
1234
|
-
})).sort((t, s) => t.name.localeCompare(s.name)),
|
|
1235
|
-
...e.hints ? {
|
|
1236
|
-
hints: {
|
|
1237
|
-
...e.hints,
|
|
1238
|
-
...e.hints.tags ? { tags: [...new Set(e.hints.tags)].sort() } : {}
|
|
1239
|
-
}
|
|
1240
|
-
} : {},
|
|
1241
|
-
...e.semantic ? { semantic: j(e.semantic) } : {},
|
|
1242
|
-
provenance: {
|
|
1243
|
-
...e.provenance,
|
|
1244
|
-
...e.provenance.externalRef ? { externalRef: { ...e.provenance.externalRef } } : {},
|
|
1245
|
-
repairs: [...e.provenance.repairs].sort((t, s) => t.at.localeCompare(s.at) || t.kind.localeCompare(s.kind) || t.detail.localeCompare(s.detail))
|
|
1246
|
-
}
|
|
1247
|
-
};
|
|
1248
|
-
}
|
|
1249
|
-
function gs(e) {
|
|
1250
|
-
return {
|
|
1251
|
-
rendering: {
|
|
1252
|
-
...e.rendering,
|
|
1253
|
-
background: { ...e.rendering.background }
|
|
1254
|
-
},
|
|
1255
|
-
physics: {
|
|
1256
|
-
...e.physics,
|
|
1257
|
-
gravity: e.physics.gravity,
|
|
1258
|
-
solver: { ...e.physics.solver }
|
|
1259
|
-
}
|
|
1260
|
-
};
|
|
1261
|
-
}
|
|
1262
|
-
function j(e) {
|
|
1263
|
-
return {
|
|
1264
|
-
...e,
|
|
1265
|
-
...e.labels ? { labels: Y(e.labels) } : {},
|
|
1266
|
-
...e.taxonomy ? { taxonomy: Y(e.taxonomy) } : {},
|
|
1267
|
-
...e.tags ? { tags: Y(e.tags) } : {},
|
|
1268
|
-
...e.attributes ? { attributes: q(e.attributes) } : {}
|
|
1269
|
-
};
|
|
1270
|
-
}
|
|
1271
|
-
function Is(e) {
|
|
1272
|
-
return {
|
|
1273
|
-
...j(e),
|
|
1274
|
-
...e.task ? {
|
|
1275
|
-
task: {
|
|
1276
|
-
...e.task,
|
|
1277
|
-
...e.task.tags ? { tags: Y(e.task.tags) } : {}
|
|
1278
|
-
}
|
|
1279
|
-
} : {},
|
|
1280
|
-
...e.annotations ? { annotations: [...e.annotations].map(vs).sort((t, s) => t.annotationId.localeCompare(s.annotationId)) } : {}
|
|
1281
|
-
};
|
|
1282
|
-
}
|
|
1283
|
-
function vs(e) {
|
|
1284
|
-
return {
|
|
1285
|
-
...e,
|
|
1286
|
-
targetNodeIds: Y(e.targetNodeIds),
|
|
1287
|
-
...e.attributes ? { attributes: q(e.attributes) } : {}
|
|
1288
|
-
};
|
|
1289
|
-
}
|
|
1290
|
-
function Ss(e) {
|
|
1291
|
-
return {
|
|
1292
|
-
...e,
|
|
1293
|
-
...e.colliderPrimPaths ? { colliderPrimPaths: Y(e.colliderPrimPaths) } : {},
|
|
1294
|
-
...e.physicsMaterial ? { physicsMaterial: { ...e.physicsMaterial } } : {},
|
|
1295
|
-
...e.jointOverrides ? {
|
|
1296
|
-
jointOverrides: [...e.jointOverrides].map((t) => ({ ...t })).sort((t, s) => t.jointPrimPath.localeCompare(s.jointPrimPath))
|
|
1297
|
-
} : {}
|
|
1298
|
-
};
|
|
1299
|
-
}
|
|
1300
|
-
function Y(e) {
|
|
1301
|
-
return [...new Set(e)].sort();
|
|
1302
|
-
}
|
|
1303
|
-
function q(e) {
|
|
1304
|
-
return Object.fromEntries(Object.entries(e).sort(([t], [s]) => t.localeCompare(s)));
|
|
1305
|
-
}
|
|
1306
|
-
function bs(e) {
|
|
1307
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1308
|
-
}
|
|
1309
|
-
class Ar {
|
|
1001
|
+
class Hs {
|
|
1310
1002
|
constructor(t, s = {}) {
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1003
|
+
T(this, "undoStack", []);
|
|
1004
|
+
T(this, "redoStack", []);
|
|
1005
|
+
T(this, "limit");
|
|
1006
|
+
T(this, "mergeWindowMs");
|
|
1007
|
+
T(this, "now");
|
|
1008
|
+
T(this, "timestamp");
|
|
1009
|
+
T(this, "doc");
|
|
1318
1010
|
this.doc = V(t), this.limit = Math.max(1, s.limit ?? 200), this.mergeWindowMs = s.mergeWindowMs ?? 600, this.now = s.now ?? (() => Date.now()), this.timestamp = s.timestamp ?? (() => (/* @__PURE__ */ new Date()).toISOString());
|
|
1319
1011
|
}
|
|
1320
1012
|
get document() {
|
|
@@ -1339,7 +1031,7 @@ class Ar {
|
|
|
1339
1031
|
* document and the history untouched.
|
|
1340
1032
|
*/
|
|
1341
1033
|
apply(t) {
|
|
1342
|
-
const s =
|
|
1034
|
+
const s = q(this.doc, t.payload, this.stamp());
|
|
1343
1035
|
return s.diagnostics.some((r) => r.level === "error") ? { doc: this.doc, diagnostics: s.diagnostics, changed: !1 } : (this.doc = V(s.doc), this.redoStack.length = 0, this.record(t), { doc: this.doc, diagnostics: [], changed: !0 });
|
|
1344
1036
|
}
|
|
1345
1037
|
/** Applies several commands as one atomic step. */
|
|
@@ -1347,7 +1039,7 @@ class Ar {
|
|
|
1347
1039
|
if (t.length === 0) return { doc: this.doc, diagnostics: [], changed: !1 };
|
|
1348
1040
|
let s = this.doc;
|
|
1349
1041
|
for (const o of t) {
|
|
1350
|
-
const n =
|
|
1042
|
+
const n = q(s, o.payload, this.stamp());
|
|
1351
1043
|
if (n.diagnostics.length > 0)
|
|
1352
1044
|
return { doc: this.doc, diagnostics: n.diagnostics, changed: !1 };
|
|
1353
1045
|
s = n.doc;
|
|
@@ -1366,7 +1058,7 @@ class Ar {
|
|
|
1366
1058
|
if (!t) return { doc: this.doc, diagnostics: [], changed: !1 };
|
|
1367
1059
|
let s = this.doc;
|
|
1368
1060
|
for (const r of [...t.commands].reverse()) {
|
|
1369
|
-
const o =
|
|
1061
|
+
const o = es(r);
|
|
1370
1062
|
if (!o)
|
|
1371
1063
|
return this.undoStack.push(t), {
|
|
1372
1064
|
doc: this.doc,
|
|
@@ -1377,7 +1069,7 @@ class Ar {
|
|
|
1377
1069
|
}],
|
|
1378
1070
|
changed: !1
|
|
1379
1071
|
};
|
|
1380
|
-
const n =
|
|
1072
|
+
const n = q(s, o, this.stamp());
|
|
1381
1073
|
if (n.diagnostics.length > 0)
|
|
1382
1074
|
return this.undoStack.push(t), { doc: this.doc, diagnostics: n.diagnostics, changed: !1 };
|
|
1383
1075
|
s = n.doc;
|
|
@@ -1389,7 +1081,7 @@ class Ar {
|
|
|
1389
1081
|
if (!t) return { doc: this.doc, diagnostics: [], changed: !1 };
|
|
1390
1082
|
let s = this.doc;
|
|
1391
1083
|
for (const r of t.commands) {
|
|
1392
|
-
const o =
|
|
1084
|
+
const o = q(s, r.payload, this.stamp());
|
|
1393
1085
|
if (o.diagnostics.length > 0)
|
|
1394
1086
|
return this.redoStack.push(t), { doc: this.doc, diagnostics: o.diagnostics, changed: !1 };
|
|
1395
1087
|
s = o.doc;
|
|
@@ -1417,7 +1109,7 @@ class Ar {
|
|
|
1417
1109
|
t > 0 && this.undoStack.splice(0, t);
|
|
1418
1110
|
}
|
|
1419
1111
|
}
|
|
1420
|
-
function
|
|
1112
|
+
function es(e) {
|
|
1421
1113
|
const t = e.payload;
|
|
1422
1114
|
switch (t.type) {
|
|
1423
1115
|
case "node.add":
|
|
@@ -1523,40 +1215,40 @@ function Es(e) {
|
|
|
1523
1215
|
return null;
|
|
1524
1216
|
}
|
|
1525
1217
|
}
|
|
1526
|
-
const
|
|
1527
|
-
function
|
|
1218
|
+
const ts = /^[a-f0-9]{64}$/;
|
|
1219
|
+
function Ke(e) {
|
|
1528
1220
|
var c;
|
|
1529
|
-
const t = e.files.map((
|
|
1530
|
-
locator:
|
|
1531
|
-
sha256:
|
|
1532
|
-
mediaType:
|
|
1533
|
-
byteSize:
|
|
1534
|
-
})).sort((
|
|
1535
|
-
if (!t.some((
|
|
1221
|
+
const t = e.files.map((u) => ({
|
|
1222
|
+
locator: $(u.locator),
|
|
1223
|
+
sha256: u.sha256.toLowerCase(),
|
|
1224
|
+
mediaType: u.mediaType,
|
|
1225
|
+
byteSize: u.byteSize
|
|
1226
|
+
})).sort((u, a) => m(u.locator).localeCompare(m(a.locator))), s = $(e.entryLocator), r = m(s);
|
|
1227
|
+
if (!t.some((u) => m(u.locator) === r))
|
|
1536
1228
|
throw new Error(`Source entry is missing from its file set: ${r}`);
|
|
1537
|
-
if (t.some((
|
|
1229
|
+
if (t.some((u) => !ts.test(u.sha256)))
|
|
1538
1230
|
throw new Error("Source file SHA-256 values must be lower-case 64-character hashes.");
|
|
1539
|
-
const o = new Set(t.map((
|
|
1540
|
-
for (const
|
|
1231
|
+
const o = new Set(t.map((u) => m(u.locator))), n = /* @__PURE__ */ new Map();
|
|
1232
|
+
for (const u of e.dependencies ?? []) {
|
|
1541
1233
|
const a = {
|
|
1542
|
-
from:
|
|
1543
|
-
to:
|
|
1544
|
-
kind:
|
|
1234
|
+
from: $(u.from),
|
|
1235
|
+
to: $(u.to),
|
|
1236
|
+
kind: u.kind
|
|
1545
1237
|
};
|
|
1546
1238
|
n.set(
|
|
1547
1239
|
`${m(a.from)}\0${m(a.to)}\0${a.kind}`,
|
|
1548
1240
|
a
|
|
1549
1241
|
);
|
|
1550
1242
|
}
|
|
1551
|
-
const i = [...n.values()].sort(
|
|
1552
|
-
for (const
|
|
1553
|
-
const a = m(
|
|
1243
|
+
const i = [...n.values()].sort(rs);
|
|
1244
|
+
for (const u of i) {
|
|
1245
|
+
const a = m(u.from), f = m(u.to);
|
|
1554
1246
|
if (!o.has(a) || !o.has(f))
|
|
1555
1247
|
throw new Error(`Source dependency edge references an unknown file: ${a} -> ${f}`);
|
|
1556
1248
|
}
|
|
1557
1249
|
const l = ((c = e.declaredSubresource) == null ? void 0 : c.trim()) || r;
|
|
1558
1250
|
return {
|
|
1559
|
-
sourceRevisionId: N(
|
|
1251
|
+
sourceRevisionId: N(U({
|
|
1560
1252
|
sourceFormat: e.sourceFormat,
|
|
1561
1253
|
entryLocator: s,
|
|
1562
1254
|
files: t,
|
|
@@ -1570,23 +1262,23 @@ function et(e) {
|
|
|
1570
1262
|
declaredSubresource: l
|
|
1571
1263
|
};
|
|
1572
1264
|
}
|
|
1573
|
-
function
|
|
1574
|
-
const t =
|
|
1265
|
+
function Ye(e) {
|
|
1266
|
+
const t = ss(e.runtimeRevision);
|
|
1575
1267
|
return {
|
|
1576
|
-
interpretationRevisionId: N(
|
|
1268
|
+
interpretationRevisionId: N(U({
|
|
1577
1269
|
sourceRevisionId: e.sourceRevisionId,
|
|
1578
1270
|
adapter: e.adapter,
|
|
1579
1271
|
normalization: e.normalization,
|
|
1580
1272
|
facts: t,
|
|
1581
|
-
variantPayloads:
|
|
1273
|
+
variantPayloads: De(e.variantPayloads)
|
|
1582
1274
|
})),
|
|
1583
1275
|
adapter: e.adapter,
|
|
1584
1276
|
normalization: e.normalization,
|
|
1585
1277
|
runtimeRevision: e.runtimeRevision,
|
|
1586
|
-
variantPayloads:
|
|
1278
|
+
variantPayloads: De(e.variantPayloads)
|
|
1587
1279
|
};
|
|
1588
1280
|
}
|
|
1589
|
-
function
|
|
1281
|
+
function W(e) {
|
|
1590
1282
|
const t = e.replaceAll("\\", "/");
|
|
1591
1283
|
if (!t || t.startsWith("/") || /^[a-zA-Z]:\//.test(t))
|
|
1592
1284
|
throw new Error(`Package paths must be relative: ${e}`);
|
|
@@ -1599,10 +1291,10 @@ function Z(e) {
|
|
|
1599
1291
|
if (s.length === 0) throw new Error(`Package path is empty: ${e}`);
|
|
1600
1292
|
return s.join("/");
|
|
1601
1293
|
}
|
|
1602
|
-
function
|
|
1603
|
-
return N(
|
|
1294
|
+
function Js(e) {
|
|
1295
|
+
return N(U(e));
|
|
1604
1296
|
}
|
|
1605
|
-
function
|
|
1297
|
+
function ss(e) {
|
|
1606
1298
|
return "visualRevisionId" in e ? {
|
|
1607
1299
|
format: e.format,
|
|
1608
1300
|
capabilities: e.capabilities,
|
|
@@ -1621,7 +1313,7 @@ function Rs(e) {
|
|
|
1621
1313
|
semantic: e.semantic ?? null
|
|
1622
1314
|
};
|
|
1623
1315
|
}
|
|
1624
|
-
function
|
|
1316
|
+
function De(e) {
|
|
1625
1317
|
return Object.fromEntries(
|
|
1626
1318
|
Object.entries(e ?? {}).sort(([t], [s]) => t.localeCompare(s)).map(([t, s]) => [
|
|
1627
1319
|
t,
|
|
@@ -1631,32 +1323,32 @@ function Le(e) {
|
|
|
1631
1323
|
])
|
|
1632
1324
|
);
|
|
1633
1325
|
}
|
|
1634
|
-
function
|
|
1326
|
+
function rs(e, t) {
|
|
1635
1327
|
return m(e.from).localeCompare(m(t.from)) || m(e.to).localeCompare(m(t.to)) || e.kind.localeCompare(t.kind);
|
|
1636
1328
|
}
|
|
1637
|
-
async function
|
|
1638
|
-
var
|
|
1329
|
+
async function os(e, t = {}) {
|
|
1330
|
+
var u;
|
|
1639
1331
|
const s = await Promise.all(e.files.map(async (a) => ({
|
|
1640
|
-
locator:
|
|
1641
|
-
path:
|
|
1332
|
+
locator: $(a.locator),
|
|
1333
|
+
path: k(a.locator),
|
|
1642
1334
|
bytes: new Uint8Array(await a.blob.arrayBuffer())
|
|
1643
|
-
}))), r = new Map(s.map((a) => [a.path, a])), o =
|
|
1335
|
+
}))), r = new Map(s.map((a) => [a.path, a])), o = ht(e);
|
|
1644
1336
|
if (!r.has(o))
|
|
1645
1337
|
throw new Error(`Source entry is missing from its file set: ${o}`);
|
|
1646
1338
|
const n = new Map(
|
|
1647
|
-
s.filter((a) =>
|
|
1648
|
-
), i =
|
|
1339
|
+
s.filter((a) => pe(a.path, a.bytes)).map((a) => [a.path, new TextDecoder("utf-8").decode(a.bytes)])
|
|
1340
|
+
), i = de(
|
|
1649
1341
|
[...n].map(([a, f]) => ({ path: a, text: f })),
|
|
1650
1342
|
new Set(r.keys())
|
|
1651
|
-
), l = /* @__PURE__ */ new Map(),
|
|
1343
|
+
), l = /* @__PURE__ */ new Map(), d = s.map((a) => a.locator);
|
|
1652
1344
|
for (const a of i.references) {
|
|
1653
1345
|
if (a.kind === "material-module") continue;
|
|
1654
1346
|
const f = r.get(a.fromPath);
|
|
1655
1347
|
if (!f) continue;
|
|
1656
|
-
const g =
|
|
1348
|
+
const g = Ce(
|
|
1657
1349
|
f.locator,
|
|
1658
1350
|
a.target,
|
|
1659
|
-
|
|
1351
|
+
d
|
|
1660
1352
|
);
|
|
1661
1353
|
if (!g)
|
|
1662
1354
|
throw new Error(
|
|
@@ -1667,74 +1359,74 @@ async function Ps(e, t = {}) {
|
|
|
1667
1359
|
throw new Error(
|
|
1668
1360
|
`USD source has an unresolved or external reference: ${a.fromPath} -> ${a.target}`
|
|
1669
1361
|
);
|
|
1670
|
-
|
|
1362
|
+
ke(l, {
|
|
1671
1363
|
from: f.locator,
|
|
1672
1364
|
to: h.locator,
|
|
1673
|
-
kind:
|
|
1365
|
+
kind: as(a, n.get(a.fromPath) ?? "")
|
|
1674
1366
|
});
|
|
1675
1367
|
}
|
|
1676
1368
|
const c = r.get(o);
|
|
1677
|
-
if (c && !n.has(o) && s.length > 1 &&
|
|
1369
|
+
if (c && !n.has(o) && s.length > 1 && is(o) && (((u = t.explicitDependencies) == null ? void 0 : u.length) ?? 0) === 0)
|
|
1678
1370
|
for (const a of s)
|
|
1679
|
-
a.path !== o &&
|
|
1371
|
+
a.path !== o && ke(l, {
|
|
1680
1372
|
from: c.locator,
|
|
1681
1373
|
to: a.locator,
|
|
1682
1374
|
kind: "other"
|
|
1683
1375
|
});
|
|
1684
|
-
return [...l.values()].sort(
|
|
1376
|
+
return [...l.values()].sort(cs);
|
|
1685
1377
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const s = new Set(e.map(
|
|
1378
|
+
function ns(e, t) {
|
|
1379
|
+
const s = new Set(e.map(ue)), r = t.filter((o) => !s.has(ue(o)));
|
|
1688
1380
|
if (r.length > 0)
|
|
1689
1381
|
throw new Error(
|
|
1690
1382
|
`Explicit source dependencies omit scanned USD topology: ${r.map((o) => `${m(o.from)} -> ${m(o.to)} (${o.kind})`).join(", ")}`
|
|
1691
1383
|
);
|
|
1692
1384
|
}
|
|
1693
|
-
function
|
|
1694
|
-
e.set(
|
|
1385
|
+
function ke(e, t) {
|
|
1386
|
+
e.set(ue(t), t);
|
|
1695
1387
|
}
|
|
1696
|
-
function
|
|
1388
|
+
function as(e, t) {
|
|
1697
1389
|
if (e.kind === "material-module") return "material-module";
|
|
1698
1390
|
const s = `@${e.target}@`, r = t.indexOf(s);
|
|
1699
1391
|
if (r < 0) return "other";
|
|
1700
1392
|
const o = t.slice(Math.max(0, r - 180), r);
|
|
1701
1393
|
return /\bsubLayers\s*=\s*\[[^\]]*$/is.test(o) ? "sublayer" : /\bpayload\s*=\s*(?:\[[^\]]*)?$/is.test(o) ? "payload" : /\b(?:inputs:file|sourceAsset)\s*=\s*$/is.test(o) ? "texture" : /\breferences\s*=\s*(?:\[[^\]]*)?$/is.test(o) ? "reference" : "other";
|
|
1702
1394
|
}
|
|
1703
|
-
function
|
|
1395
|
+
function ue(e) {
|
|
1704
1396
|
return `${m(e.from)}\0${m(e.to)}\0${e.kind}`;
|
|
1705
1397
|
}
|
|
1706
|
-
function
|
|
1398
|
+
function is(e) {
|
|
1707
1399
|
return /\.(?:usd|usda|usdc|usdz)$/i.test(e);
|
|
1708
1400
|
}
|
|
1709
|
-
function
|
|
1401
|
+
function cs(e, t) {
|
|
1710
1402
|
return m(e.from).localeCompare(m(t.from)) || m(e.to).localeCompare(m(t.to)) || e.kind.localeCompare(t.kind);
|
|
1711
1403
|
}
|
|
1712
|
-
const
|
|
1713
|
-
async function
|
|
1404
|
+
const ls = /^[a-f0-9]{64}$/;
|
|
1405
|
+
async function Qs(e) {
|
|
1714
1406
|
const t = [];
|
|
1715
1407
|
for (const s of e.assets) {
|
|
1716
1408
|
const r = [];
|
|
1717
1409
|
for (const c of s.source.files) {
|
|
1718
|
-
const
|
|
1410
|
+
const u = new Uint8Array(await c.blob.arrayBuffer());
|
|
1719
1411
|
r.push({
|
|
1720
|
-
locator:
|
|
1721
|
-
sha256: N(
|
|
1722
|
-
mediaType:
|
|
1723
|
-
|
|
1412
|
+
locator: $(c.locator),
|
|
1413
|
+
sha256: N(u),
|
|
1414
|
+
mediaType: lt(
|
|
1415
|
+
k(c.locator),
|
|
1724
1416
|
c.blob.type
|
|
1725
|
-
) ??
|
|
1726
|
-
byteSize:
|
|
1417
|
+
) ?? ct,
|
|
1418
|
+
byteSize: u.byteLength
|
|
1727
1419
|
});
|
|
1728
1420
|
}
|
|
1729
|
-
const o = await
|
|
1421
|
+
const o = await os(s.source, {
|
|
1730
1422
|
explicitDependencies: s.dependencies
|
|
1731
1423
|
});
|
|
1732
|
-
s.dependencies !== void 0 &&
|
|
1424
|
+
s.dependencies !== void 0 && ns(
|
|
1733
1425
|
s.dependencies,
|
|
1734
1426
|
o
|
|
1735
1427
|
);
|
|
1736
|
-
const n =
|
|
1737
|
-
sourceFormat: s.sourceFormat ??
|
|
1428
|
+
const n = Ke({
|
|
1429
|
+
sourceFormat: s.sourceFormat ?? ds(s.asset),
|
|
1738
1430
|
entryLocator: s.source.entryLocator,
|
|
1739
1431
|
files: r,
|
|
1740
1432
|
dependencies: s.dependencies ?? o,
|
|
@@ -1746,7 +1438,7 @@ async function _r(e) {
|
|
|
1746
1438
|
upAxis: "visualRevisionId" in s.asset ? s.asset.upAxis : "z",
|
|
1747
1439
|
unitScale: 1,
|
|
1748
1440
|
originPolicy: "source"
|
|
1749
|
-
},
|
|
1441
|
+
}, d = Ye({
|
|
1750
1442
|
sourceRevisionId: n.sourceRevisionId,
|
|
1751
1443
|
adapter: i,
|
|
1752
1444
|
normalization: l,
|
|
@@ -1758,7 +1450,7 @@ async function _r(e) {
|
|
|
1758
1450
|
label: s.asset.label,
|
|
1759
1451
|
kind: "visualRevisionId" in s.asset ? "visual" : "usd",
|
|
1760
1452
|
source: n,
|
|
1761
|
-
interpretation:
|
|
1453
|
+
interpretation: d,
|
|
1762
1454
|
deliveryArtifacts: [...s.deliveryArtifacts ?? []]
|
|
1763
1455
|
});
|
|
1764
1456
|
}
|
|
@@ -1769,20 +1461,20 @@ async function _r(e) {
|
|
|
1769
1461
|
deliveryLocks: [...e.deliveryLocks ?? []].sort((s, r) => s.assetId.localeCompare(r.assetId) || s.profileId.localeCompare(r.profileId) || s.artifactId.localeCompare(r.artifactId))
|
|
1770
1462
|
};
|
|
1771
1463
|
}
|
|
1772
|
-
function
|
|
1773
|
-
if (!
|
|
1464
|
+
function er(e) {
|
|
1465
|
+
if (!C(e) || e.format !== "sim-studio.asset-catalog@3" || e.schemaVersion !== 3 || !Array.isArray(e.entries) || !Array.isArray(e.deliveryLocks))
|
|
1774
1466
|
throw new Error("Asset catalog format or structure is invalid.");
|
|
1775
1467
|
const t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1776
1468
|
for (const r of e.entries) {
|
|
1777
|
-
if (!
|
|
1469
|
+
if (!C(r) || typeof r.assetId != "string" || r.assetId.length === 0 || typeof r.label != "string" || r.kind !== "usd" && r.kind !== "visual" || !C(r.source) || typeof r.source.sourceFormat != "string" || r.source.sourceFormat.length === 0 || !C(r.source.entryLocator) || typeof r.source.declaredSubresource != "string" || !Array.isArray(r.source.files) || !Array.isArray(r.source.dependencies) || !C(r.interpretation) || !C(r.interpretation.runtimeRevision) || !Array.isArray(r.deliveryArtifacts))
|
|
1778
1470
|
throw new Error("Asset catalog entry structure is invalid.");
|
|
1779
1471
|
const o = r;
|
|
1780
1472
|
for (const a of o.source.files)
|
|
1781
|
-
if (!
|
|
1473
|
+
if (!C(a) || !C(a.locator) || typeof a.sha256 != "string" || !ls.test(a.sha256) || typeof a.mediaType != "string" || a.mediaType.length === 0 || typeof a.byteSize != "number" || !Number.isInteger(a.byteSize) || a.byteSize < 0)
|
|
1782
1474
|
throw new Error(`Asset catalog source file facts are invalid: ${o.assetId}.`);
|
|
1783
1475
|
let n;
|
|
1784
1476
|
try {
|
|
1785
|
-
n =
|
|
1477
|
+
n = Ke({
|
|
1786
1478
|
sourceFormat: o.source.sourceFormat,
|
|
1787
1479
|
entryLocator: o.source.entryLocator,
|
|
1788
1480
|
files: o.source.files,
|
|
@@ -1791,7 +1483,7 @@ function Pr(e) {
|
|
|
1791
1483
|
});
|
|
1792
1484
|
} catch (a) {
|
|
1793
1485
|
throw new Error(
|
|
1794
|
-
`Asset catalog source is invalid for ${o.assetId}: ${
|
|
1486
|
+
`Asset catalog source is invalid for ${o.assetId}: ${us(a)}`
|
|
1795
1487
|
);
|
|
1796
1488
|
}
|
|
1797
1489
|
if (n.sourceRevisionId !== o.source.sourceRevisionId)
|
|
@@ -1801,13 +1493,13 @@ function Pr(e) {
|
|
|
1801
1493
|
`Asset catalog repeats sourceRevisionId ${o.source.sourceRevisionId}; node references would be ambiguous.`
|
|
1802
1494
|
);
|
|
1803
1495
|
s.add(o.source.sourceRevisionId);
|
|
1804
|
-
const i = o.interpretation.runtimeRevision, l = "visualRevisionId" in i ? "visual" : "usd",
|
|
1805
|
-
if (o.kind !== l || typeof
|
|
1496
|
+
const i = o.interpretation.runtimeRevision, l = "visualRevisionId" in i ? "visual" : "usd", d = "visualRevisionId" in i ? i.visualRevisionId : i.revisionId;
|
|
1497
|
+
if (o.kind !== l || typeof d != "string" || d.length === 0 || i.assetId !== o.assetId)
|
|
1806
1498
|
throw new Error(`Asset catalog runtime revision is inconsistent: ${o.assetId}.`);
|
|
1807
|
-
const c = `${l}\0${
|
|
1499
|
+
const c = `${l}\0${d}`;
|
|
1808
1500
|
if (t.has(c))
|
|
1809
|
-
throw new Error(`Asset catalog repeats runtime revision ${
|
|
1810
|
-
if (t.add(c),
|
|
1501
|
+
throw new Error(`Asset catalog repeats runtime revision ${d}.`);
|
|
1502
|
+
if (t.add(c), Ye({
|
|
1811
1503
|
sourceRevisionId: o.source.sourceRevisionId,
|
|
1812
1504
|
adapter: o.interpretation.adapter,
|
|
1813
1505
|
normalization: o.interpretation.normalization,
|
|
@@ -1819,22 +1511,22 @@ function Pr(e) {
|
|
|
1819
1511
|
);
|
|
1820
1512
|
}
|
|
1821
1513
|
}
|
|
1822
|
-
function
|
|
1514
|
+
function tr(e, t) {
|
|
1823
1515
|
return e.entries.find((s) => {
|
|
1824
1516
|
const r = s.interpretation.runtimeRevision;
|
|
1825
1517
|
return "visualRevisionId" in t ? "visualRevisionId" in r && r.visualRevisionId === t.visualRevisionId : "revisionId" in r && r.revisionId === t.revisionId;
|
|
1826
1518
|
}) ?? null;
|
|
1827
1519
|
}
|
|
1828
|
-
function
|
|
1520
|
+
function ds(e) {
|
|
1829
1521
|
return "visualRevisionId" in e ? e.format : e.fileKind;
|
|
1830
1522
|
}
|
|
1831
|
-
function
|
|
1523
|
+
function C(e) {
|
|
1832
1524
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1833
1525
|
}
|
|
1834
|
-
function
|
|
1526
|
+
function us(e) {
|
|
1835
1527
|
return e instanceof Error ? e.message : String(e);
|
|
1836
1528
|
}
|
|
1837
|
-
const
|
|
1529
|
+
const sr = Object.freeze({
|
|
1838
1530
|
format: "sim-studio.delivery-profile@1",
|
|
1839
1531
|
schemaVersion: 1,
|
|
1840
1532
|
profileId: "isaac-sim",
|
|
@@ -1853,10 +1545,10 @@ const wr = Object.freeze({
|
|
|
1853
1545
|
},
|
|
1854
1546
|
visualArtifactPolicy: "require-resolved-artifact"
|
|
1855
1547
|
});
|
|
1856
|
-
function
|
|
1857
|
-
return
|
|
1548
|
+
function fs(e) {
|
|
1549
|
+
return We(e), N(U(e));
|
|
1858
1550
|
}
|
|
1859
|
-
function
|
|
1551
|
+
function We(e) {
|
|
1860
1552
|
if (e.format !== "sim-studio.delivery-profile@1" || e.schemaVersion !== 1)
|
|
1861
1553
|
throw new Error("Unsupported delivery profile format.");
|
|
1862
1554
|
if (e.target !== "isaac-sim") throw new Error(`Unsupported delivery target: ${e.target}.`);
|
|
@@ -1869,45 +1561,45 @@ function st(e) {
|
|
|
1869
1561
|
if (e.visualArtifactPolicy !== "require-resolved-artifact")
|
|
1870
1562
|
throw new Error("M1 visual nodes require resolved delivery artifacts.");
|
|
1871
1563
|
}
|
|
1872
|
-
const
|
|
1873
|
-
function
|
|
1564
|
+
const ps = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
1565
|
+
function ms(e) {
|
|
1874
1566
|
const t = [...e].sort((i, l) => w(i.instanceId, l.instanceId)), s = /* @__PURE__ */ new Set(["World", "PhysicsScene"]), r = /* @__PURE__ */ new Map(), o = [];
|
|
1875
1567
|
let n = 0;
|
|
1876
1568
|
for (const i of t) {
|
|
1877
|
-
const l =
|
|
1878
|
-
s.add(
|
|
1569
|
+
const l = j(i.label), d = l === null, c = l ?? `Instance${n += 1}`, u = hs(c, s);
|
|
1570
|
+
s.add(u), r.set(i.instanceId, u), u !== i.label && o.push({ instanceId: i.instanceId, from: i.label, to: u, fallback: d });
|
|
1879
1571
|
}
|
|
1880
1572
|
return { byInstanceId: r, renames: o };
|
|
1881
1573
|
}
|
|
1882
|
-
function
|
|
1574
|
+
function j(e) {
|
|
1883
1575
|
const t = Array.from(e.normalize("NFKC")).map((r) => /[A-Za-z0-9_]/.test(r) ? r : "_").join("").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
|
|
1884
1576
|
if (!t) return null;
|
|
1885
1577
|
const s = /^[0-9]/.test(t) ? `_${t}` : t;
|
|
1886
|
-
return
|
|
1578
|
+
return ps.test(s) ? s : null;
|
|
1887
1579
|
}
|
|
1888
|
-
function
|
|
1580
|
+
function Ge(e, t) {
|
|
1889
1581
|
const s = Array.from(e.normalize("NFKC")).map((o) => /[A-Za-z0-9]/.test(o) ? o.toLowerCase() : "-").join("").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
1890
1582
|
return s && /[a-z]/.test(s) ? s : `asset-${t.replace(/[^a-zA-Z0-9]/g, "").toLowerCase().replace(/^asset/, "") || "item"}`;
|
|
1891
1583
|
}
|
|
1892
|
-
function
|
|
1584
|
+
function hs(e, t) {
|
|
1893
1585
|
if (!t.has(e)) return e;
|
|
1894
1586
|
let s = 2;
|
|
1895
1587
|
for (; t.has(`${e}_${s}`); ) s += 1;
|
|
1896
1588
|
return `${e}_${s}`;
|
|
1897
1589
|
}
|
|
1898
|
-
const
|
|
1899
|
-
function
|
|
1900
|
-
|
|
1590
|
+
const ys = "sim-studio.usd-delivery-plan@4", Ne = /^[a-f0-9]{64}$/;
|
|
1591
|
+
function Xe(e) {
|
|
1592
|
+
Ze(e);
|
|
1901
1593
|
const { planDigest: t, ...s } = e;
|
|
1902
|
-
return N(
|
|
1594
|
+
return N(U(s));
|
|
1903
1595
|
}
|
|
1904
|
-
function
|
|
1905
|
-
if (
|
|
1596
|
+
function rr(e) {
|
|
1597
|
+
if (Ze(e), !Ne.test(e.planDigest))
|
|
1906
1598
|
throw Object.assign(
|
|
1907
1599
|
new Error("USD delivery plan digest must be a lowercase SHA-256 value."),
|
|
1908
1600
|
{ code: "USD_DELIVERY_PLAN_DIGEST_INVALID" }
|
|
1909
1601
|
);
|
|
1910
|
-
const t =
|
|
1602
|
+
const t = Xe(e);
|
|
1911
1603
|
if (e.planDigest !== t)
|
|
1912
1604
|
throw Object.assign(
|
|
1913
1605
|
new Error("USD delivery plan content does not match planDigest."),
|
|
@@ -1920,14 +1612,14 @@ function $r(e) {
|
|
|
1920
1612
|
}
|
|
1921
1613
|
);
|
|
1922
1614
|
if (!Array.isArray(e.resources))
|
|
1923
|
-
throw
|
|
1615
|
+
throw x("USD delivery plan resources must be an array.");
|
|
1924
1616
|
const s = /* @__PURE__ */ new Map();
|
|
1925
1617
|
for (const r of e.resources) {
|
|
1926
|
-
if (!r || typeof r != "object" || typeof r.outputPath != "string" || !
|
|
1927
|
-
throw
|
|
1618
|
+
if (!r || typeof r != "object" || typeof r.outputPath != "string" || !Ne.test(String(r.sourceSha256)) || !Number.isSafeInteger(r.sourceByteSize) || r.sourceByteSize < 0)
|
|
1619
|
+
throw x("USD delivery plan contains invalid resource facts.");
|
|
1928
1620
|
const o = r.outputPath;
|
|
1929
|
-
if (!
|
|
1930
|
-
throw
|
|
1621
|
+
if (!gs(o))
|
|
1622
|
+
throw x(`USD delivery plan contains unsafe resource path: ${o}.`);
|
|
1931
1623
|
const n = o.toLowerCase(), i = s.get(n);
|
|
1932
1624
|
if (i !== void 0)
|
|
1933
1625
|
throw Object.assign(
|
|
@@ -1939,49 +1631,49 @@ function $r(e) {
|
|
|
1939
1631
|
s.set(n, o);
|
|
1940
1632
|
const l = r.outputTransform;
|
|
1941
1633
|
if (!l || typeof l != "object" || l.kind !== "identity" && l.kind !== "canonicalize-usdz")
|
|
1942
|
-
throw
|
|
1634
|
+
throw x(
|
|
1943
1635
|
`USD delivery plan contains an invalid outputTransform for resource: ${o}.`
|
|
1944
1636
|
);
|
|
1945
1637
|
if (o.toLowerCase().endsWith(".usdz") && l.kind !== "canonicalize-usdz")
|
|
1946
|
-
throw
|
|
1638
|
+
throw x(
|
|
1947
1639
|
`USD delivery plan must canonicalize nested USDZ resource: ${o}.`
|
|
1948
1640
|
);
|
|
1949
1641
|
if (!o.toLowerCase().endsWith(".usdz") && l.kind === "canonicalize-usdz")
|
|
1950
|
-
throw
|
|
1642
|
+
throw x(
|
|
1951
1643
|
`USD delivery plan cannot canonicalize a non-USDZ resource: ${o}.`
|
|
1952
1644
|
);
|
|
1953
1645
|
}
|
|
1954
1646
|
if (e.outcome !== "blocked" && Array.isArray(e.diagnostics) && e.diagnostics.some((r) => r.severity === "error"))
|
|
1955
|
-
throw
|
|
1647
|
+
throw x("A supported or degraded USD delivery plan cannot contain error diagnostics.");
|
|
1956
1648
|
}
|
|
1957
|
-
function
|
|
1958
|
-
if (!e || typeof e != "object" || !("format" in e) || e.format !==
|
|
1649
|
+
function Ze(e) {
|
|
1650
|
+
if (!e || typeof e != "object" || !("format" in e) || e.format !== ys || !("schemaVersion" in e) || e.schemaVersion !== 4)
|
|
1959
1651
|
throw Object.assign(
|
|
1960
1652
|
new Error("USD delivery plan must use format sim-studio.usd-delivery-plan@4 schemaVersion 4."),
|
|
1961
1653
|
{ code: "UNSUPPORTED_USD_DELIVERY_PLAN_FORMAT" }
|
|
1962
1654
|
);
|
|
1963
1655
|
}
|
|
1964
|
-
function
|
|
1656
|
+
function gs(e) {
|
|
1965
1657
|
return !e || e.startsWith("/") || e.includes("\\") || /^[A-Za-z]:/.test(e) || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : e.split("/").every((t) => t.length > 0 && t !== "." && t !== "..");
|
|
1966
1658
|
}
|
|
1967
|
-
function
|
|
1659
|
+
function x(e) {
|
|
1968
1660
|
return Object.assign(new Error(e), {
|
|
1969
1661
|
code: "USD_DELIVERY_PLAN_CONTRACT_INVALID"
|
|
1970
1662
|
});
|
|
1971
1663
|
}
|
|
1972
|
-
function
|
|
1973
|
-
|
|
1664
|
+
function or(e) {
|
|
1665
|
+
We(e.profile);
|
|
1974
1666
|
const t = [], s = /* @__PURE__ */ new Map(), r = new Map(e.assetCatalog.entries.map((a) => [
|
|
1975
1667
|
a.source.sourceRevisionId,
|
|
1976
1668
|
a
|
|
1977
|
-
])), o =
|
|
1978
|
-
|
|
1669
|
+
])), o = J(
|
|
1670
|
+
fe(e.document.root).filter((a) => a.nodeType === "group" || a.nodeType === "asset" || a.nodeType === "visual"),
|
|
1979
1671
|
(a, f) => w(a.nodeId, f.nodeId)
|
|
1980
|
-
), n =
|
|
1672
|
+
), n = ms(o.filter((a) => a.nodeId !== e.document.root.nodeId).map((a) => ({
|
|
1981
1673
|
instanceId: a.nodeId,
|
|
1982
1674
|
label: a.label
|
|
1983
1675
|
})));
|
|
1984
|
-
for (const a of
|
|
1676
|
+
for (const a of fe(e.document.root))
|
|
1985
1677
|
a.nodeType === "placeholder" ? t.push(v(
|
|
1986
1678
|
"USD_DELIVERY_PLACEHOLDER_BLOCKED",
|
|
1987
1679
|
"error",
|
|
@@ -1994,27 +1686,27 @@ function Nr(e) {
|
|
|
1994
1686
|
a.nodeId
|
|
1995
1687
|
));
|
|
1996
1688
|
const l = ((a, f, g = !1) => {
|
|
1997
|
-
const p = `/${g ? e.profile.stage.defaultPrim : n.byInstanceId.get(a.nodeId) ??
|
|
1998
|
-
a.children.filter((
|
|
1999
|
-
(
|
|
2000
|
-
).flatMap((
|
|
1689
|
+
const p = `/${g ? e.profile.stage.defaultPrim : n.byInstanceId.get(a.nodeId) ?? j(a.label) ?? "Group"}`, I = J(
|
|
1690
|
+
a.children.filter((R) => R.nodeType === "group" || R.nodeType === "asset" || R.nodeType === "visual"),
|
|
1691
|
+
(R, _) => w(R.nodeId, _.nodeId)
|
|
1692
|
+
).flatMap((R) => qe(R, p, e, t, s, r, n.byInstanceId));
|
|
2001
1693
|
return {
|
|
2002
1694
|
nodeId: a.nodeId,
|
|
2003
1695
|
primPath: p,
|
|
2004
1696
|
nodeKind: "group",
|
|
2005
1697
|
typeName: "Xform",
|
|
2006
|
-
attributes:
|
|
2007
|
-
...
|
|
1698
|
+
attributes: re(a.localTransform),
|
|
1699
|
+
...oe(a),
|
|
2008
1700
|
visible: !0,
|
|
2009
1701
|
children: I
|
|
2010
1702
|
};
|
|
2011
1703
|
})(e.document.root, "/", !0);
|
|
2012
|
-
|
|
2013
|
-
const
|
|
1704
|
+
Ps(r, s, t), _s(s, t);
|
|
1705
|
+
const d = Cs(t), c = bs(e.document.environment.physics.gravity), u = {
|
|
2014
1706
|
format: "sim-studio.usd-delivery-plan@4",
|
|
2015
1707
|
schemaVersion: 4,
|
|
2016
1708
|
sourcePackageDigest: e.sourcePackageDigest,
|
|
2017
|
-
profileDigest:
|
|
1709
|
+
profileDigest: fs(e.profile),
|
|
2018
1710
|
profile: {
|
|
2019
1711
|
profileId: e.profile.profileId,
|
|
2020
1712
|
profileVersion: e.profile.profileVersion
|
|
@@ -2027,36 +1719,36 @@ function Nr(e) {
|
|
|
2027
1719
|
physicsScene: c
|
|
2028
1720
|
},
|
|
2029
1721
|
nodes: [l],
|
|
2030
|
-
resources:
|
|
2031
|
-
diagnostics:
|
|
2032
|
-
outcome:
|
|
1722
|
+
resources: J([...s.values()], (a, f) => w(a.outputPath, f.outputPath) || w(a.sourceSha256, f.sourceSha256)),
|
|
1723
|
+
diagnostics: xs(t),
|
|
1724
|
+
outcome: d
|
|
2033
1725
|
};
|
|
2034
1726
|
return {
|
|
2035
|
-
...
|
|
2036
|
-
planDigest:
|
|
1727
|
+
...u,
|
|
1728
|
+
planDigest: Xe(u)
|
|
2037
1729
|
};
|
|
2038
1730
|
}
|
|
2039
|
-
function
|
|
2040
|
-
const l = `/${s.profile.stage.defaultPrim}/PhysicsScene`,
|
|
2041
|
-
if ((t === "/" ? `/${
|
|
1731
|
+
function qe(e, t, s, r, o, n, i) {
|
|
1732
|
+
const l = `/${s.profile.stage.defaultPrim}/PhysicsScene`, d = i.get(e.nodeId) ?? j(e.label);
|
|
1733
|
+
if ((t === "/" ? `/${d ?? "Node"}` : `${t}/${d ?? "Node"}`) === l && r.push(v(
|
|
2042
1734
|
"USD_EXPORT_PHYSICS_SCENE_NAME_CONFLICT",
|
|
2043
1735
|
"error",
|
|
2044
1736
|
`Node ${e.label} collides with the required root PhysicsScene prim.`,
|
|
2045
1737
|
e.nodeId
|
|
2046
1738
|
)), e.nodeType === "group") {
|
|
2047
|
-
const
|
|
1739
|
+
const u = i.get(e.nodeId) ?? j(e.label) ?? "Group", a = t === "/" ? `/${u}` : `${t}/${u}`;
|
|
2048
1740
|
return [{
|
|
2049
1741
|
nodeId: e.nodeId,
|
|
2050
1742
|
primPath: a,
|
|
2051
1743
|
nodeKind: "group",
|
|
2052
1744
|
typeName: "Xform",
|
|
2053
|
-
attributes:
|
|
2054
|
-
...
|
|
1745
|
+
attributes: re(e.localTransform),
|
|
1746
|
+
...oe(e),
|
|
2055
1747
|
visible: !0,
|
|
2056
|
-
children: e.children.flatMap((f) =>
|
|
1748
|
+
children: e.children.flatMap((f) => qe(f, a, s, r, o, n, i))
|
|
2057
1749
|
}];
|
|
2058
1750
|
}
|
|
2059
|
-
return e.nodeType === "asset" ?
|
|
1751
|
+
return e.nodeType === "asset" ? Is(
|
|
2060
1752
|
e,
|
|
2061
1753
|
t,
|
|
2062
1754
|
s,
|
|
@@ -2064,7 +1756,7 @@ function at(e, t, s, r, o, n, i) {
|
|
|
2064
1756
|
o,
|
|
2065
1757
|
n,
|
|
2066
1758
|
i
|
|
2067
|
-
) : e.nodeType === "visual" ?
|
|
1759
|
+
) : e.nodeType === "visual" ? vs(
|
|
2068
1760
|
e,
|
|
2069
1761
|
t,
|
|
2070
1762
|
s,
|
|
@@ -2074,9 +1766,9 @@ function at(e, t, s, r, o, n, i) {
|
|
|
2074
1766
|
i
|
|
2075
1767
|
) : [];
|
|
2076
1768
|
}
|
|
2077
|
-
function
|
|
2078
|
-
const l =
|
|
2079
|
-
if (!l || !
|
|
1769
|
+
function Is(e, t, s, r, o, n, i) {
|
|
1770
|
+
const l = ut(s.document, e.assetRevisionId), d = l ? He(s.assetCatalog, l) : null;
|
|
1771
|
+
if (!l || !d)
|
|
2080
1772
|
return r.push(v(
|
|
2081
1773
|
"USD_DELIVERY_ASSET_SOURCE_MISSING",
|
|
2082
1774
|
"error",
|
|
@@ -2084,51 +1776,51 @@ function Vs(e, t, s, r, o, n, i) {
|
|
|
2084
1776
|
e.nodeId,
|
|
2085
1777
|
e.assetRevisionId
|
|
2086
1778
|
)), [];
|
|
2087
|
-
const c =
|
|
1779
|
+
const c = Es(e, d, s.profile.variants.preferred, r);
|
|
2088
1780
|
if (!c.ok) return [];
|
|
2089
|
-
const
|
|
2090
|
-
|
|
2091
|
-
const f =
|
|
1781
|
+
const u = i.get(e.nodeId) ?? j(e.label) ?? "Asset", a = t === "/" ? `/${u}` : `${t}/${u}`;
|
|
1782
|
+
Je(e, a, r);
|
|
1783
|
+
const f = As(e, a, d, r);
|
|
2092
1784
|
if (!f) return [];
|
|
2093
|
-
const g =
|
|
1785
|
+
const g = $(d.source.entryLocator);
|
|
2094
1786
|
if (g.kind === "remote-url")
|
|
2095
1787
|
return r.push(v(
|
|
2096
1788
|
"USD_EXPORT_REMOTE_NATIVE_REFERENCE_BLOCKED",
|
|
2097
1789
|
"error",
|
|
2098
1790
|
`Asset node ${e.label} uses a remote native USD source. Offline USD export requires a closed local resource set.`,
|
|
2099
1791
|
e.nodeId,
|
|
2100
|
-
|
|
1792
|
+
d.assetId
|
|
2101
1793
|
)), [];
|
|
2102
|
-
const h = `assets/${
|
|
2103
|
-
for (const
|
|
2104
|
-
|
|
1794
|
+
const h = `assets/${Ge(d.label, d.assetId)}/${d.source.sourceRevisionId.slice(0, 16)}`, p = Ds(d, g), I = `${h}/${p}`, R = m(g);
|
|
1795
|
+
for (const _ of d.source.files)
|
|
1796
|
+
Ns(
|
|
2105
1797
|
o,
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
`${h}/${m(
|
|
1798
|
+
d,
|
|
1799
|
+
_,
|
|
1800
|
+
`${h}/${m(_.locator) === R ? p : F(_.locator)}`
|
|
2109
1801
|
);
|
|
2110
1802
|
return [{
|
|
2111
1803
|
nodeId: e.nodeId,
|
|
2112
1804
|
primPath: a,
|
|
2113
1805
|
nodeKind: "reference",
|
|
2114
1806
|
typeName: "Xform",
|
|
2115
|
-
assetId:
|
|
2116
|
-
sourceRevisionId:
|
|
1807
|
+
assetId: d.assetId,
|
|
1808
|
+
sourceRevisionId: d.source.sourceRevisionId,
|
|
2117
1809
|
reference: {
|
|
2118
1810
|
assetPath: `./${I}`,
|
|
2119
1811
|
...c.selections ? { variantSelections: c.selections } : {}
|
|
2120
1812
|
},
|
|
2121
|
-
attributes:
|
|
2122
|
-
...
|
|
1813
|
+
attributes: re(e.localTransform),
|
|
1814
|
+
...oe(e),
|
|
2123
1815
|
visible: e.visible,
|
|
2124
1816
|
classification: "native-usd",
|
|
2125
1817
|
materialBinding: "source-authored",
|
|
2126
1818
|
physics: f
|
|
2127
1819
|
}];
|
|
2128
1820
|
}
|
|
2129
|
-
function
|
|
2130
|
-
const l =
|
|
2131
|
-
if (!l || !
|
|
1821
|
+
function vs(e, t, s, r, o, n, i) {
|
|
1822
|
+
const l = ft(s.document, e.visualRevisionId), d = l ? He(s.assetCatalog, l) : null;
|
|
1823
|
+
if (!l || !d)
|
|
2132
1824
|
return r.push(v(
|
|
2133
1825
|
"USD_DELIVERY_VISUAL_SOURCE_MISSING",
|
|
2134
1826
|
"error",
|
|
@@ -2136,9 +1828,9 @@ function Fs(e, t, s, r, o, n, i) {
|
|
|
2136
1828
|
e.nodeId,
|
|
2137
1829
|
e.visualRevisionId
|
|
2138
1830
|
)), [];
|
|
2139
|
-
const c =
|
|
1831
|
+
const c = ks(
|
|
2140
1832
|
s.assetCatalog,
|
|
2141
|
-
|
|
1833
|
+
d,
|
|
2142
1834
|
s.profile.profileId,
|
|
2143
1835
|
s.profile.profileVersion
|
|
2144
1836
|
);
|
|
@@ -2148,51 +1840,51 @@ function Fs(e, t, s, r, o, n, i) {
|
|
|
2148
1840
|
"error",
|
|
2149
1841
|
`Visual node ${e.label} requires a resolved delivery artifact for ${s.profile.profileId}@${s.profile.profileVersion}.`,
|
|
2150
1842
|
e.nodeId,
|
|
2151
|
-
|
|
1843
|
+
d.assetId
|
|
2152
1844
|
)), [];
|
|
2153
1845
|
if (r.push(...c.artifact.diagnostics), c.artifact.outcome === "blocked") return [];
|
|
2154
|
-
const
|
|
2155
|
-
|
|
1846
|
+
const u = Ss(
|
|
1847
|
+
d,
|
|
2156
1848
|
c.artifact,
|
|
2157
1849
|
e,
|
|
2158
1850
|
r
|
|
2159
1851
|
);
|
|
2160
|
-
if (!
|
|
2161
|
-
const a = i.get(e.nodeId) ??
|
|
2162
|
-
|
|
2163
|
-
const g = `assets/${
|
|
2164
|
-
for (const p of
|
|
2165
|
-
|
|
1852
|
+
if (!u) return [];
|
|
1853
|
+
const a = i.get(e.nodeId) ?? j(e.label) ?? "Visual", f = t === "/" ? `/${a}` : `${t}/${a}`;
|
|
1854
|
+
Je(e, f, r);
|
|
1855
|
+
const g = `assets/${Ge(d.label, d.assetId)}/${d.source.sourceRevisionId.slice(0, 16)}`, h = `${g}/${W(c.artifact.entryOutputPath)}`;
|
|
1856
|
+
for (const p of u)
|
|
1857
|
+
Ts(
|
|
2166
1858
|
o,
|
|
2167
|
-
|
|
1859
|
+
d,
|
|
2168
1860
|
c.artifact,
|
|
2169
1861
|
p,
|
|
2170
|
-
`${g}/${
|
|
1862
|
+
`${g}/${F(p.locator)}`
|
|
2171
1863
|
);
|
|
2172
1864
|
return c.artifact.outcome === "degraded" && !r.some((p) => p.nodeId === e.nodeId && p.severity === "warning") && r.push(v(
|
|
2173
1865
|
"USD_DELIVERY_VISUAL_ARTIFACT_DEGRADED",
|
|
2174
1866
|
"warning",
|
|
2175
1867
|
`Visual node ${e.label} uses a degraded delivery artifact.`,
|
|
2176
1868
|
e.nodeId,
|
|
2177
|
-
|
|
1869
|
+
d.assetId
|
|
2178
1870
|
)), [{
|
|
2179
1871
|
nodeId: e.nodeId,
|
|
2180
1872
|
primPath: f,
|
|
2181
1873
|
nodeKind: "reference",
|
|
2182
1874
|
typeName: "Xform",
|
|
2183
|
-
assetId:
|
|
2184
|
-
sourceRevisionId:
|
|
1875
|
+
assetId: d.assetId,
|
|
1876
|
+
sourceRevisionId: d.source.sourceRevisionId,
|
|
2185
1877
|
artifactId: c.artifact.artifactId,
|
|
2186
1878
|
reference: { assetPath: `./${h}` },
|
|
2187
|
-
attributes:
|
|
2188
|
-
...
|
|
1879
|
+
attributes: re(e.localTransform),
|
|
1880
|
+
...oe(e),
|
|
2189
1881
|
visible: e.visible,
|
|
2190
1882
|
classification: "visual-only",
|
|
2191
1883
|
materialBinding: "visual-artifact",
|
|
2192
1884
|
physics: { kind: "none", policy: "visual-only" }
|
|
2193
1885
|
}];
|
|
2194
1886
|
}
|
|
2195
|
-
function
|
|
1887
|
+
function Ss(e, t, s, r) {
|
|
2196
1888
|
const o = (c) => (r.push(v(
|
|
2197
1889
|
"USD_DELIVERY_VISUAL_ARTIFACT_INVALID",
|
|
2198
1890
|
"error",
|
|
@@ -2206,44 +1898,44 @@ function js(e, t, s, r) {
|
|
|
2206
1898
|
);
|
|
2207
1899
|
let n;
|
|
2208
1900
|
try {
|
|
2209
|
-
n =
|
|
1901
|
+
n = W(t.entryOutputPath);
|
|
2210
1902
|
} catch {
|
|
2211
1903
|
return o(`Delivery artifact ${t.artifactId} has an invalid entry path: ${t.entryOutputPath}.`);
|
|
2212
1904
|
}
|
|
2213
|
-
const i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(),
|
|
1905
|
+
const i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), d = [];
|
|
2214
1906
|
for (const c of t.resources) {
|
|
2215
|
-
const
|
|
1907
|
+
const u = $(c.locator);
|
|
2216
1908
|
if (!c.resourceId || l.has(c.resourceId))
|
|
2217
1909
|
return o(`Delivery artifact ${t.artifactId} has a missing or duplicate resource id: ${c.resourceId}.`);
|
|
2218
1910
|
if (!/^[a-f0-9]{64}$/.test(c.sha256) || !c.mediaType || !Number.isInteger(c.byteSize) || c.byteSize < 0)
|
|
2219
1911
|
return o(`Delivery artifact ${t.artifactId} has invalid resource facts: ${m(c.locator)}.`);
|
|
2220
|
-
const a =
|
|
1912
|
+
const a = F(u);
|
|
2221
1913
|
if (i.has(a))
|
|
2222
1914
|
return o(`Delivery artifact ${t.artifactId} repeats resource path ${a}.`);
|
|
2223
|
-
i.add(a), l.add(c.resourceId),
|
|
1915
|
+
i.add(a), l.add(c.resourceId), d.push({ ...c, locator: u });
|
|
2224
1916
|
}
|
|
2225
|
-
return i.has(n) ?
|
|
2226
|
-
|
|
2227
|
-
) || c.resourceId.localeCompare(
|
|
1917
|
+
return i.has(n) ? d.sort((c, u) => F(c.locator).localeCompare(
|
|
1918
|
+
F(u.locator)
|
|
1919
|
+
) || c.resourceId.localeCompare(u.resourceId)) : o(
|
|
2228
1920
|
`Delivery artifact ${t.artifactId} entry ${n} is missing from its resources.`
|
|
2229
1921
|
);
|
|
2230
1922
|
}
|
|
2231
|
-
function
|
|
1923
|
+
function He(e, t) {
|
|
2232
1924
|
return e.entries.find((s) => {
|
|
2233
1925
|
const r = s.interpretation.runtimeRevision;
|
|
2234
1926
|
return "visualRevisionId" in t ? "visualRevisionId" in r && r.visualRevisionId === t.visualRevisionId : "revisionId" in r && r.revisionId === t.revisionId;
|
|
2235
1927
|
}) ?? null;
|
|
2236
1928
|
}
|
|
2237
|
-
function
|
|
1929
|
+
function bs(e) {
|
|
2238
1930
|
const t = Math.hypot(...e);
|
|
2239
1931
|
if (!Number.isFinite(t))
|
|
2240
1932
|
throw new Error("Scene gravity must contain finite values.");
|
|
2241
1933
|
return t <= 1e-12 ? { gravityDirection: [0, 0, -1], gravityMagnitude: 0 } : {
|
|
2242
|
-
gravityDirection: e.map((s) =>
|
|
2243
|
-
gravityMagnitude:
|
|
1934
|
+
gravityDirection: e.map((s) => O(s / t, 12)),
|
|
1935
|
+
gravityMagnitude: O(t, 12)
|
|
2244
1936
|
};
|
|
2245
1937
|
}
|
|
2246
|
-
function
|
|
1938
|
+
function Je(e, t, s) {
|
|
2247
1939
|
var r, o, n, i;
|
|
2248
1940
|
e.nodeType === "asset" ? (e.initialPose && s.push(v(
|
|
2249
1941
|
"USD_EXPORT_INITIAL_POSE_UNSUPPORTED",
|
|
@@ -2289,12 +1981,12 @@ function ct(e, t, s) {
|
|
|
2289
1981
|
e.visualRevisionId
|
|
2290
1982
|
)));
|
|
2291
1983
|
}
|
|
2292
|
-
function
|
|
1984
|
+
function As(e, t, s, r) {
|
|
2293
1985
|
var f, g, h, p;
|
|
2294
|
-
const o = e.physics, n = (f = o.colliderPrimPaths) == null ? void 0 : f.map((I) =>
|
|
1986
|
+
const o = e.physics, n = (f = o.colliderPrimPaths) == null ? void 0 : f.map((I) => Te(t, I)), i = (g = o.jointOverrides) == null ? void 0 : g.map((I) => ({
|
|
2295
1987
|
...I,
|
|
2296
|
-
jointPrimPath:
|
|
2297
|
-
})), l = o.physicsMaterial ?
|
|
1988
|
+
jointPrimPath: Te(t, I.jointPrimPath)
|
|
1989
|
+
})), l = o.physicsMaterial ? Rs(o.physicsMaterial) : void 0;
|
|
2298
1990
|
if (i != null && i.length)
|
|
2299
1991
|
return r.push(v(
|
|
2300
1992
|
"USD_EXPORT_JOINT_DRIVE_UNITS_NOT_VERIFIED",
|
|
@@ -2303,9 +1995,9 @@ function Ks(e, t, s, r) {
|
|
|
2303
1995
|
e.nodeId,
|
|
2304
1996
|
e.assetRevisionId
|
|
2305
1997
|
)), null;
|
|
2306
|
-
const
|
|
1998
|
+
const d = !!(n != null && n.length || l), c = s.interpretation.runtimeRevision, u = !!((h = c.capabilities) != null && h.colliderGeometry), a = !!((p = c.capabilities) != null && p.rigidBody);
|
|
2307
1999
|
if (o.kind === "static" || o.kind === "kinematic" || o.kind === "dynamic") {
|
|
2308
|
-
if (!(n != null && n.length) && !
|
|
2000
|
+
if (!(n != null && n.length) && !u)
|
|
2309
2001
|
return r.push(v(
|
|
2310
2002
|
"USD_EXPORT_COLLIDER_GEOMETRY_REQUIRED",
|
|
2311
2003
|
"error",
|
|
@@ -2324,14 +2016,14 @@ function Ks(e, t, s, r) {
|
|
|
2324
2016
|
}
|
|
2325
2017
|
return o.kind === "asset-authored" ? {
|
|
2326
2018
|
kind: "asset-authored",
|
|
2327
|
-
policy:
|
|
2019
|
+
policy: d ? "preserve-with-overrides" : "preserve-source",
|
|
2328
2020
|
...n != null && n.length ? { colliderPrimPaths: n } : {},
|
|
2329
2021
|
...l ? { physicsMaterial: l } : {}
|
|
2330
2022
|
} : o.kind === "dynamic" ? {
|
|
2331
2023
|
kind: "dynamic",
|
|
2332
2024
|
policy: "preserve-with-overrides",
|
|
2333
2025
|
...o.massKg !== void 0 ? { massKg: o.massKg } : {},
|
|
2334
|
-
...o.centerOfMassM ? { centerOfMassM: o.centerOfMassM.map((I) =>
|
|
2026
|
+
...o.centerOfMassM ? { centerOfMassM: o.centerOfMassM.map((I) => O(I, 6)) } : {},
|
|
2335
2027
|
...n != null && n.length ? { colliderPrimPaths: n } : {},
|
|
2336
2028
|
...l ? { physicsMaterial: l } : {}
|
|
2337
2029
|
} : {
|
|
@@ -2341,7 +2033,7 @@ function Ks(e, t, s, r) {
|
|
|
2341
2033
|
...l ? { physicsMaterial: l } : {}
|
|
2342
2034
|
};
|
|
2343
2035
|
}
|
|
2344
|
-
function
|
|
2036
|
+
function Rs(e) {
|
|
2345
2037
|
return {
|
|
2346
2038
|
...e.densityKgPerM3 !== void 0 ? { densityKgPerM3: e.densityKgPerM3 } : {},
|
|
2347
2039
|
...e.staticFriction !== void 0 ? { staticFriction: e.staticFriction } : {},
|
|
@@ -2349,7 +2041,7 @@ function Ys(e) {
|
|
|
2349
2041
|
...e.restitution !== void 0 ? { restitution: e.restitution } : {}
|
|
2350
2042
|
};
|
|
2351
2043
|
}
|
|
2352
|
-
function
|
|
2044
|
+
function Te(e, t) {
|
|
2353
2045
|
if (!t.startsWith("/"))
|
|
2354
2046
|
return `${e}/${t}`.replaceAll("//", "/");
|
|
2355
2047
|
if (t === e || t.startsWith(`${e}/`))
|
|
@@ -2357,12 +2049,12 @@ function ze(e, t) {
|
|
|
2357
2049
|
const s = t.split("/").filter(Boolean);
|
|
2358
2050
|
return s.length <= 1 ? e : `${e}/${s.slice(1).join("/")}`;
|
|
2359
2051
|
}
|
|
2360
|
-
function
|
|
2361
|
-
var l,
|
|
2052
|
+
function Es(e, t, s, r) {
|
|
2053
|
+
var l, d;
|
|
2362
2054
|
const o = t.interpretation.runtimeRevision, n = new Map(
|
|
2363
2055
|
"variantSets" in o ? o.variantSets.map((c) => [c.name, c]) : []
|
|
2364
2056
|
), i = {};
|
|
2365
|
-
for (const [c,
|
|
2057
|
+
for (const [c, u] of Object.entries(s).sort(([a], [f]) => a.localeCompare(f))) {
|
|
2366
2058
|
const a = e.variantSelections[c], f = n.get(c);
|
|
2367
2059
|
if (!f) {
|
|
2368
2060
|
r.push(v(
|
|
@@ -2374,90 +2066,90 @@ function Ws(e, t, s, r) {
|
|
|
2374
2066
|
));
|
|
2375
2067
|
continue;
|
|
2376
2068
|
}
|
|
2377
|
-
if (!f.options.includes(
|
|
2069
|
+
if (!f.options.includes(u)) {
|
|
2378
2070
|
r.push(v(
|
|
2379
2071
|
"DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
|
|
2380
2072
|
"info",
|
|
2381
|
-
`Asset ${t.label} has no ${c}=${
|
|
2073
|
+
`Asset ${t.label} has no ${c}=${u} branch; resolution follows the authored node selection or source-authored default.`,
|
|
2382
2074
|
e.nodeId,
|
|
2383
2075
|
t.assetId
|
|
2384
2076
|
));
|
|
2385
2077
|
continue;
|
|
2386
2078
|
}
|
|
2387
|
-
if (a !== void 0 && a !==
|
|
2079
|
+
if (a !== void 0 && a !== u)
|
|
2388
2080
|
return r.push(v(
|
|
2389
2081
|
"DELIVERY_VARIANT_CONFLICT",
|
|
2390
2082
|
"error",
|
|
2391
|
-
`Node ${e.label} selects ${c}=${a}, but profile prefers ${c}=${
|
|
2083
|
+
`Node ${e.label} selects ${c}=${a}, but profile prefers ${c}=${u}.`,
|
|
2392
2084
|
e.nodeId,
|
|
2393
2085
|
t.assetId
|
|
2394
2086
|
)), { ok: !1 };
|
|
2395
|
-
const g = ((l = t.interpretation.variantPayloads[c]) == null ? void 0 : l[
|
|
2087
|
+
const g = ((l = t.interpretation.variantPayloads[c]) == null ? void 0 : l[u]) ?? [];
|
|
2396
2088
|
if (g.length === 0) {
|
|
2397
2089
|
r.push(v(
|
|
2398
2090
|
"DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
|
|
2399
2091
|
"info",
|
|
2400
|
-
`Asset ${t.label} declares ${c}=${
|
|
2092
|
+
`Asset ${t.label} declares ${c}=${u}, but its variant payload is incomplete; resolution follows the authored node selection or source-authored default.`,
|
|
2401
2093
|
e.nodeId,
|
|
2402
2094
|
t.assetId
|
|
2403
2095
|
));
|
|
2404
2096
|
continue;
|
|
2405
2097
|
}
|
|
2406
|
-
const h = new Set(t.source.files.map((I) =>
|
|
2098
|
+
const h = new Set(t.source.files.map((I) => k(I.locator))), p = g.filter((I) => !h.has(I));
|
|
2407
2099
|
if (p.length > 0) {
|
|
2408
2100
|
r.push(v(
|
|
2409
2101
|
"DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
|
|
2410
2102
|
"info",
|
|
2411
|
-
`Variant ${c}=${
|
|
2103
|
+
`Variant ${c}=${u} references missing payloads: ${p.join(", ")}; resolution follows the authored node selection or source-authored default.`,
|
|
2412
2104
|
e.nodeId,
|
|
2413
2105
|
t.assetId
|
|
2414
2106
|
));
|
|
2415
2107
|
continue;
|
|
2416
2108
|
}
|
|
2417
|
-
i[c] =
|
|
2109
|
+
i[c] = u;
|
|
2418
2110
|
}
|
|
2419
|
-
for (const [c,
|
|
2111
|
+
for (const [c, u] of Object.entries(e.variantSelections).sort(([a], [f]) => a.localeCompare(f))) {
|
|
2420
2112
|
if (i[c] !== void 0) continue;
|
|
2421
2113
|
const a = n.get(c);
|
|
2422
|
-
if (!a || !a.options.includes(
|
|
2114
|
+
if (!a || !a.options.includes(u))
|
|
2423
2115
|
return r.push(v(
|
|
2424
2116
|
"DELIVERY_VARIANT_UNKNOWN",
|
|
2425
2117
|
"error",
|
|
2426
|
-
`Node ${e.label} selects unknown variant ${c}=${
|
|
2118
|
+
`Node ${e.label} selects unknown variant ${c}=${u}.`,
|
|
2427
2119
|
e.nodeId,
|
|
2428
2120
|
t.assetId
|
|
2429
2121
|
)), { ok: !1 };
|
|
2430
|
-
if (s[c] ===
|
|
2122
|
+
if (s[c] === u)
|
|
2431
2123
|
return r.push(v(
|
|
2432
2124
|
"DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
|
|
2433
2125
|
"error",
|
|
2434
|
-
`Node ${e.label} explicitly selects ${c}=${
|
|
2126
|
+
`Node ${e.label} explicitly selects ${c}=${u}, but its variant payload is incomplete.`,
|
|
2435
2127
|
e.nodeId,
|
|
2436
2128
|
t.assetId
|
|
2437
2129
|
)), { ok: !1 };
|
|
2438
|
-
const f = ((
|
|
2130
|
+
const f = ((d = t.interpretation.variantPayloads[c]) == null ? void 0 : d[u]) ?? [];
|
|
2439
2131
|
if (f.length === 0)
|
|
2440
2132
|
return r.push(v(
|
|
2441
2133
|
"DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
|
|
2442
2134
|
"error",
|
|
2443
|
-
`Node ${e.label} explicitly selects ${c}=${
|
|
2135
|
+
`Node ${e.label} explicitly selects ${c}=${u}, but its variant payload is incomplete.`,
|
|
2444
2136
|
e.nodeId,
|
|
2445
2137
|
t.assetId
|
|
2446
2138
|
)), { ok: !1 };
|
|
2447
|
-
const g = new Set(t.source.files.map((p) =>
|
|
2139
|
+
const g = new Set(t.source.files.map((p) => k(p.locator))), h = f.filter((p) => !g.has(p));
|
|
2448
2140
|
if (h.length > 0)
|
|
2449
2141
|
return r.push(v(
|
|
2450
2142
|
"DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
|
|
2451
2143
|
"error",
|
|
2452
|
-
`Node ${e.label} explicitly selects ${c}=${
|
|
2144
|
+
`Node ${e.label} explicitly selects ${c}=${u}, but its payloads are missing: ${h.join(", ")}.`,
|
|
2453
2145
|
e.nodeId,
|
|
2454
2146
|
t.assetId
|
|
2455
2147
|
)), { ok: !1 };
|
|
2456
|
-
i[c] =
|
|
2148
|
+
i[c] = u;
|
|
2457
2149
|
}
|
|
2458
2150
|
return { ok: !0, selections: Object.keys(i).length > 0 ? i : null };
|
|
2459
2151
|
}
|
|
2460
|
-
function
|
|
2152
|
+
function _s(e, t) {
|
|
2461
2153
|
const s = /* @__PURE__ */ new Map();
|
|
2462
2154
|
for (const r of e.values()) {
|
|
2463
2155
|
const o = r.outputPath.toLocaleLowerCase("en-US"), n = s.get(o);
|
|
@@ -2472,13 +2164,13 @@ function Gs(e, t) {
|
|
|
2472
2164
|
));
|
|
2473
2165
|
}
|
|
2474
2166
|
}
|
|
2475
|
-
function
|
|
2167
|
+
function Ps(e, t, s) {
|
|
2476
2168
|
const r = new Map(
|
|
2477
2169
|
[...t.values()].map((n) => [
|
|
2478
2170
|
n.outputPath.toLocaleLowerCase("en-US"),
|
|
2479
2171
|
n
|
|
2480
2172
|
])
|
|
2481
|
-
), o = [...e.values()].flatMap((n) =>
|
|
2173
|
+
), o = [...e.values()].flatMap((n) => ws(n)).sort((n, i) => w(n.outputPath, i.outputPath) || w(n.sourceSha256, i.sourceSha256) || w(n.resourceId, i.resourceId));
|
|
2482
2174
|
for (const n of o) {
|
|
2483
2175
|
const i = n.outputPath.toLocaleLowerCase("en-US"), l = r.get(i);
|
|
2484
2176
|
if (l) {
|
|
@@ -2497,46 +2189,46 @@ function Hs(e, t, s) {
|
|
|
2497
2189
|
);
|
|
2498
2190
|
}
|
|
2499
2191
|
}
|
|
2500
|
-
function
|
|
2192
|
+
function ws(e) {
|
|
2501
2193
|
if (e.source.entryLocator.kind !== "package-path") return [];
|
|
2502
|
-
const t =
|
|
2194
|
+
const t = W(e.source.entryLocator.path);
|
|
2503
2195
|
if (!/\.(?:usd|usda|usdc|usdz)$/i.test(t)) return [];
|
|
2504
2196
|
const s = t.lastIndexOf("/"), r = s >= 0 ? t.slice(0, s) : "", o = r ? `${r}/` : "", n = [];
|
|
2505
2197
|
for (const i of e.source.files)
|
|
2506
|
-
if (!(i.locator.kind !== "package-path" ||
|
|
2198
|
+
if (!(i.locator.kind !== "package-path" || !$s(i.locator.path)))
|
|
2507
2199
|
try {
|
|
2508
|
-
const l =
|
|
2200
|
+
const l = W(i.locator.path);
|
|
2509
2201
|
if (!l.startsWith(o)) continue;
|
|
2510
|
-
const
|
|
2202
|
+
const d = W(l.slice(o.length));
|
|
2511
2203
|
n.push({
|
|
2512
2204
|
resourceId: `relative-texture-alias/${e.source.sourceRevisionId}/${m(i.locator)}`,
|
|
2513
2205
|
sourceRevisionId: e.source.sourceRevisionId,
|
|
2514
|
-
outputPath:
|
|
2206
|
+
outputPath: d,
|
|
2515
2207
|
sourceLocator: i.locator,
|
|
2516
2208
|
sourceSha256: i.sha256,
|
|
2517
2209
|
mediaType: i.mediaType,
|
|
2518
2210
|
sourceByteSize: i.byteSize,
|
|
2519
|
-
outputTransform:
|
|
2211
|
+
outputTransform: me(d, i.mediaType)
|
|
2520
2212
|
});
|
|
2521
2213
|
} catch {
|
|
2522
2214
|
}
|
|
2523
2215
|
return n;
|
|
2524
2216
|
}
|
|
2525
|
-
function
|
|
2217
|
+
function $s(e) {
|
|
2526
2218
|
return /\.(?:png|jpe?g|webp|exr|ktx2)$/i.test(e);
|
|
2527
2219
|
}
|
|
2528
|
-
function
|
|
2220
|
+
function Ds(e, t) {
|
|
2529
2221
|
var o;
|
|
2530
|
-
const s =
|
|
2222
|
+
const s = F(t);
|
|
2531
2223
|
if (!/[^\x20-\x7e]/.test(s) || e.source.files.length !== 1) return s;
|
|
2532
2224
|
const r = ((o = /(\.[A-Za-z0-9]+)$/.exec(s)) == null ? void 0 : o[1]) ?? "";
|
|
2533
2225
|
return `entry-${e.source.sourceRevisionId.slice(0, 16)}${r.toLowerCase()}`;
|
|
2534
2226
|
}
|
|
2535
|
-
function
|
|
2227
|
+
function ks(e, t, s, r) {
|
|
2536
2228
|
const o = e.deliveryLocks.find((i) => i.assetId === t.assetId && i.sourceRevisionId === t.source.sourceRevisionId && i.profileId === s && i.profileVersion === r), n = o ? t.deliveryArtifacts.find((i) => i.artifactId === o.artifactId) : t.deliveryArtifacts.find((i) => i.profileId === s && i.profileVersion === r);
|
|
2537
2229
|
return n ? { artifact: n, ...o ? { lock: o } : {} } : null;
|
|
2538
2230
|
}
|
|
2539
|
-
function
|
|
2231
|
+
function Ns(e, t, s, r, o) {
|
|
2540
2232
|
const n = `${t.source.sourceRevisionId}\0${m(s.locator)}\0`;
|
|
2541
2233
|
e.has(n) || e.set(n, {
|
|
2542
2234
|
resourceId: `${t.source.sourceRevisionId}/${m(s.locator)}`,
|
|
@@ -2546,10 +2238,10 @@ function Qs(e, t, s, r, o) {
|
|
|
2546
2238
|
sourceSha256: s.sha256,
|
|
2547
2239
|
mediaType: s.mediaType,
|
|
2548
2240
|
sourceByteSize: s.byteSize,
|
|
2549
|
-
outputTransform:
|
|
2241
|
+
outputTransform: me(r, s.mediaType)
|
|
2550
2242
|
});
|
|
2551
2243
|
}
|
|
2552
|
-
function
|
|
2244
|
+
function Ts(e, t, s, r, o) {
|
|
2553
2245
|
const n = `${t.source.sourceRevisionId}\0${s.artifactId}\0${r.resourceId}\0${m(r.locator)}`;
|
|
2554
2246
|
e.has(n) || e.set(n, {
|
|
2555
2247
|
resourceId: `${s.artifactId}/${r.resourceId}`,
|
|
@@ -2560,25 +2252,25 @@ function er(e, t, s, r, o) {
|
|
|
2560
2252
|
sourceSha256: r.sha256,
|
|
2561
2253
|
mediaType: r.mediaType,
|
|
2562
2254
|
sourceByteSize: r.byteSize,
|
|
2563
|
-
outputTransform:
|
|
2255
|
+
outputTransform: me(o, r.mediaType)
|
|
2564
2256
|
});
|
|
2565
2257
|
}
|
|
2566
|
-
function
|
|
2258
|
+
function me(e, t) {
|
|
2567
2259
|
return t.toLowerCase() === "model/vnd.usdz+zip" || e.toLowerCase().endsWith(".usdz") ? { kind: "canonicalize-usdz" } : { kind: "identity" };
|
|
2568
2260
|
}
|
|
2569
|
-
function
|
|
2261
|
+
function re(e) {
|
|
2570
2262
|
return {
|
|
2571
2263
|
"xformOp:translate": {
|
|
2572
2264
|
type: "double3",
|
|
2573
|
-
value: e.position.map((t) =>
|
|
2265
|
+
value: e.position.map((t) => O(t, 6))
|
|
2574
2266
|
},
|
|
2575
2267
|
"xformOp:orient": {
|
|
2576
2268
|
type: "quatf",
|
|
2577
|
-
value: e.rotation.map((t) =>
|
|
2269
|
+
value: e.rotation.map((t) => O(t, 6))
|
|
2578
2270
|
},
|
|
2579
2271
|
"xformOp:scale": {
|
|
2580
2272
|
type: "float3",
|
|
2581
|
-
value: e.scale.map((t) =>
|
|
2273
|
+
value: e.scale.map((t) => O(t, 6))
|
|
2582
2274
|
},
|
|
2583
2275
|
xformOpOrder: {
|
|
2584
2276
|
type: "token[]",
|
|
@@ -2586,13 +2278,13 @@ function ce(e) {
|
|
|
2586
2278
|
}
|
|
2587
2279
|
};
|
|
2588
2280
|
}
|
|
2589
|
-
function
|
|
2590
|
-
const t =
|
|
2281
|
+
function oe(e) {
|
|
2282
|
+
const t = dt(e);
|
|
2591
2283
|
return t.every((s) => Math.abs(s) <= 1e-12) ? {} : {
|
|
2592
2284
|
contentAttributes: {
|
|
2593
2285
|
"xformOp:translate": {
|
|
2594
2286
|
type: "double3",
|
|
2595
|
-
value: t.map((s) =>
|
|
2287
|
+
value: t.map((s) => O(-s, 6))
|
|
2596
2288
|
},
|
|
2597
2289
|
xformOpOrder: {
|
|
2598
2290
|
type: "token[]",
|
|
@@ -2601,8 +2293,8 @@ function le(e) {
|
|
|
2601
2293
|
}
|
|
2602
2294
|
};
|
|
2603
2295
|
}
|
|
2604
|
-
function
|
|
2605
|
-
return [e, ...e.children.flatMap((t) => t.nodeType === "group" ?
|
|
2296
|
+
function fe(e) {
|
|
2297
|
+
return [e, ...e.children.flatMap((t) => t.nodeType === "group" ? fe(t) : [t])];
|
|
2606
2298
|
}
|
|
2607
2299
|
function v(e, t, s, r, o) {
|
|
2608
2300
|
return {
|
|
@@ -2613,20 +2305,20 @@ function v(e, t, s, r, o) {
|
|
|
2613
2305
|
...o ? { assetId: o } : {}
|
|
2614
2306
|
};
|
|
2615
2307
|
}
|
|
2616
|
-
function
|
|
2308
|
+
function Cs(e) {
|
|
2617
2309
|
return e.some((t) => t.severity === "error") ? "blocked" : e.some((t) => t.severity === "warning") ? "degraded" : "supported";
|
|
2618
2310
|
}
|
|
2619
|
-
function
|
|
2620
|
-
return
|
|
2311
|
+
function xs(e) {
|
|
2312
|
+
return J(e, (t, s) => w(t.code, s.code) || w(t.nodeId ?? "", s.nodeId ?? "") || w(t.message, s.message));
|
|
2621
2313
|
}
|
|
2622
|
-
function
|
|
2623
|
-
return N(
|
|
2314
|
+
function nr(e) {
|
|
2315
|
+
return N(U(e.map((t) => ({
|
|
2624
2316
|
path: t.path,
|
|
2625
2317
|
sha256: t.sha256,
|
|
2626
2318
|
byteSize: t.bytes.byteLength
|
|
2627
2319
|
})).sort((t, s) => t.path.localeCompare(s.path))));
|
|
2628
2320
|
}
|
|
2629
|
-
function
|
|
2321
|
+
function ar(e) {
|
|
2630
2322
|
const t = {
|
|
2631
2323
|
format: "sim-studio.usd-export-evidence@3",
|
|
2632
2324
|
schemaVersion: 3,
|
|
@@ -2634,72 +2326,62 @@ function Cr(e) {
|
|
|
2634
2326
|
};
|
|
2635
2327
|
return {
|
|
2636
2328
|
...t,
|
|
2637
|
-
evidenceDigest: N(
|
|
2329
|
+
evidenceDigest: N(U(t))
|
|
2638
2330
|
};
|
|
2639
2331
|
}
|
|
2640
2332
|
export {
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
Ds as q,
|
|
2696
|
-
ir as r,
|
|
2697
|
-
Pt as s,
|
|
2698
|
-
$r as t,
|
|
2699
|
-
Ls as u,
|
|
2700
|
-
Nr as v,
|
|
2701
|
-
ye as w,
|
|
2702
|
-
ot as x,
|
|
2703
|
-
Tr as y,
|
|
2704
|
-
Rr as z
|
|
2333
|
+
bt as $,
|
|
2334
|
+
os as A,
|
|
2335
|
+
Bt as B,
|
|
2336
|
+
M as C,
|
|
2337
|
+
gt as D,
|
|
2338
|
+
tr as E,
|
|
2339
|
+
qs as F,
|
|
2340
|
+
es as G,
|
|
2341
|
+
Me as H,
|
|
2342
|
+
E as I,
|
|
2343
|
+
B as J,
|
|
2344
|
+
Zs as K,
|
|
2345
|
+
Ke as L,
|
|
2346
|
+
Xs as M,
|
|
2347
|
+
Wt as N,
|
|
2348
|
+
Xt as O,
|
|
2349
|
+
js as P,
|
|
2350
|
+
Bs as Q,
|
|
2351
|
+
It as R,
|
|
2352
|
+
Hs as S,
|
|
2353
|
+
Vs as T,
|
|
2354
|
+
Fs as U,
|
|
2355
|
+
j as V,
|
|
2356
|
+
Qt as W,
|
|
2357
|
+
Zt as X,
|
|
2358
|
+
Yt as Y,
|
|
2359
|
+
Ge as Z,
|
|
2360
|
+
We as _,
|
|
2361
|
+
Ks as a,
|
|
2362
|
+
de as b,
|
|
2363
|
+
k as c,
|
|
2364
|
+
Ws as d,
|
|
2365
|
+
Gs as e,
|
|
2366
|
+
fs as f,
|
|
2367
|
+
er as g,
|
|
2368
|
+
W as h,
|
|
2369
|
+
pe as i,
|
|
2370
|
+
sr as j,
|
|
2371
|
+
Kt as k,
|
|
2372
|
+
ns as l,
|
|
2373
|
+
rr as m,
|
|
2374
|
+
Q as n,
|
|
2375
|
+
ms as o,
|
|
2376
|
+
Ys as p,
|
|
2377
|
+
or as q,
|
|
2378
|
+
zs as r,
|
|
2379
|
+
ht as s,
|
|
2380
|
+
Xe as t,
|
|
2381
|
+
nr as u,
|
|
2382
|
+
Js as v,
|
|
2383
|
+
Qs as w,
|
|
2384
|
+
Ye as x,
|
|
2385
|
+
pt as y,
|
|
2386
|
+
ar as z
|
|
2705
2387
|
};
|