@nebula-spatial/studio 0.0.0-stage → 0.1.1
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 +206 -3
- package/dist/ai/contract.d.ts +73 -0
- package/dist/ai/host.d.ts +28 -0
- package/dist/asset/dependency-scan.d.ts +78 -0
- package/dist/asset/intake.d.ts +84 -0
- package/dist/asset/layout-detect.d.ts +40 -0
- package/dist/asset/media-type.d.ts +10 -0
- package/dist/asset/model-inspection.d.ts +127 -0
- package/dist/asset/record.d.ts +35 -0
- package/dist/asset/remote-asset-resolver.d.ts +36 -0
- package/dist/asset/repairs.d.ts +53 -0
- package/dist/asset/resource-locator.d.ts +15 -0
- package/dist/asset/revision-diff.d.ts +33 -0
- package/dist/asset/source-contracts.d.ts +21 -0
- package/dist/asset/source-paths.d.ts +15 -0
- package/dist/asset/usd-inspection.d.ts +39 -0
- package/dist/asset/usd-source-metadata.d.ts +142 -0
- package/dist/asset/visual-intake.d.ts +27 -0
- package/dist/asset/visual-record.d.ts +22 -0
- package/dist/asset/web-intake.d.ts +46 -0
- package/dist/asset-source-BExlEcRt.js +444 -0
- package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
- package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
- package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
- package/dist/builders-BAXRR5o5.js +1854 -0
- package/dist/core/asset-task.d.ts +105 -0
- package/dist/core/context.d.ts +23 -0
- package/dist/core/host.d.ts +432 -0
- package/dist/core/persistence-controller.d.ts +58 -0
- package/dist/core/plugins.d.ts +139 -0
- package/dist/core/scene-tree.d.ts +62 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/when.d.ts +13 -0
- package/dist/core/write-policy.d.ts +29 -0
- package/dist/delivery/build-plan.d.ts +2 -0
- package/dist/delivery/contracts.d.ts +362 -0
- package/dist/delivery/digest.d.ts +3 -0
- package/dist/delivery/evidence.d.ts +10 -0
- package/dist/delivery/export-evidence.d.ts +3 -0
- package/dist/delivery/index.d.ts +9 -0
- package/dist/delivery/prim-name.d.ts +17 -0
- package/dist/delivery/profile.d.ts +4 -0
- package/dist/doc/builders.d.ts +99 -0
- package/dist/doc/command.d.ts +195 -0
- package/dist/doc/domain-extensions.d.ts +34 -0
- package/dist/doc/node-facts.d.ts +87 -0
- package/dist/doc/physics-facts.d.ts +74 -0
- package/dist/doc/placement-policy.d.ts +71 -0
- package/dist/doc/random-placement.d.ts +30 -0
- package/dist/doc/scene-graph.d.ts +80 -0
- package/dist/doc/scene-regions.d.ts +29 -0
- package/dist/doc/schema.d.ts +452 -0
- package/dist/doc/task.d.ts +71 -0
- package/dist/doc/validate.d.ts +68 -0
- package/dist/editor/asset-source.d.ts +15 -0
- package/dist/editor/editor.d.ts +246 -0
- package/dist/editor/index.d.ts +22 -0
- package/dist/editor/shortcuts.d.ts +2 -0
- package/dist/editor/types.d.ts +143 -0
- package/dist/editor/ui-plugins.d.ts +64 -0
- package/dist/editor.js +1755 -0
- package/dist/editorial-BkAFWfbg.js +83 -0
- package/dist/export-evidence-DMNRhgL9.js +2705 -0
- package/dist/generalization/domain.d.ts +10 -0
- package/dist/generalization/generalization.d.ts +371 -0
- package/dist/generalization/index.d.ts +11 -0
- package/dist/generalization.js +1659 -0
- package/dist/history/undo-stack.d.ts +74 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.js +2840 -0
- package/dist/mjcf-visual-Bt4bUxd1.js +72 -0
- package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
- package/dist/persist/content-addressed.d.ts +11 -0
- package/dist/persist/create-scene-package-from-host.d.ts +7 -0
- package/dist/persist/indexeddb-store.d.ts +69 -0
- package/dist/persist/scene-file.d.ts +52 -0
- package/dist/persist/scene-package.d.ts +8 -0
- package/dist/persist/snapshot.d.ts +5 -0
- package/dist/physics-facts-tfQYyNTD.js +337 -0
- package/dist/placement-policy-DY_FNRDu.js +405 -0
- package/dist/ports/asset-ingestor.d.ts +41 -0
- package/dist/ports/asset-source.d.ts +57 -0
- package/dist/ports/delivery.d.ts +13 -0
- package/dist/ports/persistence.d.ts +29 -0
- package/dist/project/asset-catalog.d.ts +21 -0
- package/dist/project/contracts.d.ts +272 -0
- package/dist/project/editorial.d.ts +16 -0
- package/dist/project/identity.d.ts +20 -0
- package/dist/project/index.d.ts +9 -0
- package/dist/project/scene-document.d.ts +5 -0
- package/dist/project/source-dependencies.d.ts +7 -0
- package/dist/remote-asset-resolver-Cb8cfNmw.js +136 -0
- package/dist/scene/index.d.ts +12 -0
- package/dist/scene-graph-DBLKAhxa.js +681 -0
- package/dist/scene-session-Cy6vDJ1l.js +21981 -0
- package/dist/scene.js +244 -0
- package/dist/session-BRBrCLdd.js +963 -0
- package/dist/session-DI5tPJxn.js +825 -0
- package/dist/session-q3uuG7OP.js +296 -0
- package/dist/studio/delivery-catalog.d.ts +28 -0
- package/dist/studio/in-memory-asset-source.d.ts +15 -0
- package/dist/studio/index.d.ts +31 -0
- package/dist/studio/indexeddb-asset-source.d.ts +32 -0
- package/dist/studio/indexeddb-persistence.d.ts +13 -0
- package/dist/studio/remote-asset-importer.d.ts +56 -0
- package/dist/studio/source-package.d.ts +9 -0
- package/dist/studio/usd-export-client.d.ts +13 -0
- package/dist/studio/usd-export-protocol.d.ts +98 -0
- package/dist/studio/usd-export-worker.d.ts +1 -0
- package/dist/studio/usd-zip-reader.d.ts +14 -0
- package/dist/studio/web-asset-ingestor.d.ts +10 -0
- package/dist/studio/web-host.d.ts +8 -0
- package/dist/studio.js +5545 -0
- package/dist/urdf-session-CQir2nb2.js +1230 -0
- package/dist/usd-session-DZJnEEOs.js +7385 -0
- package/dist/util/asset-facts.d.ts +3 -0
- package/dist/util/data.d.ts +17 -0
- package/dist/util/diagnostics.d.ts +38 -0
- package/dist/util/geometry.d.ts +11 -0
- package/dist/util/hash.d.ts +9 -0
- package/dist/util/ids.d.ts +20 -0
- package/dist/util/math.d.ts +47 -0
- package/dist/util/ply-metadata.d.ts +19 -0
- package/dist/util/studio-source.d.ts +23 -0
- package/dist/version.d.ts +5 -0
- package/dist/view/appearance.d.ts +13 -0
- package/dist/view/authoring-appearance.d.ts +25 -0
- package/dist/view/bounds-preview.d.ts +34 -0
- package/dist/view/bounds.d.ts +11 -0
- package/dist/view/camera-zoom.d.ts +3 -0
- package/dist/view/geometry-anchors.d.ts +20 -0
- package/dist/view/gizmo-appearance.d.ts +5 -0
- package/dist/view/gizmo.d.ts +81 -0
- package/dist/view/group-selection.d.ts +13 -0
- package/dist/view/node-features.d.ts +39 -0
- package/dist/view/picking.d.ts +49 -0
- package/dist/view/placement.d.ts +48 -0
- package/dist/view/region-editing.d.ts +25 -0
- package/dist/view/rotation-guide.d.ts +36 -0
- package/dist/view/runtime-capabilities.d.ts +22 -0
- package/dist/view/scene-session.d.ts +258 -0
- package/dist/view/screen-bounds.d.ts +17 -0
- package/dist/view/selection-transform.d.ts +20 -0
- package/dist/wasm-module-DZn2AM1W.js +13 -0
- package/dist/xacro-DLRXyk60.js +76 -0
- package/node_modules/@nebula-spatial/cad-loader/CHANGELOG.md +48 -0
- package/node_modules/@nebula-spatial/cad-loader/README.md +108 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/cad-types.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/errors.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/index.js +2354 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-group-reader.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/bin-parser.d.ts +78 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/dxbs-sidecar.d.ts +24 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/geometry-segments.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/text-roundtrip.d.ts +4 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/parser/types.d.ts +81 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/runtime-text-decoder.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/types.d.ts +153 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/insert-bbox.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/core/utils/viewport-rect.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.d.ts +36 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/index.js +5829 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/geo-loader.d.ts +59 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/automatic-external-resources.d.ts +26 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/external-variant-sidecar-fetch.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/flow-control.d.ts +29 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/frame-budget-scheduler.d.ts +21 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-compact-executor.d.ts +19 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-local-adapter.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-pipeline.d.ts +92 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-loader-worker-adapter.d.ts +13 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-builder.d.ts +34 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node-load-sink.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-node.d.ts +304 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare-worker-types.d.ts +94 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/geo-prepare.worker.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-model-builder.d.ts +10 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/insert-runtime-geometry.d.ts +15 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-canonical.d.ts +37 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/line-quality.d.ts +9 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/prepare-credit-gate.d.ts +20 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/loader/internal/transport.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/cad-render-node.d.ts +80 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/render-resource/geo-node-cad-render-node.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-geometry.d.ts +28 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/geo-cad-line-material.d.ts +18 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/block-geometry-registry.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/insert-instance-table.d.ts +23 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/scene/instancing/viewport-instance-presenter.d.ts +66 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-insert-selection.d.ts +35 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/selection/cad-text-selection.d.ts +31 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/annotation-idle-gate.d.ts +14 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-document-session.d.ts +187 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-font-runtime.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-insert-id.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/cad-text-warmup.d.ts +38 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/create-cad-document-session.d.ts +5 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/load-session.d.ts +90 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/session/viewport-coverage.d.ts +32 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/abort.d.ts +3 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-display-color.d.ts +55 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/cad-load-source.d.ts +8 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/color-buffer.d.ts +6 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/constants.d.ts +11 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/display-color-buffer.d.ts +27 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/errors.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-builder.d.ts +25 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/text-font.d.ts +12 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/types.d.ts +57 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/insert-bbox.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/timing.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/utils/viewport-rect.d.ts +1 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/shared/viewer-theme.d.ts +2 -0
- package/node_modules/@nebula-spatial/cad-loader/dist/workers/geo-prepare.worker.js +2264 -0
- package/node_modules/@nebula-spatial/cad-loader/package.json +62 -0
- package/node_modules/@nebula-spatial/viewer/CHANGELOG.md +426 -0
- package/node_modules/@nebula-spatial/viewer/FBX-MATERIAL-CONVERSION.md +97 -0
- package/node_modules/@nebula-spatial/viewer/README.md +1056 -0
- package/node_modules/@nebula-spatial/viewer/USD-VISUAL-MATERIAL-SUPPORT.md +89 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.js +19 -0
- package/node_modules/@nebula-spatial/viewer/basis/basis_transcoder.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/dist/asset-ir-DEOK9SqE.js +382 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/ground-grid.d.ts +6 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/source-types.d.ts +19 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/types.d.ts +393 -0
- package/node_modules/@nebula-spatial/viewer/dist/assets/usd-worker-Bom5cjz3.js +1392 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/text.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/cad/types.d.ts +368 -0
- package/node_modules/@nebula-spatial/viewer/dist/index-ByBlfVc0.js +12132 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.d.ts +32 -0
- package/node_modules/@nebula-spatial/viewer/dist/index.js +26 -0
- package/node_modules/@nebula-spatial/viewer/dist/inspection/types.d.ts +112 -0
- package/node_modules/@nebula-spatial/viewer/dist/mjcf-visual-DVRa0w90.js +72 -0
- package/node_modules/@nebula-spatial/viewer/dist/mujoco-runtime-Dhx6Ua2u.js +463 -0
- package/node_modules/@nebula-spatial/viewer/dist/plugins.d.ts +179 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/instances.d.ts +36 -0
- package/node_modules/@nebula-spatial/viewer/dist/scene/types.d.ts +258 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B-j6KdA-.js +389 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-B4AICTeJ.js +963 -0
- package/node_modules/@nebula-spatial/viewer/dist/session-BAG5cDYe.js +9153 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-runtime.d.ts +118 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/mujoco-wasm-module.d.ts +11 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/openusd-wasm-module.d.ts +10 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/physics-runtime-state.d.ts +75 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/types.d.ts +129 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-inspection.d.ts +66 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-query.d.ts +50 -0
- package/node_modules/@nebula-spatial/viewer/dist/simulation/usd-resource-policy.d.ts +28 -0
- package/node_modules/@nebula-spatial/viewer/dist/types.d.ts +278 -0
- package/node_modules/@nebula-spatial/viewer/dist/ui/types.d.ts +48 -0
- package/node_modules/@nebula-spatial/viewer/dist/urdf-session-kemAnBn8.js +3231 -0
- package/node_modules/@nebula-spatial/viewer/dist/usd-session-QtwGKI7v.js +6771 -0
- package/node_modules/@nebula-spatial/viewer/dist/version.d.ts +5 -0
- package/node_modules/@nebula-spatial/viewer/dist/viewer.d.ts +2 -0
- package/node_modules/@nebula-spatial/viewer/dist/xacro-CYTPS7mh.js +1537 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd-runtime-manifest.json +15 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.js +14 -0
- package/node_modules/@nebula-spatial/viewer/openusd/openusd_probe.wasm +0 -0
- package/node_modules/@nebula-spatial/viewer/package.json +66 -0
- package/package.json +87 -6
package/dist/index.js
ADDED
|
@@ -0,0 +1,2840 @@
|
|
|
1
|
+
import { b as _t, c as vt, s as U, a as Rt, v as Ae, d as Nt, e as Pt, f as Tt, g as be } from "./builders-BAXRR5o5.js";
|
|
2
|
+
import { C as Hs, h as Ys, D as Js, S as Zs, i as Ws, j as Xs, k as qs, l as Qs, m as eo, n as to, o as no, p as so, q as oo, r as ro, t as io, u as ao, w as co, x as lo, y as uo, z as fo, A as mo, B as ho, E as po, F as go, G as So, H as Eo, I as yo, J as Io, K as Co, L as Ao, M as bo, N as _o, O as vo, P as Ro, Q as No, R as Po, T as To, U as wo, V as Mo, W as xo, X as Oo, Y as Do, Z as Uo, _ as Lo, $ as ko, a0 as $o, a1 as Fo, a2 as Go, a3 as Vo, a4 as Bo, a5 as zo } from "./builders-BAXRR5o5.js";
|
|
3
|
+
import { q as wt, c as Mt, l as xt, d as je, a as Ke, w as Ot, S as Dt } from "./scene-graph-DBLKAhxa.js";
|
|
4
|
+
import { A as Ko, G as Ho, I as Yo, b as Jo, e as Zo, f as Wo, g as Xo, h as qo, i as Qo, j as er, k as tr, m as nr, n as sr, o as or, p as rr, r as ir, s as ar, t as cr, u as lr, v as ur, x as dr, y as fr, z as mr, B as hr, C as pr, D as gr, E as Sr, F as Er, H as yr, J as Ir, K as Cr, L as Ar, M as br, N as _r, O as vr, P as Rr, Q as Nr, R as Pr, T as Tr, U as wr } from "./scene-graph-DBLKAhxa.js";
|
|
5
|
+
import { n as ue, a as w, r as Ut, m as _e, b as rt, c as Lt } from "./asset-source-BExlEcRt.js";
|
|
6
|
+
import { S as xr, d as Or, e as Dr, f as Ur, g as Lr, h as kr, i as $r, p as Fr, j as Gr, k as Vr, l as Br, s as zr, o as jr, q as Kr, v as Hr } from "./asset-source-BExlEcRt.js";
|
|
7
|
+
import { r as He, s as ve, i as Ie, a as kt, n as Ce, b as $t, c as K, p as Ft, d as Gt, e as Vt, f as it, g as Bt, h as zt } from "./export-evidence-DMNRhgL9.js";
|
|
8
|
+
import { I as Jr, j as Zr, S as Wr, k as Xr, l as qr, m as Qr, o as ei, q as ti, t as ni, u as si, v as oi, w as ri, x as ii, y as ai, z as ci, A as li, B as ui, C as di, D as fi, E as mi, F as hi, G as pi, H as gi, J as Si, K as Ei, L as yi, M as Ii, N as Ci, O as Ai, P as bi, Q as _i, R as vi, T as Ri, U as Ni, V as Pi, W as Ti, X as wi, Y as Mi, Z as xi, _ as Oi, $ as Di, a0 as Ui, a1 as Li, a2 as ki, a3 as $i, a4 as Fi, a5 as Gi, a6 as Vi, a7 as Bi } from "./export-evidence-DMNRhgL9.js";
|
|
9
|
+
import re from "jszip";
|
|
10
|
+
import { D as ji, a as Ki, b as Hi, c as Yi, d as Ji, e as Zi, f as Wi, g as Xi, h as qi, i as Qi, j as ea, m as ta, n as na, k as sa, p as oa, l as ra, s as ia, o as aa, u as ca } from "./placement-policy-DY_FNRDu.js";
|
|
11
|
+
import { a as at } from "./editorial-BkAFWfbg.js";
|
|
12
|
+
import { c as ua, e as da, b as fa, n as ma } from "./editorial-BkAFWfbg.js";
|
|
13
|
+
import { D as pa, N as ga, g as Sa, a as Ea, b as ya, c as Ia, n as Ca, d as Aa, r as ba } from "./physics-facts-tfQYyNTD.js";
|
|
14
|
+
const jt = "0.1.1", Kt = "@nebula-spatial/studio", Ye = "__NEBULA_SPATIAL_SIM_STUDIO_BANNER_PRINTED__";
|
|
15
|
+
function Je() {
|
|
16
|
+
const e = `%c ${Kt} %c v${jt} `;
|
|
17
|
+
console.log(e, "background:#111827;color:#ffffff;padding:4px 10px;border-radius:4px 0 0 4px;font-weight:700;", "background:#6366F1;color:#ffffff;padding:4px 10px;border-radius:0 4px 4px 0;font-weight:700;");
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const e = globalThis;
|
|
21
|
+
e[Ye] || (e[Ye] = !0, Je());
|
|
22
|
+
} catch {
|
|
23
|
+
Je();
|
|
24
|
+
}
|
|
25
|
+
function bs(e, t) {
|
|
26
|
+
if (!Number.isInteger(t.seed)) throw new Error("Scatter seed must be an integer.");
|
|
27
|
+
if (!Number.isInteger(t.count) || t.count <= 0) throw new Error("Scatter count must be a positive integer.");
|
|
28
|
+
if (t.region.minX > t.region.maxX || t.region.minY > t.region.maxY)
|
|
29
|
+
throw new Error("Scatter region bounds are invalid.");
|
|
30
|
+
if (t.size.some((a) => !Number.isFinite(a) || a <= 0))
|
|
31
|
+
throw new Error("Scatter placeholder size must contain positive finite values.");
|
|
32
|
+
const n = Ht(t.seed), o = t.yawRangeRadians ?? [0, Math.PI * 2], s = `batch_seeded_${t.seed}`, r = [], c = [], i = [];
|
|
33
|
+
for (let a = 0; a < t.count; a += 1) {
|
|
34
|
+
const l = {
|
|
35
|
+
position: [
|
|
36
|
+
fe(t.region.minX, t.region.maxX, n()),
|
|
37
|
+
fe(t.region.minY, t.region.maxY, n()),
|
|
38
|
+
t.region.z
|
|
39
|
+
],
|
|
40
|
+
rotation: wt(fe(o[0], o[1], n())),
|
|
41
|
+
scale: [1, 1, 1]
|
|
42
|
+
}, u = Mt({
|
|
43
|
+
nodeId: `${t.nodeIdPrefix}${a + 1}`,
|
|
44
|
+
label: `${t.labelPrefix ?? "Seeded placeholder"} ${a + 1}`,
|
|
45
|
+
size: t.size,
|
|
46
|
+
localTransform: l
|
|
47
|
+
});
|
|
48
|
+
r.push(l), c.push(u), i.push(_t(u, e.root.nodeId, {
|
|
49
|
+
batchId: s,
|
|
50
|
+
label: `Scatter ${t.count} placeholders with seed ${t.seed}`,
|
|
51
|
+
source: "human"
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
return { seed: t.seed, placements: r, nodes: c, records: i };
|
|
55
|
+
}
|
|
56
|
+
function Ht(e) {
|
|
57
|
+
let t = e >>> 0 || 1831565813;
|
|
58
|
+
return () => {
|
|
59
|
+
t += 1831565813;
|
|
60
|
+
let n = t;
|
|
61
|
+
return n = Math.imul(n ^ n >>> 15, n | 1), n ^= n + Math.imul(n ^ n >>> 7, n | 61), ((n ^ n >>> 14) >>> 0) / 4294967296;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function fe(e, t, n) {
|
|
65
|
+
return e + (t - e) * n;
|
|
66
|
+
}
|
|
67
|
+
function _s(e, t) {
|
|
68
|
+
const n = He(e), o = He(t), s = ue(n.locator), r = ue(o.locator), c = w(s), i = w(r), a = c !== i, l = !a && n.sha256 !== o.sha256, u = [];
|
|
69
|
+
a && u.push({
|
|
70
|
+
kind: "entry-locator-changed",
|
|
71
|
+
previousLocator: s,
|
|
72
|
+
nextLocator: r
|
|
73
|
+
}), l && u.push({
|
|
74
|
+
kind: "entry-content-changed",
|
|
75
|
+
previousSha256: n.sha256,
|
|
76
|
+
nextSha256: o.sha256
|
|
77
|
+
});
|
|
78
|
+
const f = Ze(e, n), m = Ze(t, o), d = [.../* @__PURE__ */ new Set([
|
|
79
|
+
...f.keys(),
|
|
80
|
+
...m.keys()
|
|
81
|
+
])].sort(), g = [], p = [], S = [];
|
|
82
|
+
for (const C of d) {
|
|
83
|
+
const v = f.get(C), _ = m.get(C);
|
|
84
|
+
v && _ ? v.sha256 !== _.sha256 && g.push({
|
|
85
|
+
kind: "dependency-content-changed",
|
|
86
|
+
url: v.url,
|
|
87
|
+
previousSha256: v.sha256,
|
|
88
|
+
nextSha256: _.sha256
|
|
89
|
+
}) : v ? p.push({
|
|
90
|
+
kind: "dependency-removed",
|
|
91
|
+
url: v.url,
|
|
92
|
+
previousSha256: v.sha256
|
|
93
|
+
}) : _ && S.push({
|
|
94
|
+
kind: "dependency-added",
|
|
95
|
+
url: _.url,
|
|
96
|
+
nextSha256: _.sha256
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
u.push(...g, ...p, ...S);
|
|
100
|
+
const I = u.some((C) => C.kind === "dependency-content-changed" || C.kind === "dependency-added" || C.kind === "dependency-removed");
|
|
101
|
+
return {
|
|
102
|
+
previousRevisionId: e.revisionId,
|
|
103
|
+
nextRevisionId: t.revisionId,
|
|
104
|
+
entryLocatorChanged: a,
|
|
105
|
+
entryContentChanged: l,
|
|
106
|
+
dependencyChanged: I,
|
|
107
|
+
changes: u
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function Ze(e, t) {
|
|
111
|
+
const n = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const o of e.resources) {
|
|
113
|
+
if (o.resourceId === t.resourceId) continue;
|
|
114
|
+
const s = ue(o.locator), r = w(s);
|
|
115
|
+
n.set(r, {
|
|
116
|
+
url: s.kind === "remote-url" ? s.url : s.path,
|
|
117
|
+
sha256: o.sha256
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return n;
|
|
121
|
+
}
|
|
122
|
+
const Yt = Object.freeze({
|
|
123
|
+
renderable: !0,
|
|
124
|
+
collidable: !1,
|
|
125
|
+
rigidBody: !1,
|
|
126
|
+
articulated: !1
|
|
127
|
+
});
|
|
128
|
+
function Jt(e) {
|
|
129
|
+
const t = [...e.resources].map((o) => ({
|
|
130
|
+
...o,
|
|
131
|
+
locator: ue(o.locator)
|
|
132
|
+
})).sort((o, s) => w(o.locator).localeCompare(w(s.locator)) || o.resourceId.localeCompare(s.resourceId)), n = {
|
|
133
|
+
assetId: e.assetId,
|
|
134
|
+
label: e.label,
|
|
135
|
+
format: e.format,
|
|
136
|
+
entryResourceId: e.entryResourceId,
|
|
137
|
+
resources: t,
|
|
138
|
+
capabilities: Yt,
|
|
139
|
+
upAxis: e.upAxis ?? Zt(e.format),
|
|
140
|
+
suggestedScale: e.suggestedScale ?? [1, 1, 1],
|
|
141
|
+
...e.bounds ? { bounds: e.bounds } : {},
|
|
142
|
+
...e.metrics ? { metrics: e.metrics } : {}
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
visualRevisionId: e.visualRevisionId,
|
|
146
|
+
...n,
|
|
147
|
+
contentHash: vt(n),
|
|
148
|
+
provenance: { ...e.provenance }
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function vs(e) {
|
|
152
|
+
const t = e.resources.find((n) => n.resourceId === e.entryResourceId);
|
|
153
|
+
if (!t)
|
|
154
|
+
throw new Error(`Visual revision ${e.visualRevisionId} is missing its entry resource.`);
|
|
155
|
+
return t;
|
|
156
|
+
}
|
|
157
|
+
function Zt(e) {
|
|
158
|
+
return e.startsWith("gaussian-") ? "y-down" : "y";
|
|
159
|
+
}
|
|
160
|
+
const Wt = /^(?:f_dc_\d+|f_rest_\d+|opacity|scale_\d+|rot_\d+|packed_(?:position|rotation|scale|color))$/i, Xt = /^(?:x|y|z|red|green|blue|r|g|b)$/i;
|
|
161
|
+
function ct(e) {
|
|
162
|
+
var g;
|
|
163
|
+
const t = e instanceof Uint8Array ? e : new Uint8Array(e), n = new TextDecoder("latin1").decode(
|
|
164
|
+
t.subarray(0, Math.min(t.byteLength, 1024 * 1024))
|
|
165
|
+
), o = n.search(/\r?\nend_header\s*(?:\r?\n|$)/i);
|
|
166
|
+
if (o < 0)
|
|
167
|
+
return { kind: "unsupported", reason: "PLY header is missing end_header." };
|
|
168
|
+
const s = n.slice(0, o + 1).split(/\r?\n/).map((p) => p.trim()).filter(Boolean);
|
|
169
|
+
if (((g = s[0]) == null ? void 0 : g.toLowerCase()) !== "ply")
|
|
170
|
+
return { kind: "unsupported", reason: "PLY magic is missing." };
|
|
171
|
+
let r = null, c = 0, i = 0, a = null;
|
|
172
|
+
const l = [], u = [];
|
|
173
|
+
for (const p of s.slice(1)) {
|
|
174
|
+
const S = p.split(/\s+/);
|
|
175
|
+
if (S[0] === "format" && (r = S[1] ?? null), S[0] === "element" && S[1] && (a = S[1].toLowerCase(), l.push(a), a === "vertex" && (c = We(S[2])), a === "face" && (i = We(S[2]))), S[0] === "property" && a === "vertex") {
|
|
176
|
+
const I = S.at(-1);
|
|
177
|
+
I && u.push(I);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const f = { format: r, vertexCount: c, faceCount: i, properties: u, elements: l };
|
|
181
|
+
if (c <= 0)
|
|
182
|
+
return { kind: "unsupported", reason: "PLY has no vertex data.", ply: f };
|
|
183
|
+
if (i > 0 || l.includes("face"))
|
|
184
|
+
return { kind: "ply-mesh", reason: "PLY declares a face element.", ply: f };
|
|
185
|
+
if (u.some((p) => Wt.test(p)))
|
|
186
|
+
return { kind: "gaussian-ply", reason: "PLY declares Gaussian splat properties.", ply: f };
|
|
187
|
+
const m = new Set(u.map((p) => p.toLowerCase()));
|
|
188
|
+
if (!["x", "y", "z"].every((p) => m.has(p)))
|
|
189
|
+
return { kind: "unsupported", reason: "PLY point cloud is missing x/y/z fields.", ply: f };
|
|
190
|
+
const d = ["red", "green", "blue"].filter((p) => m.has(p));
|
|
191
|
+
return d.length !== 0 && d.length !== 3 ? { kind: "unsupported", reason: "PLY point cloud has an incomplete RGB field set.", ply: f } : u.some((p) => !Xt.test(p)) ? {
|
|
192
|
+
kind: "unsupported",
|
|
193
|
+
reason: "PLY has no faces and contains fields outside the supported point-cloud layout.",
|
|
194
|
+
ply: f
|
|
195
|
+
} : {
|
|
196
|
+
kind: "ply-point-cloud",
|
|
197
|
+
reason: "PLY has xyz vertices, no faces and no Gaussian fields.",
|
|
198
|
+
ply: f
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function We(e) {
|
|
202
|
+
const t = Number(e);
|
|
203
|
+
return Number.isInteger(t) && t >= 0 ? t : 0;
|
|
204
|
+
}
|
|
205
|
+
const qt = /* @__PURE__ */ new Set([
|
|
206
|
+
".glb",
|
|
207
|
+
".gltf",
|
|
208
|
+
".fbx",
|
|
209
|
+
".ply",
|
|
210
|
+
".spz",
|
|
211
|
+
".splat",
|
|
212
|
+
".ksplat",
|
|
213
|
+
".sog",
|
|
214
|
+
".rad"
|
|
215
|
+
]);
|
|
216
|
+
async function Rs(e, t = {}) {
|
|
217
|
+
const n = [];
|
|
218
|
+
let o = await Qt(e, n);
|
|
219
|
+
const s = await en(o, n);
|
|
220
|
+
if (s.length > 0) {
|
|
221
|
+
const l = [], u = [];
|
|
222
|
+
for (const f of s) {
|
|
223
|
+
const m = await Xe([f], f.path, t, n, !0);
|
|
224
|
+
m && (l.push(m.revision), u.push(m.source));
|
|
225
|
+
}
|
|
226
|
+
return q(l, u, n, s.map((f) => f.path));
|
|
227
|
+
}
|
|
228
|
+
if (n.some((l) => l.code === "VISUAL_INTAKE_SOG_VERSION_UNSUPPORTED"))
|
|
229
|
+
return q([], [], n, []);
|
|
230
|
+
o = await nn(o, n);
|
|
231
|
+
const r = sn(o), c = r.flatMap((l) => l.files.map((u) => u.path).filter(qe)).sort();
|
|
232
|
+
if (r.length === 0 || c.length === 0)
|
|
233
|
+
return n.push({
|
|
234
|
+
code: "VISUAL_INTAKE_UNSUPPORTED",
|
|
235
|
+
level: "error",
|
|
236
|
+
message: "No supported visual entry was found (GLB, glTF, FBX, PLY, SPZ, SPLAT, KSPLAT, SOG or RAD)."
|
|
237
|
+
}), q([], [], n, []);
|
|
238
|
+
if (c.length > 1 && !t.entry)
|
|
239
|
+
return n.push({
|
|
240
|
+
code: "VISUAL_INTAKE_AMBIGUOUS_ENTRY",
|
|
241
|
+
level: "warning",
|
|
242
|
+
message: `Multiple visual entries were found: ${c.join(", ")}.`
|
|
243
|
+
}), q([], [], n, c);
|
|
244
|
+
const i = [], a = [];
|
|
245
|
+
for (const l of r) {
|
|
246
|
+
const u = l.files.map((d) => d.path).filter(qe), f = t.entry ? Re(t.entry) : u.length === 1 ? u[0] : null;
|
|
247
|
+
if (!f) continue;
|
|
248
|
+
const m = await Xe(l.files, f, t, n, !1);
|
|
249
|
+
m && (i.push(m.revision), a.push(m.source));
|
|
250
|
+
}
|
|
251
|
+
return q(i, a, n, c);
|
|
252
|
+
}
|
|
253
|
+
async function Xe(e, t, n, o, s) {
|
|
254
|
+
var g;
|
|
255
|
+
const r = e.find((p) => p.path === t);
|
|
256
|
+
if (!r)
|
|
257
|
+
return o.push({
|
|
258
|
+
code: "VISUAL_INTAKE_ENTRY_MISSING",
|
|
259
|
+
level: "error",
|
|
260
|
+
message: `Visual entry is missing from the selected files: ${t}`
|
|
261
|
+
}), null;
|
|
262
|
+
const c = on(r.path, r.bytes, s);
|
|
263
|
+
if (!c)
|
|
264
|
+
return o.push({
|
|
265
|
+
code: "VISUAL_INTAKE_UNSUPPORTED_ENTRY",
|
|
266
|
+
level: "error",
|
|
267
|
+
message: `Visual entry format is unsupported or ambiguous: ${r.path}`
|
|
268
|
+
}), null;
|
|
269
|
+
const i = `res_${U(r.bytes).slice(0, 24)}`, a = [], l = /* @__PURE__ */ new Set();
|
|
270
|
+
for (const p of e) {
|
|
271
|
+
const S = U(p.bytes), I = `res_${S.slice(0, 24)}`, C = p.path === t ? i : l.has(I) ? `res_${U(new TextEncoder().encode(`${S}:${p.path}`)).slice(0, 24)}` : I;
|
|
272
|
+
l.add(C), a.push({
|
|
273
|
+
resourceId: C,
|
|
274
|
+
locator: { kind: "package-path", path: p.path },
|
|
275
|
+
mediaType: _e(p.path),
|
|
276
|
+
byteSize: p.bytes.byteLength,
|
|
277
|
+
sha256: S
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
const u = n.visualRevisionId ?? `vrev_${Rt()}`, f = n.label ?? cn(r.path), m = rn(c, r.bytes, a);
|
|
281
|
+
return {
|
|
282
|
+
revision: Jt({
|
|
283
|
+
visualRevisionId: u,
|
|
284
|
+
assetId: n.assetId ?? `visual_${ln(f)}`,
|
|
285
|
+
label: f,
|
|
286
|
+
format: c,
|
|
287
|
+
entryResourceId: i,
|
|
288
|
+
resources: a,
|
|
289
|
+
suggestedScale: [1, 1, 1],
|
|
290
|
+
...m ? { metrics: m } : {},
|
|
291
|
+
provenance: {
|
|
292
|
+
source: n.provenance ?? "user",
|
|
293
|
+
...n.sourceUrl ? { sourceUrl: n.sourceUrl } : {},
|
|
294
|
+
...n.license ? { license: n.license } : {},
|
|
295
|
+
importedAt: ((g = n.now) == null ? void 0 : g.call(n)) ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
296
|
+
}
|
|
297
|
+
}),
|
|
298
|
+
source: {
|
|
299
|
+
assetId: u,
|
|
300
|
+
entryLocator: { kind: "package-path", path: r.path },
|
|
301
|
+
files: e.map((p) => ({
|
|
302
|
+
locator: { kind: "package-path", path: p.path },
|
|
303
|
+
blob: p.blob
|
|
304
|
+
}))
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
async function Qt(e, t) {
|
|
309
|
+
const n = [];
|
|
310
|
+
for (const o of e) {
|
|
311
|
+
const s = new Uint8Array(await o.blob.arrayBuffer()), r = Re(o.path ?? o.name);
|
|
312
|
+
if (!r) {
|
|
313
|
+
t.push({
|
|
314
|
+
code: "VISUAL_INTAKE_INVALID_PATH",
|
|
315
|
+
level: "error",
|
|
316
|
+
message: `Visual file has no usable path: ${o.name}`
|
|
317
|
+
});
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
n.push({
|
|
321
|
+
path: r,
|
|
322
|
+
blob: new Blob([ut(s)], {
|
|
323
|
+
type: Ut(r, o.blob.type) ?? _e(r)
|
|
324
|
+
}),
|
|
325
|
+
bytes: s
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
return n;
|
|
329
|
+
}
|
|
330
|
+
async function en(e, t) {
|
|
331
|
+
const n = [];
|
|
332
|
+
for (const o of e) {
|
|
333
|
+
const s = o.path.toLowerCase();
|
|
334
|
+
if (!(!(s.endsWith(".zip") || s.endsWith(".sog")) || !lt(o.bytes)))
|
|
335
|
+
try {
|
|
336
|
+
const r = await re.loadAsync(o.bytes), c = Object.values(r.files).filter((i) => !i.dir && i.name.toLowerCase().endsWith(".json"));
|
|
337
|
+
for (const i of c) {
|
|
338
|
+
const a = JSON.parse(await i.async("string"));
|
|
339
|
+
if (!tn(a)) continue;
|
|
340
|
+
const l = Number(a.version);
|
|
341
|
+
if (Number.isInteger(l) && l > 2) {
|
|
342
|
+
t.push({
|
|
343
|
+
code: "VISUAL_INTAKE_SOG_VERSION_UNSUPPORTED",
|
|
344
|
+
level: "error",
|
|
345
|
+
message: `SOG v${l} is not supported by the current Spark decoder; rewrite it with --sog-version 2.`
|
|
346
|
+
});
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
n.push({
|
|
350
|
+
...o,
|
|
351
|
+
path: /\.sog(?:\.zip)?$/i.test(o.path) ? o.path : o.path.replace(/\.zip$/i, ".sog.zip")
|
|
352
|
+
});
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
} catch {
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return n;
|
|
359
|
+
}
|
|
360
|
+
function tn(e) {
|
|
361
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
362
|
+
const t = e;
|
|
363
|
+
return ["means", "scales", "quats", "sh0"].every((n) => {
|
|
364
|
+
const o = t[n];
|
|
365
|
+
return Array.isArray(o) ? !0 : !o || typeof o != "object" ? !1 : Array.isArray(o.files);
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
async function nn(e, t) {
|
|
369
|
+
const n = [];
|
|
370
|
+
for (const o of e) {
|
|
371
|
+
if (!o.path.toLowerCase().endsWith(".zip") || !lt(o.bytes)) {
|
|
372
|
+
n.push(o);
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
const s = await re.loadAsync(o.bytes);
|
|
377
|
+
for (const r of Object.values(s.files)) {
|
|
378
|
+
if (r.dir) continue;
|
|
379
|
+
if (!an(r.name)) {
|
|
380
|
+
t.push({
|
|
381
|
+
code: "VISUAL_INTAKE_UNSAFE_ZIP_PATH",
|
|
382
|
+
level: "error",
|
|
383
|
+
message: `ZIP contains an unsafe path: ${r.name}`
|
|
384
|
+
});
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
const c = await r.async("uint8array");
|
|
388
|
+
n.push({
|
|
389
|
+
path: Re(r.name),
|
|
390
|
+
bytes: c,
|
|
391
|
+
blob: new Blob([ut(c)], { type: _e(r.name) })
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
} catch (s) {
|
|
395
|
+
t.push({
|
|
396
|
+
code: "VISUAL_INTAKE_ZIP_MALFORMED",
|
|
397
|
+
level: "error",
|
|
398
|
+
message: `ZIP is malformed: ${s instanceof Error ? s.message : String(s)}`
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
return n;
|
|
403
|
+
}
|
|
404
|
+
function sn(e) {
|
|
405
|
+
if (e.length <= 1) return e.length ? [{ files: e }] : [];
|
|
406
|
+
if (e.filter((n) => n.path.includes("/")).length === e.length) {
|
|
407
|
+
const n = new Set(e.map((o) => o.path.split("/")[0]));
|
|
408
|
+
if (n.size === 1) {
|
|
409
|
+
const o = [...n][0];
|
|
410
|
+
return [{
|
|
411
|
+
files: e.map((s) => ({
|
|
412
|
+
...s,
|
|
413
|
+
path: s.path.startsWith(`${o}/`) ? s.path.slice(o.length + 1) : s.path
|
|
414
|
+
}))
|
|
415
|
+
}];
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return [{ files: e }];
|
|
419
|
+
}
|
|
420
|
+
function on(e, t, n) {
|
|
421
|
+
const o = e.slice(e.lastIndexOf(".")).toLowerCase();
|
|
422
|
+
if (n || o === ".sog" || e.toLowerCase().endsWith(".sog.zip")) return "gaussian-sog";
|
|
423
|
+
if (o === ".ply") {
|
|
424
|
+
const s = ct(t).kind;
|
|
425
|
+
return s === "unsupported" ? null : s;
|
|
426
|
+
}
|
|
427
|
+
return o === ".glb" ? "glb" : o === ".gltf" ? "gltf" : o === ".fbx" ? "fbx" : o === ".spz" ? "gaussian-spz" : o === ".splat" ? "gaussian-splat" : o === ".ksplat" ? "gaussian-ksplat" : o === ".rad" ? "gaussian-rad" : null;
|
|
428
|
+
}
|
|
429
|
+
function rn(e, t, n) {
|
|
430
|
+
const o = n.reduce((s, r) => s + r.byteSize, 0);
|
|
431
|
+
if (e === "ply-mesh" || e === "ply-point-cloud" || e === "gaussian-ply") {
|
|
432
|
+
const s = ct(t).ply;
|
|
433
|
+
if (s)
|
|
434
|
+
return {
|
|
435
|
+
...e === "gaussian-ply" ? { splatCount: s.vertexCount } : e === "ply-point-cloud" ? { pointCount: s.vertexCount } : { meshCount: 1 },
|
|
436
|
+
byteSize: o
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
return { byteSize: o };
|
|
440
|
+
}
|
|
441
|
+
function q(e, t, n, o) {
|
|
442
|
+
return {
|
|
443
|
+
status: e.length > 0 ? "ready" : o.length > 1 ? "needs-entry" : "blocked",
|
|
444
|
+
visualAssets: e,
|
|
445
|
+
sources: t,
|
|
446
|
+
diagnostics: n,
|
|
447
|
+
entryCandidates: o
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function qe(e) {
|
|
451
|
+
const t = e.toLowerCase();
|
|
452
|
+
if (t.endsWith(".sog.zip")) return !0;
|
|
453
|
+
const n = t.lastIndexOf(".");
|
|
454
|
+
return n >= 0 && qt.has(t.slice(n));
|
|
455
|
+
}
|
|
456
|
+
function lt(e) {
|
|
457
|
+
return e[0] === 80 && e[1] === 75;
|
|
458
|
+
}
|
|
459
|
+
function an(e) {
|
|
460
|
+
return !!e && !e.includes("\\") && !e.startsWith("/") && !/^[A-Za-z]:/.test(e) && e.split("/").every((t) => t && t !== "." && t !== "..");
|
|
461
|
+
}
|
|
462
|
+
function cn(e) {
|
|
463
|
+
return (e.split("/").pop() ?? e).replace(/\.sog\.zip$/i, "").replace(/\.[^.]+$/, "").replace(/[_-]+/g, " ").trim() || "Visual asset";
|
|
464
|
+
}
|
|
465
|
+
function ln(e) {
|
|
466
|
+
return e.toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48) || "visual";
|
|
467
|
+
}
|
|
468
|
+
function Re(e) {
|
|
469
|
+
const t = [];
|
|
470
|
+
for (const n of e.replaceAll("\\", "/").split("/"))
|
|
471
|
+
!n || n === "." || (n === ".." ? t.pop() : t.push(n));
|
|
472
|
+
return t.join("/");
|
|
473
|
+
}
|
|
474
|
+
function ut(e) {
|
|
475
|
+
const t = new Uint8Array(e.byteLength);
|
|
476
|
+
return t.set(e), t.buffer;
|
|
477
|
+
}
|
|
478
|
+
const me = "mujoco-wasm", un = [
|
|
479
|
+
"mujoco-wasm",
|
|
480
|
+
"isaac-physx",
|
|
481
|
+
"isaac-newton"
|
|
482
|
+
], dn = {
|
|
483
|
+
PKG_ENTRY_PRESENT: E("load", "never"),
|
|
484
|
+
PKG_DEPENDENCIES: E("load", "never"),
|
|
485
|
+
PKG_RELATIVE_REFERENCES: E("profile", "never"),
|
|
486
|
+
PKG_USDZ_SELF_CONTAINED: E("profile", "never"),
|
|
487
|
+
STAGE_LOADED: E("load", "never"),
|
|
488
|
+
STAGE_DEFAULTPRIM: E("load", "never"),
|
|
489
|
+
STAGE_ROOT_PRIM: E("load", "never"),
|
|
490
|
+
STAGE_UPAXIS: E("behavior", "never"),
|
|
491
|
+
STAGE_METERS_PER_UNIT: E("behavior", "never"),
|
|
492
|
+
STAGE_KILOGRAMS_PER_UNIT: E("physics", "never"),
|
|
493
|
+
STAGE_EXTENT: E("visual", "never"),
|
|
494
|
+
GEOM_MESH_COUNT: E("visual", "never"),
|
|
495
|
+
GEOM_VERTEX_COUNT: E("visual", "never"),
|
|
496
|
+
GEOM_TRIANGLE_COUNT: E("visual", "never"),
|
|
497
|
+
GEOM_DEGENERATE_FACES: E("visual", "never"),
|
|
498
|
+
GEOM_NORMALS_WINDING: E("visual", "never"),
|
|
499
|
+
GEOM_TRANSFORM_SCALE: E("behavior", "never"),
|
|
500
|
+
GEOM_PIVOT: E("visual", "never"),
|
|
501
|
+
GEOM_VISUAL_COLLISION_SEPARATION: E("visual", "never"),
|
|
502
|
+
MATERIAL_BINDING: E("visual", "never"),
|
|
503
|
+
TEXTURE_PATHS: E("visual", "never"),
|
|
504
|
+
TEXTURE_RESOLUTION: E("visual", "never"),
|
|
505
|
+
SEMANTIC_FIELDS: E("profile", "never"),
|
|
506
|
+
PHYSICS_RIGID_BODY: E("behavior", "never"),
|
|
507
|
+
PHYSICS_COLLIDER: E("physics", "never"),
|
|
508
|
+
PHYSICS_MASS: E("physics", "never"),
|
|
509
|
+
PHYSICS_DENSITY: E("physics", "never"),
|
|
510
|
+
PHYSICS_COM: E("physics", "never"),
|
|
511
|
+
PHYSICS_INERTIA: E("physics", "never"),
|
|
512
|
+
PHYSICS_MATERIAL: E("behavior", "never"),
|
|
513
|
+
PHYSICS_JOINT: E("physics", "never"),
|
|
514
|
+
PHYSICS_DRIVE: E("behavior", "never"),
|
|
515
|
+
PHYSICS_MIMIC: E("physics", "never"),
|
|
516
|
+
PHYSICS_ARTICULATION: E("physics", "never"),
|
|
517
|
+
RUNTIME_MUJOCO_COMPILE: E("physics", "never", ["mujoco-wasm"]),
|
|
518
|
+
SCENE_INITIAL_PENETRATION: E("behavior", "never", ["mujoco-wasm"]),
|
|
519
|
+
SCENE_BELOW_GROUND: E("behavior", "never", ["mujoco-wasm"]),
|
|
520
|
+
SCENE_FLOATING: E("behavior", "never", ["mujoco-wasm"]),
|
|
521
|
+
SCENE_AABB_OVERLAP: E("visual", "never", ["mujoco-wasm"]),
|
|
522
|
+
SCENE_DYNAMIC_STATIC: E("behavior", "never", ["mujoco-wasm"]),
|
|
523
|
+
SCENE_PHYSICS_COMPILE: E("physics", "target", ["mujoco-wasm"]),
|
|
524
|
+
RUNTIME_REPRODUCIBLE_CHECK: E("physics", "never", ["mujoco-wasm"])
|
|
525
|
+
};
|
|
526
|
+
function E(e, t, n = un) {
|
|
527
|
+
return { impact: e, blocking: t, targets: n };
|
|
528
|
+
}
|
|
529
|
+
const fn = {
|
|
530
|
+
rigidBodyCount: 0,
|
|
531
|
+
colliderCount: 0,
|
|
532
|
+
staticColliderCount: 0,
|
|
533
|
+
articulationRootCount: 0,
|
|
534
|
+
jointCount: 0,
|
|
535
|
+
driveCount: 0,
|
|
536
|
+
mimicCount: 0,
|
|
537
|
+
massCount: 0,
|
|
538
|
+
densityCount: 0,
|
|
539
|
+
centerOfMassCount: 0,
|
|
540
|
+
inertiaCount: 0,
|
|
541
|
+
materialCount: 0
|
|
542
|
+
};
|
|
543
|
+
async function Ns(e) {
|
|
544
|
+
var W, X, b, V, H, Y, Pe, Te, we, Me, xe, Oe, De, Ue, Le, ke, $e, Fe, Ge, Ve, Be;
|
|
545
|
+
const t = performance.now(), n = (/* @__PURE__ */ new Date()).toISOString(), o = [], s = (x) => {
|
|
546
|
+
var ze;
|
|
547
|
+
o.push({
|
|
548
|
+
...x,
|
|
549
|
+
primPath: x.primPath ?? null,
|
|
550
|
+
instanceId: x.instanceId ?? ((ze = e.instance) == null ? void 0 : ze.nodeId) ?? null,
|
|
551
|
+
execution: {
|
|
552
|
+
at: n,
|
|
553
|
+
durationMs: Math.max(0, performance.now() - t),
|
|
554
|
+
engine: x.engine ?? "sim-studio-inspection",
|
|
555
|
+
...x.detail ? { detail: x.detail } : {}
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
}, r = (...x) => T(s, ...x), c = await En(e), i = c.facts, a = e.runtime, l = ve(e.bundle), u = Tn(e.runtime), f = L((W = e.runtime) == null ? void 0 : W.physicsProperties), m = $(f == null ? void 0 : f.bodies), d = _n(e.metadata, u), g = L(u == null ? void 0 : u.stage), p = vn(i, u, e.instance), S = $(u == null ? void 0 : u.prims), I = e.instance ? Un(p, d.defaultPrim) : null;
|
|
559
|
+
T(
|
|
560
|
+
s,
|
|
561
|
+
"PKG_ENTRY_PRESENT",
|
|
562
|
+
"asset-package",
|
|
563
|
+
c.entryFound ? "pass" : "fail",
|
|
564
|
+
c.entryFound ? "info" : "error",
|
|
565
|
+
"probed",
|
|
566
|
+
c.entryFound ? `资产入口存在:${l}` : `资产包中缺少入口:${l}`,
|
|
567
|
+
c.entryFound ? "无需处理。" : "重新导入完整资产包,并确保入口文件位于包内。",
|
|
568
|
+
{ entry: l, fileCount: e.bundle.files.length }
|
|
569
|
+
), mn(r, i, c, l), T(
|
|
570
|
+
s,
|
|
571
|
+
"STAGE_LOADED",
|
|
572
|
+
"stage",
|
|
573
|
+
e.runtime ? e.runtime.phase === "ready" ? "pass" : e.runtime.phase === "failed" ? "fail" : "not-run" : "unknown",
|
|
574
|
+
e.runtime ? e.runtime.phase === "failed" ? "error" : "info" : "warning",
|
|
575
|
+
"runtime",
|
|
576
|
+
e.runtime ? e.runtime.phase === "ready" ? "Viewer 已完成当前 USD 视觉与 Stage 解析。" : `Viewer 当前加载阶段为 ${e.runtime.phase}。` : "对象尚未进入 Viewer 场景,真实 Stage 加载状态未知。",
|
|
577
|
+
((X = e.runtime) == null ? void 0 : X.phase) === "failed" ? "检查资产依赖、USD 版本、浏览器控制台和 Viewer 错误详情。" : "无需处理。",
|
|
578
|
+
{ phase: ((b = e.runtime) == null ? void 0 : b.phase) ?? null }
|
|
579
|
+
), T(
|
|
580
|
+
s,
|
|
581
|
+
"STAGE_DEFAULTPRIM",
|
|
582
|
+
"stage",
|
|
583
|
+
d.defaultPrim ? "pass" : "fail",
|
|
584
|
+
d.defaultPrim ? "info" : "error",
|
|
585
|
+
N(g == null ? void 0 : g.defaultPrim) ? "runtime" : (V = e.metadata) != null && V.defaultPrim ? "authored" : "probed",
|
|
586
|
+
d.defaultPrim ? `defaultPrim 已声明:${d.defaultPrim}` : "Stage 未声明 defaultPrim。",
|
|
587
|
+
d.defaultPrim ? "无需处理。" : '在根层设置 `defaultPrim = "<根 Prim 名>"`。',
|
|
588
|
+
{ defaultPrim: d.defaultPrim },
|
|
589
|
+
I
|
|
590
|
+
);
|
|
591
|
+
const C = d.defaultPrim, v = !!C && i.prims.some((x) => x.path === C), _ = !!C && S.some((x) => N(x.path) === C), R = v || _, M = S.length > 0, k = i.textual && i.prims.length > 0 && i.dependencies !== null && i.dependencies.references.length === 0, O = R ? "pass" : M || k ? "fail" : "unknown";
|
|
592
|
+
T(
|
|
593
|
+
s,
|
|
594
|
+
"STAGE_ROOT_PRIM",
|
|
595
|
+
"stage",
|
|
596
|
+
O,
|
|
597
|
+
O === "fail" ? "error" : "info",
|
|
598
|
+
_ ? "runtime" : v ? "authored" : M ? "runtime" : "probed",
|
|
599
|
+
R ? `根 Prim 存在:${C}` : O === "fail" ? `组合后 Stage 中未找到 defaultPrim 对应的根 Prim:${C ?? "not-authored"}。` : "当前可读入口层没有定位到根 Prim;组合后的运行时 Prim 树尚未取得。",
|
|
600
|
+
O === "fail" ? "校正 defaultPrim,或在默认层中补齐对应根 Prim。" : "等待真实 Stage 完成组合后重新检查。",
|
|
601
|
+
{
|
|
602
|
+
root: C,
|
|
603
|
+
authoredPrimCount: i.prims.length,
|
|
604
|
+
runtimePrimCount: S.length,
|
|
605
|
+
staticHierarchyComplete: k
|
|
606
|
+
},
|
|
607
|
+
I
|
|
608
|
+
), T(
|
|
609
|
+
s,
|
|
610
|
+
"STAGE_UPAXIS",
|
|
611
|
+
"stage",
|
|
612
|
+
d.upAxis ? /^(Y|Z)$/i.test(d.upAxis) ? "pass" : "fail" : "unknown",
|
|
613
|
+
d.upAxis && !/^(Y|Z)$/i.test(d.upAxis) ? "error" : "info",
|
|
614
|
+
N(g == null ? void 0 : g.upAxis) ? "runtime" : (H = e.metadata) != null && H.upAxis ? "authored" : "probed",
|
|
615
|
+
d.upAxis ? `Stage upAxis = ${d.upAxis}` : "未取得 upAxis。",
|
|
616
|
+
d.upAxis ? "无需处理。" : '在根层声明 `upAxis = "Z"` 或 `"Y"`。',
|
|
617
|
+
{ upAxis: d.upAxis }
|
|
618
|
+
), T(
|
|
619
|
+
s,
|
|
620
|
+
"STAGE_METERS_PER_UNIT",
|
|
621
|
+
"stage",
|
|
622
|
+
d.metersPerUnit !== null ? d.metersPerUnit > 0 ? "pass" : "fail" : "unknown",
|
|
623
|
+
d.metersPerUnit !== null && d.metersPerUnit <= 0 ? "error" : "info",
|
|
624
|
+
G(g == null ? void 0 : g.metersPerUnit) !== null ? "runtime" : ((Y = e.metadata) == null ? void 0 : Y.metersPerUnit) !== void 0 ? "authored" : "probed",
|
|
625
|
+
d.metersPerUnit !== null ? `metersPerUnit = ${d.metersPerUnit}` : "未取得 metersPerUnit。",
|
|
626
|
+
d.metersPerUnit !== null && d.metersPerUnit > 0 ? "无需处理。" : "声明有限且大于 0 的 metersPerUnit。",
|
|
627
|
+
{ metersPerUnit: d.metersPerUnit }
|
|
628
|
+
), T(
|
|
629
|
+
s,
|
|
630
|
+
"STAGE_KILOGRAMS_PER_UNIT",
|
|
631
|
+
"stage",
|
|
632
|
+
d.kilogramsPerUnit !== null ? d.kilogramsPerUnit > 0 ? "pass" : "fail" : "unknown",
|
|
633
|
+
d.kilogramsPerUnit !== null && d.kilogramsPerUnit <= 0 ? "error" : "info",
|
|
634
|
+
G(g == null ? void 0 : g.kilogramsPerUnit) !== null ? "runtime" : ((Pe = e.metadata) == null ? void 0 : Pe.kilogramsPerUnit) !== void 0 ? "authored" : "probed",
|
|
635
|
+
d.kilogramsPerUnit !== null ? `kilogramsPerUnit = ${d.kilogramsPerUnit}` : "未取得 kilogramsPerUnit。",
|
|
636
|
+
d.kilogramsPerUnit !== null && d.kilogramsPerUnit > 0 ? "无需处理。" : "声明有限且大于 0 的 kilogramsPerUnit。",
|
|
637
|
+
{ kilogramsPerUnit: d.kilogramsPerUnit }
|
|
638
|
+
);
|
|
639
|
+
const D = wn(u, e.scene, (Te = e.instance) == null ? void 0 : Te.nodeId);
|
|
640
|
+
T(
|
|
641
|
+
s,
|
|
642
|
+
"STAGE_EXTENT",
|
|
643
|
+
"stage",
|
|
644
|
+
D || d.extent ? "pass" : "unknown",
|
|
645
|
+
"info",
|
|
646
|
+
D ? "runtime" : "authored",
|
|
647
|
+
D ? `真实世界包围盒尺寸 ${ge(D.size)} m。` : d.extent ? `Stage 声明 extent:${ge(d.extent.min)} → ${ge(d.extent.max)}。` : "尚无真实包围盒或 authored extent。",
|
|
648
|
+
"对没有几何或需要跨引擎精确适配的资产,补充 extent 并运行真实加载。",
|
|
649
|
+
{ runtimeBounds: D, authoredExtent: d.extent }
|
|
650
|
+
);
|
|
651
|
+
const h = Rn(i, u);
|
|
652
|
+
T(
|
|
653
|
+
s,
|
|
654
|
+
"GEOM_MESH_COUNT",
|
|
655
|
+
"geometry",
|
|
656
|
+
h.meshCount === null ? "unknown" : h.meshCount > 0 ? "pass" : "fail",
|
|
657
|
+
h.meshCount === 0 ? "error" : "info",
|
|
658
|
+
h.meshSource,
|
|
659
|
+
h.meshCount === null ? "未取得网格数量。" : `检测到 ${h.meshCount} 个 Mesh Prim。`,
|
|
660
|
+
h.meshCount ? "无需处理。" : "确认入口层是否包含可渲染几何,或显式标记为无视觉几何。",
|
|
661
|
+
{ meshCount: h.meshCount }
|
|
662
|
+
), T(
|
|
663
|
+
s,
|
|
664
|
+
"GEOM_VERTEX_COUNT",
|
|
665
|
+
"geometry",
|
|
666
|
+
h.vertexCount === null ? "unknown" : h.vertexCount > 0 ? "pass" : "fail",
|
|
667
|
+
h.vertexCount === 0 ? "error" : "info",
|
|
668
|
+
h.meshSource,
|
|
669
|
+
h.vertexCount === null ? "未取得顶点数。" : `检测到 ${h.vertexCount} 个顶点。`,
|
|
670
|
+
h.vertexCount ? "无需处理。" : "修复空 Mesh 或补齐顶点数据。",
|
|
671
|
+
{ vertexCount: h.vertexCount }
|
|
672
|
+
), T(
|
|
673
|
+
s,
|
|
674
|
+
"GEOM_TRIANGLE_COUNT",
|
|
675
|
+
"geometry",
|
|
676
|
+
h.triangleCount === null ? "unknown" : h.triangleCount > 0 ? "pass" : "fail",
|
|
677
|
+
h.triangleCount === 0 ? "error" : "info",
|
|
678
|
+
h.meshSource,
|
|
679
|
+
h.triangleCount === null ? "未取得三角面数。" : `检测到 ${h.triangleCount} 个三角面。`,
|
|
680
|
+
h.triangleCount ? "无需处理。" : "检查 faceVertexCounts/faceVertexIndices 是否完整。",
|
|
681
|
+
{ triangleCount: h.triangleCount }
|
|
682
|
+
), T(
|
|
683
|
+
s,
|
|
684
|
+
"GEOM_DEGENERATE_FACES",
|
|
685
|
+
"geometry",
|
|
686
|
+
h.degenerateTriangles === null ? "unknown" : h.degenerateTriangles === 0 ? "pass" : "fail",
|
|
687
|
+
h.degenerateTriangles ? "error" : "info",
|
|
688
|
+
h.meshSource,
|
|
689
|
+
h.degenerateTriangles === null ? "当前无法直接从资产计算退化面。" : h.degenerateTriangles === 0 ? "未发现零面积或重复索引三角面。" : h.collisionDegenerateTriangles ? `检测到 ${h.degenerateTriangles} 个退化三角面,其中 ${h.collisionDegenerateTriangles} 个属于碰撞网格。` : `检测到 ${h.degenerateTriangles} 个纯视觉退化三角面。`,
|
|
690
|
+
h.collisionDegenerateTriangles ? "修复碰撞网格中的零面积三角形后重新编译物理。" : h.degenerateTriangles ? "清理视觉网格中的零面积三角形以改善渲染与后续复用。" : "无需处理。",
|
|
691
|
+
{
|
|
692
|
+
degenerateTriangles: h.degenerateTriangles,
|
|
693
|
+
collisionDegenerateTriangles: h.collisionDegenerateTriangles,
|
|
694
|
+
affectedMeshes: h.degenerateMeshes,
|
|
695
|
+
criterion: "cross(edgeA, edgeB) <= 1e-12 * maxEdgeLengthSquared"
|
|
696
|
+
},
|
|
697
|
+
void 0,
|
|
698
|
+
E(h.collisionDegenerateTriangles ? "physics" : "visual", "never")
|
|
699
|
+
), T(
|
|
700
|
+
s,
|
|
701
|
+
"GEOM_NORMALS_WINDING",
|
|
702
|
+
"geometry",
|
|
703
|
+
h.normals === null ? "unknown" : ((we = h.orientation) == null ? void 0 : we.toLowerCase()) === "lefthanded" ? "conditional" : h.normals ? "pass" : "conditional",
|
|
704
|
+
h.normals || ((Me = h.orientation) == null ? void 0 : Me.toLowerCase()) === "lefthanded" ? "warning" : "info",
|
|
705
|
+
h.meshSource,
|
|
706
|
+
h.normals === null ? "未取得法线信息。" : ((xe = h.orientation) == null ? void 0 : xe.toLowerCase()) === "lefthanded" ? "Mesh 使用 leftHanded orientation;真实跨引擎朝向需要运行时复核。" : h.normals ? "Mesh 已提供法线;本检查不替代逐面绕序/流形分析。" : "Mesh 未提供 authored 法线。",
|
|
707
|
+
"检查导出法线、绕序和 negative scale,并在目标渲染器中抽样复核。",
|
|
708
|
+
{ normals: h.normals, orientation: h.orientation }
|
|
709
|
+
);
|
|
710
|
+
const A = ((Oe = e.instance) == null ? void 0 : Oe.localTransform.scale.some((x) => !Number.isFinite(x) || x <= 0)) ?? !1, P = ((De = e.instance) == null ? void 0 : De.localTransform.scale.some((x) => Math.abs(x - 1) > 1e-6)) ?? !1;
|
|
711
|
+
T(
|
|
712
|
+
s,
|
|
713
|
+
"GEOM_TRANSFORM_SCALE",
|
|
714
|
+
"geometry",
|
|
715
|
+
e.instance ? A ? "fail" : P ? "conditional" : "pass" : "unknown",
|
|
716
|
+
A ? "error" : P ? "warning" : "info",
|
|
717
|
+
"annotated",
|
|
718
|
+
e.instance ? A ? "实例包含零值、负值或非有限缩放。" : P ? "实例使用非单位缩放;统一 MuJoCo 物理明确拒绝非单位实例缩放。" : "实例缩放为单位值。" : "没有实例变换信息。",
|
|
719
|
+
A ? "修复为零或负的缩放。" : P ? "在资产导出处烘焙缩放,或让实例恢复单位缩放后再启动统一物理。" : "无需处理。",
|
|
720
|
+
{ scale: ((Ue = e.instance) == null ? void 0 : Ue.localTransform.scale) ?? null },
|
|
721
|
+
I
|
|
722
|
+
), T(
|
|
723
|
+
s,
|
|
724
|
+
"GEOM_PIVOT",
|
|
725
|
+
"geometry",
|
|
726
|
+
"unknown",
|
|
727
|
+
"info",
|
|
728
|
+
"probed",
|
|
729
|
+
"当前 Viewer 不公开 Prim 级 pivot 基准,无法把实例原点与作者 pivot 视为同一事实。",
|
|
730
|
+
"在 DCC 中明确 pivot,并使用真实包围盒/轴心可视化人工复核。",
|
|
731
|
+
{ instancePosition: ((Le = e.instance) == null ? void 0 : Le.localTransform.position) ?? null },
|
|
732
|
+
I
|
|
733
|
+
), T(
|
|
734
|
+
s,
|
|
735
|
+
"GEOM_VISUAL_COLLISION_SEPARATION",
|
|
736
|
+
"geometry",
|
|
737
|
+
i.physics.colliderCount === 0 && !tt(u) ? "not-run" : (ke = a == null ? void 0 : a.capabilities) != null && ke.canToggleCollision ? "pass" : "conditional",
|
|
738
|
+
"info",
|
|
739
|
+
($e = a == null ? void 0 : a.capabilities) != null && $e.canToggleCollision ? "runtime" : "probed",
|
|
740
|
+
i.physics.colliderCount === 0 && !tt(u) ? "未发现碰撞 API,无法评价 visual/collision 分离。" : (Fe = a == null ? void 0 : a.capabilities) != null && Fe.canToggleCollision ? "Viewer 能独立构建并切换碰撞调试代理。" : "检测到碰撞定义,但当前证据不足以证明 visual/collision 已分离。",
|
|
741
|
+
"为碰撞体使用独立 proxy/guide Prim,并通过碰撞代理显示复核。",
|
|
742
|
+
{
|
|
743
|
+
colliderCount: i.physics.colliderCount,
|
|
744
|
+
runtimeColliderCount: (f == null ? void 0 : f.geomCount) ?? null,
|
|
745
|
+
canToggleCollision: ((Ge = a == null ? void 0 : a.capabilities) == null ? void 0 : Ge.canToggleCollision) ?? !1
|
|
746
|
+
},
|
|
747
|
+
I
|
|
748
|
+
), hn(r, i, e.metadata, p, e.bundle), await pn(r, e.bundle, e.metadata, i, n);
|
|
749
|
+
const z = Dn(i.semanticFields, ((Ve = e.metadata) == null ? void 0 : Ve.semanticFields) ?? []);
|
|
750
|
+
T(
|
|
751
|
+
s,
|
|
752
|
+
"SEMANTIC_FIELDS",
|
|
753
|
+
"semantics",
|
|
754
|
+
z.valueCount > 0 ? "pass" : "not-run",
|
|
755
|
+
z.valueCount > 0 ? "info" : "warning",
|
|
756
|
+
"authored",
|
|
757
|
+
z.valueCount > 0 ? `检测到 ${z.attributeCount} 个语义属性、${z.primCount} 个语义 Prim。` : "入口层没有声明真实 semantic:* 字段。",
|
|
758
|
+
z.valueCount > 0 ? "无需处理;仍需业务侧确认语义分类是否符合目标本体。" : "如果资产需要参与语义检索/任务规划,请按项目采用的 semantic schema 标注。",
|
|
759
|
+
z.evidence,
|
|
760
|
+
I
|
|
761
|
+
), gn(
|
|
762
|
+
r,
|
|
763
|
+
i,
|
|
764
|
+
u,
|
|
765
|
+
f,
|
|
766
|
+
a,
|
|
767
|
+
I,
|
|
768
|
+
e.instance,
|
|
769
|
+
e.asset.capabilities.physics === "authored" ? "usd-authored" : e.asset.capabilities.physics === "none" ? "none" : "unknown"
|
|
770
|
+
), Sn(r, e, i, m, I);
|
|
771
|
+
const ie = Pn(o);
|
|
772
|
+
return {
|
|
773
|
+
assetId: e.asset.assetId,
|
|
774
|
+
instanceId: ((Be = e.instance) == null ? void 0 : Be.nodeId) ?? null,
|
|
775
|
+
entryPath: l,
|
|
776
|
+
checkedAt: n,
|
|
777
|
+
readiness: ie,
|
|
778
|
+
findings: o,
|
|
779
|
+
prims: p
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
function mn(e, t, n, o) {
|
|
783
|
+
const s = t.dependencies;
|
|
784
|
+
if (!s) {
|
|
785
|
+
e(
|
|
786
|
+
"PKG_DEPENDENCIES",
|
|
787
|
+
"asset-package",
|
|
788
|
+
"unknown",
|
|
789
|
+
"warning",
|
|
790
|
+
"probed",
|
|
791
|
+
"无法读取入口或容器内部层,依赖完整性未执行。",
|
|
792
|
+
"提供完整文本 USD 文件或可读取的 USDZ 容器后重新检查。",
|
|
793
|
+
{ entry: o, zip: n.zip }
|
|
794
|
+
);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
e(
|
|
798
|
+
"PKG_DEPENDENCIES",
|
|
799
|
+
"asset-package",
|
|
800
|
+
s.missing.length ? "fail" : "pass",
|
|
801
|
+
s.missing.length ? "error" : "info",
|
|
802
|
+
"probed",
|
|
803
|
+
s.missing.length ? `${s.missing.length} 个包内依赖缺失。` : `依赖扫描完成:${s.references.length} 个引用,无缺失包内依赖。`,
|
|
804
|
+
s.missing.length ? "补齐缺失文件或修复引用路径。" : "无需处理。",
|
|
805
|
+
{ missing: s.missing, references: s.references }
|
|
806
|
+
), e(
|
|
807
|
+
"PKG_RELATIVE_REFERENCES",
|
|
808
|
+
"asset-package",
|
|
809
|
+
s.unanchored.length || s.external.length ? "conditional" : "pass",
|
|
810
|
+
s.unanchored.length || s.external.length ? "warning" : "info",
|
|
811
|
+
"probed",
|
|
812
|
+
s.unanchored.length || s.external.length ? `${s.unanchored.length} 个未锚定相对引用,${s.external.length} 个外部 URI。` : "所有资产依赖都是包内锚定相对路径。",
|
|
813
|
+
s.unanchored.length || s.external.length ? "把资产依赖改为 `./`/`../` 包内相对路径,并在需要时内嵌到 USDZ。" : "无需处理。",
|
|
814
|
+
{ unanchored: s.unanchored, external: s.external }
|
|
815
|
+
), e(
|
|
816
|
+
"PKG_USDZ_SELF_CONTAINED",
|
|
817
|
+
"asset-package",
|
|
818
|
+
n.isUsdz ? s.external.length ? "fail" : "pass" : "not-run",
|
|
819
|
+
n.isUsdz && s.external.length ? "error" : "info",
|
|
820
|
+
"probed",
|
|
821
|
+
n.isUsdz ? s.external.length ? `USDZ 中仍检测到 ${s.external.length} 个外部 URI。` : `USDZ 容器可读取,包含 ${n.zipFileCount} 个内嵌文件。` : "入口不是 USDZ;本项未执行。",
|
|
822
|
+
n.isUsdz ? s.external.length ? "移除 USDZ 包外依赖或重新打包。" : "无需处理。" : "若交付目标是单文件 USDZ,请执行 USDZ 打包并使用该入口复检。",
|
|
823
|
+
{ zip: n.zip, zipFileCount: n.zipFileCount }
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
function hn(e, t, n, o, s) {
|
|
827
|
+
var i;
|
|
828
|
+
const r = t.materialBindings.length ? t.materialBindings : (n == null ? void 0 : n.materialBindings) ?? [], c = t.meshes.length || (n == null ? void 0 : n.meshCount) || 0;
|
|
829
|
+
e(
|
|
830
|
+
"MATERIAL_BINDING",
|
|
831
|
+
"materials-textures",
|
|
832
|
+
c === 0 ? "not-run" : r.length ? "pass" : t.textual ? "conditional" : "unknown",
|
|
833
|
+
r.length || c === 0 ? "info" : "warning",
|
|
834
|
+
t.textual ? "authored" : "runtime",
|
|
835
|
+
c === 0 ? "没有可评价材质绑定的 Mesh。" : r.length ? `检测到 ${r.length} 条 material:binding。` : "存在 Mesh,但入口文本中没有 material:binding。",
|
|
836
|
+
r.length ? "无需处理;逐材质复核仍需真实渲染截图。" : "为需要稳定外观的 Mesh 绑定 Material,或明确记录使用 displayColor。",
|
|
837
|
+
{ bindings: r, meshCount: c, materialCount: (n == null ? void 0 : n.materials.length) ?? null },
|
|
838
|
+
(i = o.find((a) => a.typeName.toLowerCase().includes("mesh"))) == null ? void 0 : i.path
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
async function pn(e, t, n, o, s) {
|
|
842
|
+
var f;
|
|
843
|
+
const r = ((f = o.dependencies) == null ? void 0 : f.references.filter((m) => m.kind === "asset" && Vn(m.target)).map((m) => {
|
|
844
|
+
var g;
|
|
845
|
+
const d = ((g = t.files.find((p) => K(p.locator) === m.fromPath)) == null ? void 0 : g.locator) ?? t.entryLocator;
|
|
846
|
+
return {
|
|
847
|
+
path: m.target,
|
|
848
|
+
fromLocator: d,
|
|
849
|
+
resolvedPath: m.resolvedPath
|
|
850
|
+
};
|
|
851
|
+
})) ?? [], c = r.length > 0 ? r : ((n == null ? void 0 : n.textures) ?? []).map((m) => {
|
|
852
|
+
const d = rt(
|
|
853
|
+
t.entryLocator,
|
|
854
|
+
m,
|
|
855
|
+
t.files.map((g) => g.locator)
|
|
856
|
+
);
|
|
857
|
+
return {
|
|
858
|
+
path: m,
|
|
859
|
+
fromLocator: t.entryLocator,
|
|
860
|
+
resolvedPath: d && t.files.some((g) => w(g.locator) === w(d)) ? K(d) : null
|
|
861
|
+
};
|
|
862
|
+
}), i = [...new Map(c.map((m) => [
|
|
863
|
+
`${w(m.fromLocator)}\0${m.path}`,
|
|
864
|
+
m
|
|
865
|
+
])).values()];
|
|
866
|
+
if (!i.length) {
|
|
867
|
+
e(
|
|
868
|
+
"TEXTURE_PATHS",
|
|
869
|
+
"materials-textures",
|
|
870
|
+
"not-run",
|
|
871
|
+
"info",
|
|
872
|
+
"authored",
|
|
873
|
+
"入口层没有声明外置图像纹理。",
|
|
874
|
+
"若材质依赖纹理,请确认引用写在可扫描层中。",
|
|
875
|
+
{ paths: [] }
|
|
876
|
+
), e(
|
|
877
|
+
"TEXTURE_RESOLUTION",
|
|
878
|
+
"materials-textures",
|
|
879
|
+
"not-run",
|
|
880
|
+
"info",
|
|
881
|
+
"probed",
|
|
882
|
+
"没有可探测的外置纹理。",
|
|
883
|
+
"无需处理。",
|
|
884
|
+
{ probes: [] }
|
|
885
|
+
);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
const a = await Promise.all(
|
|
889
|
+
i.map((m) => bn(t, m))
|
|
890
|
+
), l = a.filter((m) => !m.found), u = a.filter((m) => m.found && !m.width);
|
|
891
|
+
e(
|
|
892
|
+
"TEXTURE_PATHS",
|
|
893
|
+
"materials-textures",
|
|
894
|
+
l.length ? "fail" : "pass",
|
|
895
|
+
l.length ? "error" : "info",
|
|
896
|
+
"probed",
|
|
897
|
+
l.length ? `${l.length}/${i.length} 个纹理路径无法在资产包中解析。` : `${i.length} 个纹理路径均可解析到包内文件。`,
|
|
898
|
+
l.length ? "补齐纹理文件或修复相对路径。" : "无需处理。",
|
|
899
|
+
{ probes: a }
|
|
900
|
+
), e(
|
|
901
|
+
"TEXTURE_RESOLUTION",
|
|
902
|
+
"materials-textures",
|
|
903
|
+
u.length ? "unknown" : "pass",
|
|
904
|
+
u.length ? "warning" : "info",
|
|
905
|
+
"probed",
|
|
906
|
+
u.length ? `${u.length}/${i.length} 个纹理无法在当前浏览器探测像素尺寸。` : `已取得 ${a.length} 个纹理的真实像素尺寸。`,
|
|
907
|
+
u.length ? "确认浏览器支持该编码,或在离线资产检查器中读取尺寸。" : "无需处理。",
|
|
908
|
+
{ probes: a, checkedAt: s }
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
function gn(e, t, n, o, s, r, c, i) {
|
|
912
|
+
var h, A, P, z, ie, W, X;
|
|
913
|
+
const a = t.physics, l = $((n == null ? void 0 : n.physics) && ((h = L(n.physics)) == null ? void 0 : h.rigidBodies)), u = $((n == null ? void 0 : n.physics) && ((A = L(n.physics)) == null ? void 0 : A.colliders)), f = $((n == null ? void 0 : n.physics) && ((P = L(n.physics)) == null ? void 0 : P.joints)), m = $((n == null ? void 0 : n.physics) && ((z = L(n.physics)) == null ? void 0 : z.articulationRoots)), d = l.filter((b) => b.enabled !== !1), g = u.filter((b) => b.enabled !== !1), p = Math.max(a.rigidBodyCount, d.length), S = Math.max(a.colliderCount, g.length), I = ((ie = s == null ? void 0 : s.physics) == null ? void 0 : ie.status) ?? "unknown", C = new Set(d.map((b) => N(b.path)).filter((b) => !!b)), v = g.filter((b) => {
|
|
914
|
+
const V = N(b.bodyPath);
|
|
915
|
+
return !!V && !C.has(V);
|
|
916
|
+
}), _ = f.filter((b) => b.enabled !== !1), R = _.filter((b) => N(b.body0) && !C.has(N(b.body0)) || N(b.body1) && !C.has(N(b.body1))), M = Mn(_), k = xn(m.map((b) => N(b.path)).filter((b) => !!b)), O = d.filter((b) => b.kinematicEnabled !== !0), F = O.filter((b) => {
|
|
917
|
+
const V = L(b.mass), H = G(V == null ? void 0 : V.mass) ?? G(b.mass);
|
|
918
|
+
return H === null || H <= 0;
|
|
919
|
+
});
|
|
920
|
+
e(
|
|
921
|
+
"PHYSICS_RIGID_BODY",
|
|
922
|
+
"physics",
|
|
923
|
+
p > 0 ? "pass" : (c == null ? void 0 : c.physics.kind) === "dynamic" ? "fail" : i === "none" ? "not-run" : "unknown",
|
|
924
|
+
(c == null ? void 0 : c.physics.kind) === "dynamic" && p === 0 ? "error" : "info",
|
|
925
|
+
p > 0 ? "authored" : "probed",
|
|
926
|
+
p > 0 ? `检测到 ${p} 个启用的 RigidBody API。` : (c == null ? void 0 : c.physics.kind) === "dynamic" ? "实例声明为动态,但没有可解析的启用 RigidBody。" : "未取得真实 RigidBody 定义。",
|
|
927
|
+
p > 0 ? "无需处理。" : "若对象需要动态行为,请声明 PhysicsRigidBodyAPI。",
|
|
928
|
+
{ rigidBodyCount: p, physicsStatus: I },
|
|
929
|
+
r
|
|
930
|
+
), e(
|
|
931
|
+
"PHYSICS_COLLIDER",
|
|
932
|
+
"physics",
|
|
933
|
+
S > 0 && v.length === 0 ? "pass" : p > 0 || v.length ? "fail" : i === "none" ? "not-run" : "unknown",
|
|
934
|
+
p > 0 && S === 0 || v.length ? "error" : "info",
|
|
935
|
+
S > 0 ? "authored" : "probed",
|
|
936
|
+
S > 0 ? v.length ? `检测到 ${v.length} 个碰撞体引用了不存在的刚体所有者。` : `检测到 ${S} 个碰撞体,其中 ${a.staticColliderCount} 个是静态碰撞体。` : p > 0 ? "存在启用刚体,但没有碰撞几何。" : "未取得真实 Collider API。",
|
|
937
|
+
S > 0 && !v.length ? "无需处理。" : "为需要参与碰撞的对象声明有效 PhysicsCollisionAPI,并确保碰撞体所有者存在。",
|
|
938
|
+
{
|
|
939
|
+
colliderCount: S,
|
|
940
|
+
staticColliderCount: a.staticColliderCount,
|
|
941
|
+
orphanColliders: v
|
|
942
|
+
},
|
|
943
|
+
r
|
|
944
|
+
);
|
|
945
|
+
for (const [b, V, H] of [
|
|
946
|
+
["PHYSICS_DENSITY", a.densityCount, "physics:density"],
|
|
947
|
+
["PHYSICS_COM", a.centerOfMassCount, "physics:centerOfMass"],
|
|
948
|
+
["PHYSICS_INERTIA", a.inertiaCount, "physics:diagonalInertia"]
|
|
949
|
+
]) {
|
|
950
|
+
const Y = V > 0 || On(o, b);
|
|
951
|
+
e(
|
|
952
|
+
b,
|
|
953
|
+
"physics",
|
|
954
|
+
Y ? "pass" : p ? "conditional" : "not-run",
|
|
955
|
+
Y ? "info" : "warning",
|
|
956
|
+
Y ? "authored" : "probed",
|
|
957
|
+
Y ? `${H} 已声明。` : p ? `${H} 未声明或无法从入口文本确认。` : "没有动态刚体,本项未执行。",
|
|
958
|
+
Y ? "无需处理。" : "声明确定的质量属性,或明确接受由碰撞几何推导的质量分布。",
|
|
959
|
+
{ authoredCount: V, runtime: o ?? null },
|
|
960
|
+
r
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
const D = O.length > 0;
|
|
964
|
+
e(
|
|
965
|
+
"PHYSICS_MASS",
|
|
966
|
+
"physics",
|
|
967
|
+
O.length || a.rigidBodyCount ? D ? F.length ? "fail" : "pass" : a.massCount || a.densityCount ? "pass" : "conditional" : "not-run",
|
|
968
|
+
D && F.length ? "error" : p && !a.massCount && !a.densityCount ? "warning" : "info",
|
|
969
|
+
D ? "runtime" : "authored",
|
|
970
|
+
D ? F.length ? `${F.length}/${O.length} 个动态刚体没有正质量。` : `${O.length} 个动态刚体均具有正质量。` : a.massCount || a.densityCount ? "已声明质量或密度,最终质量由目标物理后端解析。" : p ? "动态刚体缺少可确认的质量或密度。" : "没有动态刚体,本项未执行。",
|
|
971
|
+
F.length ? "为每个动态刚体或其碰撞体声明正质量,或声明可计算质量的密度。" : "无需处理。",
|
|
972
|
+
{
|
|
973
|
+
authoredMassCount: a.massCount,
|
|
974
|
+
authoredDensityCount: a.densityCount,
|
|
975
|
+
bodiesMissingPositiveMass: F,
|
|
976
|
+
runtime: o ?? null
|
|
977
|
+
},
|
|
978
|
+
r
|
|
979
|
+
), e(
|
|
980
|
+
"PHYSICS_MATERIAL",
|
|
981
|
+
"physics",
|
|
982
|
+
a.materialCount > 0 ? "pass" : S ? "conditional" : "not-run",
|
|
983
|
+
a.materialCount > 0 ? "info" : "warning",
|
|
984
|
+
"authored",
|
|
985
|
+
a.materialCount > 0 ? `检测到 ${a.materialCount} 个 PhysicsMaterial。` : S ? "碰撞体存在但没有可见 PhysicsMaterial 声明。" : "没有碰撞体,本项未执行。",
|
|
986
|
+
a.materialCount > 0 ? "无需处理。" : "为关键接触面声明 friction/restitution。",
|
|
987
|
+
{ materialCount: a.materialCount },
|
|
988
|
+
r
|
|
989
|
+
), e(
|
|
990
|
+
"PHYSICS_JOINT",
|
|
991
|
+
"physics",
|
|
992
|
+
R.length || M.length ? "fail" : _.length || a.jointCount ? "pass" : "not-run",
|
|
993
|
+
R.length || M.length ? "error" : "info",
|
|
994
|
+
_.length ? "runtime" : "authored",
|
|
995
|
+
R.length ? `${R.length} 个启用的物理关节引用了不存在的刚体目标。` : M.length ? `${M.length} 组刚体之间存在多个未排除于 articulation 的关节。` : _.length || a.jointCount ? `检测到 ${Math.max(_.length, a.jointCount)} 个物理关节。` : "资产没有关节。",
|
|
996
|
+
R.length || M.length ? "修正 body0/body1 目标,或删除/排除重复关节。" : "无需处理。",
|
|
997
|
+
{
|
|
998
|
+
jointCount: Math.max(_.length, a.jointCount),
|
|
999
|
+
invalidJointTargets: R,
|
|
1000
|
+
duplicateJointPairs: M
|
|
1001
|
+
},
|
|
1002
|
+
r
|
|
1003
|
+
), e(
|
|
1004
|
+
"PHYSICS_DRIVE",
|
|
1005
|
+
"physics",
|
|
1006
|
+
a.driveCount ? "pass" : a.jointCount ? "conditional" : "not-run",
|
|
1007
|
+
a.jointCount && !a.driveCount ? "warning" : "info",
|
|
1008
|
+
"authored",
|
|
1009
|
+
a.driveCount ? `检测到 ${a.driveCount} 个 drive 属性。` : a.jointCount ? "关节未声明驱动。" : "没有关节,本项未执行。",
|
|
1010
|
+
a.driveCount ? "无需处理。" : "需要主动控制时声明 drive。",
|
|
1011
|
+
{ driveCount: a.driveCount },
|
|
1012
|
+
r
|
|
1013
|
+
), e(
|
|
1014
|
+
"PHYSICS_MIMIC",
|
|
1015
|
+
"physics",
|
|
1016
|
+
a.mimicCount ? "pass" : "not-run",
|
|
1017
|
+
"info",
|
|
1018
|
+
"authored",
|
|
1019
|
+
a.mimicCount ? `检测到 ${a.mimicCount} 个 mimic 约束。` : "入口层没有 mimic 声明。",
|
|
1020
|
+
"无需处理。",
|
|
1021
|
+
{ mimicCount: a.mimicCount },
|
|
1022
|
+
r
|
|
1023
|
+
), e(
|
|
1024
|
+
"PHYSICS_ARTICULATION",
|
|
1025
|
+
"physics",
|
|
1026
|
+
k.length ? "fail" : a.articulationRootCount || m.length ? "pass" : a.jointCount || _.length ? "conditional" : "not-run",
|
|
1027
|
+
k.length ? "error" : (a.jointCount || _.length) && !a.articulationRootCount && !m.length ? "warning" : "info",
|
|
1028
|
+
m.length ? "runtime" : "authored",
|
|
1029
|
+
k.length ? `检测到 ${k.length} 个嵌套 ArticulationRoot。` : a.articulationRootCount || m.length ? `检测到 ${Math.max(a.articulationRootCount, m.length)} 个 ArticulationRoot。` : a.jointCount || _.length ? "存在关节,但没有 articulation root。" : "没有关节,本项未执行。",
|
|
1030
|
+
k.length ? "删除嵌套的 ArticulationRoot,只保留 articulation 树的唯一根。" : "需要 articulation 语义时声明 PhysicsArticulationRootAPI。",
|
|
1031
|
+
{
|
|
1032
|
+
articulationRootCount: Math.max(a.articulationRootCount, m.length),
|
|
1033
|
+
nestedArticulationRoots: k
|
|
1034
|
+
},
|
|
1035
|
+
r
|
|
1036
|
+
), e(
|
|
1037
|
+
"RUNTIME_MUJOCO_COMPILE",
|
|
1038
|
+
"runtime",
|
|
1039
|
+
I === "ready" ? "pass" : I === "unavailable" ? "fail" : I === "not-authored" ? "not-run" : "unknown",
|
|
1040
|
+
I === "unavailable" ? "error" : "info",
|
|
1041
|
+
"runtime",
|
|
1042
|
+
I === "ready" ? "MuJoCo 子集已成功编译并初始化。" : I === "unavailable" ? `MuJoCo 子集初始化失败:${((X = (W = s == null ? void 0 : s.physics) == null ? void 0 : W.issue) == null ? void 0 : X.message) ?? "未提供原因"}` : `当前物理状态:${I}`,
|
|
1043
|
+
I === "unavailable" ? "根据错误码修复 USD 物理映射;修复前保持视觉预览,不进入仿真。" : "无需处理。",
|
|
1044
|
+
{ physics: (s == null ? void 0 : s.physics) ?? null },
|
|
1045
|
+
r
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1048
|
+
function Sn(e, t, n, o, s) {
|
|
1049
|
+
var k, O, F, D, h;
|
|
1050
|
+
const r = (k = t.scene) == null ? void 0 : k.physicsState, c = (r == null ? void 0 : r.status) === "ready" ? "pass" : (r == null ? void 0 : r.status) === "unavailable" ? "fail" : (r == null ? void 0 : r.status) === "not-authored" ? "not-run" : "unknown";
|
|
1051
|
+
e(
|
|
1052
|
+
"SCENE_PHYSICS_COMPILE",
|
|
1053
|
+
"scene",
|
|
1054
|
+
c,
|
|
1055
|
+
c === "fail" ? "error" : c === "unknown" ? "warning" : "info",
|
|
1056
|
+
"runtime",
|
|
1057
|
+
c === "pass" ? "Viewer 已完成统一场景 MuJoCo 编译与初始化。" : c === "fail" ? `统一场景物理不可用:${((O = r == null ? void 0 : r.issue) == null ? void 0 : O.message) ?? "未提供原因"}` : c === "not-run" ? "当前场景没有已公开的 MuJoCo 物理源。" : `统一场景物理状态:${(r == null ? void 0 : r.status) ?? "not-observed"}。`,
|
|
1058
|
+
c === "fail" ? "根据 Viewer 返回的错误修复统一场景编译;这是当前唯一会阻止启动的检查。" : "无需处理。",
|
|
1059
|
+
{ physicsState: r ?? null },
|
|
1060
|
+
s
|
|
1061
|
+
);
|
|
1062
|
+
const i = (F = t.scene) == null ? void 0 : F.deterministic;
|
|
1063
|
+
if (!i) {
|
|
1064
|
+
for (const [A, P] of [
|
|
1065
|
+
["SCENE_INITIAL_PENETRATION", "尚未运行固定初态 MuJoCo 检查。"],
|
|
1066
|
+
["SCENE_BELOW_GROUND", "尚未运行固定初态 MuJoCo 检查。"],
|
|
1067
|
+
["SCENE_FLOATING", "尚未运行固定初态 MuJoCo 检查。"],
|
|
1068
|
+
["SCENE_AABB_OVERLAP", "尚未运行固定初态 MuJoCo 检查。"],
|
|
1069
|
+
["SCENE_DYNAMIC_STATIC", "尚未运行固定初态 MuJoCo 检查。"]
|
|
1070
|
+
])
|
|
1071
|
+
e(
|
|
1072
|
+
A,
|
|
1073
|
+
"scene",
|
|
1074
|
+
"not-run",
|
|
1075
|
+
"info",
|
|
1076
|
+
"runtime",
|
|
1077
|
+
P,
|
|
1078
|
+
"在检查页运行“固定步长场景检查”,本项不会使用交互调试结果。",
|
|
1079
|
+
{ deterministic: null },
|
|
1080
|
+
s
|
|
1081
|
+
);
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
if (i.status !== "completed") {
|
|
1085
|
+
for (const [A, P] of [
|
|
1086
|
+
["SCENE_INITIAL_PENETRATION", "没有可用的 MuJoCo 固定初态数据。"],
|
|
1087
|
+
["SCENE_BELOW_GROUND", "没有可用的 MuJoCo 固定初态数据。"],
|
|
1088
|
+
["SCENE_FLOATING", "没有可用的 MuJoCo 固定初态数据。"],
|
|
1089
|
+
["SCENE_AABB_OVERLAP", "没有可用的 MuJoCo 固定初态数据。"],
|
|
1090
|
+
["SCENE_DYNAMIC_STATIC", "没有可用的 MuJoCo 动态/静态分类。"]
|
|
1091
|
+
])
|
|
1092
|
+
e(
|
|
1093
|
+
A,
|
|
1094
|
+
"scene",
|
|
1095
|
+
i.status === "unavailable" ? "unsupported" : "not-run",
|
|
1096
|
+
"warning",
|
|
1097
|
+
"runtime",
|
|
1098
|
+
`${P} ${i.reason ?? ""}`.trim(),
|
|
1099
|
+
"确认场景包含可编译物理后重新运行。",
|
|
1100
|
+
{ deterministic: i },
|
|
1101
|
+
s
|
|
1102
|
+
);
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
const a = i.initial, l = i.final, u = Number((a == null ? void 0 : a.contactCount) ?? 0), f = Number((a == null ? void 0 : a.maxPenetration) ?? 0), m = se(l == null ? void 0 : l.qvel), d = m.length ? Math.max(...m.map(Math.abs)) : 0;
|
|
1106
|
+
e(
|
|
1107
|
+
"SCENE_INITIAL_PENETRATION",
|
|
1108
|
+
"scene",
|
|
1109
|
+
f > 1e-4 ? "fail" : u > 0 ? "pass" : "conditional",
|
|
1110
|
+
f > 1e-4 ? "error" : u > 0 ? "info" : "warning",
|
|
1111
|
+
"runtime",
|
|
1112
|
+
f > 1e-4 ? `固定初态最大穿透 ${f.toFixed(6)} m。` : u > 0 ? `固定初态检测到 ${u} 个接触,最大穿透 ${f.toFixed(6)} m。` : "固定初态没有检测到接触。",
|
|
1113
|
+
f > 1e-4 ? "调整初始位姿、碰撞代理或地面高度。" : "无需处理。",
|
|
1114
|
+
{ initial: a },
|
|
1115
|
+
s
|
|
1116
|
+
);
|
|
1117
|
+
const g = (D = t.instance) == null ? void 0 : D.nodeId, p = g ? i.bounds[g] : null, S = Object.entries(i.bounds).filter(([, A]) => A.min[2] < -1e-4);
|
|
1118
|
+
e(
|
|
1119
|
+
"SCENE_BELOW_GROUND",
|
|
1120
|
+
"scene",
|
|
1121
|
+
S.length ? "fail" : Object.keys(i.bounds).length ? "pass" : "unknown",
|
|
1122
|
+
S.length ? "error" : "info",
|
|
1123
|
+
"runtime",
|
|
1124
|
+
S.length ? `${S.length} 个实例包围盒低于地面。` : Object.keys(i.bounds).length ? "实例包围盒均不低于地面。" : "没有实例包围盒数据。",
|
|
1125
|
+
S.length ? "上移初始姿态或修正地面/碰撞代理。" : "无需处理。",
|
|
1126
|
+
{ bounds: p, violations: S },
|
|
1127
|
+
s
|
|
1128
|
+
);
|
|
1129
|
+
const I = new Set(
|
|
1130
|
+
[...$(a == null ? void 0 : a.contacts), ...$(l == null ? void 0 : l.contacts)].flatMap((A) => [A.instance1, A.instance2]).filter((A) => typeof A == "string")
|
|
1131
|
+
), C = Object.entries(i.bounds).filter(([A, P]) => P.min[2] > 0.02 && !I.has(A));
|
|
1132
|
+
e(
|
|
1133
|
+
"SCENE_FLOATING",
|
|
1134
|
+
"scene",
|
|
1135
|
+
C.length ? "conditional" : Object.keys(i.bounds).length ? "pass" : "unknown",
|
|
1136
|
+
C.length ? "warning" : "info",
|
|
1137
|
+
"runtime",
|
|
1138
|
+
C.length ? `${C.length} 个实例在当前接触图中悬空;可能是合法的空中初始状态。` : Object.keys(i.bounds).length ? "未发现无接触且明显离地的实例。" : "没有实例包围盒数据。",
|
|
1139
|
+
C.length ? "若资产应落地,请降低初始高度;若是任务初始状态,保留注解说明。" : "无需处理。",
|
|
1140
|
+
{ unsupportedFloating: C, touching: [...I] },
|
|
1141
|
+
s
|
|
1142
|
+
), e(
|
|
1143
|
+
"SCENE_AABB_OVERLAP",
|
|
1144
|
+
"scene",
|
|
1145
|
+
i.overlaps.length ? "conditional" : "pass",
|
|
1146
|
+
i.overlaps.length ? "warning" : "info",
|
|
1147
|
+
"runtime",
|
|
1148
|
+
i.overlaps.length ? `${i.overlaps.length} 对实例的世界 AABB 重叠;该指标不是精确穿透判定。` : "实例世界 AABB 未发现重叠。",
|
|
1149
|
+
i.overlaps.length ? "结合碰撞代理和接触证据复核,必要时调整布局。" : "无需处理。",
|
|
1150
|
+
{ overlaps: i.overlaps },
|
|
1151
|
+
s
|
|
1152
|
+
);
|
|
1153
|
+
const v = t.scene ? xt(t.scene.doc).find((A) => {
|
|
1154
|
+
var P;
|
|
1155
|
+
return A.nodeId === ((P = t.instance) == null ? void 0 : P.nodeId);
|
|
1156
|
+
}) : void 0, _ = Object.entries(i.bodyMotion), R = t.instance ? i.bodyMotion[t.instance.nodeId] : void 0, M = (v == null ? void 0 : v.physics.kind) ?? ((h = t.instance) == null ? void 0 : h.physics.kind);
|
|
1157
|
+
e(
|
|
1158
|
+
"SCENE_DYNAMIC_STATIC",
|
|
1159
|
+
"scene",
|
|
1160
|
+
R ? M === "dynamic" && R !== "dynamic" || M === "static" && R === "dynamic" ? "fail" : "pass" : "unknown",
|
|
1161
|
+
R && (M === "dynamic" && R !== "dynamic" || M === "static" && R === "dynamic") ? "error" : "info",
|
|
1162
|
+
"annotated",
|
|
1163
|
+
R ? `实例意图 ${M ?? "unknown"},MuJoCo 实际分类 ${R}。` : "没有该实例的 MuJoCo 动态/静态分类。",
|
|
1164
|
+
R ? "校正 PhysicsIntent 或 USD 刚体/碰撞声明。" : "运行固定步长场景检查后重试。",
|
|
1165
|
+
{ selectedMotion: R, runtimeMotion: _, runtimeBodies: o },
|
|
1166
|
+
s
|
|
1167
|
+
), e(
|
|
1168
|
+
"RUNTIME_REPRODUCIBLE_CHECK",
|
|
1169
|
+
"runtime",
|
|
1170
|
+
d > 1e4 ? "fail" : "pass",
|
|
1171
|
+
d > 1e4 ? "error" : "info",
|
|
1172
|
+
"runtime",
|
|
1173
|
+
`固定 timestep=${i.timestep ?? "unknown"},${i.steps} 步;最终最大 |qvel|=${d.toFixed(6)}。该结果只代表 MuJoCo 子集。`,
|
|
1174
|
+
d > 1e4 ? "降低速度、修复约束或排除不稳定的碰撞映射。" : "无需处理。",
|
|
1175
|
+
{
|
|
1176
|
+
timestep: i.timestep,
|
|
1177
|
+
steps: i.steps,
|
|
1178
|
+
maxVelocity: d,
|
|
1179
|
+
engine: "MuJoCo WASM subset"
|
|
1180
|
+
},
|
|
1181
|
+
s
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
async function En(e) {
|
|
1185
|
+
const t = ve(e.bundle), n = w(e.bundle.entryLocator), o = e.bundle.files.find((i) => w(i.locator) === n), s = /\.usdz$/i.test(t);
|
|
1186
|
+
if (!o)
|
|
1187
|
+
return {
|
|
1188
|
+
entryFound: !1,
|
|
1189
|
+
facts: he(),
|
|
1190
|
+
isUsdz: s,
|
|
1191
|
+
zip: "unknown",
|
|
1192
|
+
zipFileCount: 0
|
|
1193
|
+
};
|
|
1194
|
+
const r = new Uint8Array(await o.blob.arrayBuffer());
|
|
1195
|
+
if (Ie(t, r)) {
|
|
1196
|
+
const i = new TextDecoder("utf-8").decode(r), a = await yn(e.bundle), l = kt(
|
|
1197
|
+
a,
|
|
1198
|
+
e.bundle.files.map((u) => u.locator)
|
|
1199
|
+
);
|
|
1200
|
+
return {
|
|
1201
|
+
entryFound: !0,
|
|
1202
|
+
facts: Qe(
|
|
1203
|
+
i,
|
|
1204
|
+
a.map((u) => ({ path: u.path, text: u.text })),
|
|
1205
|
+
l
|
|
1206
|
+
),
|
|
1207
|
+
isUsdz: !1,
|
|
1208
|
+
zip: "not-zip",
|
|
1209
|
+
zipFileCount: 0
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
if (s || Gn(r))
|
|
1213
|
+
try {
|
|
1214
|
+
const i = await re.loadAsync(r), a = Object.values(i.files).filter((d) => !d.dir), l = [], u = new Set(a.map((d) => Ce(d.name)));
|
|
1215
|
+
for (const d of a) {
|
|
1216
|
+
if (!/\.(?:usda|usd)$/i.test(d.name)) continue;
|
|
1217
|
+
const g = await d.async("uint8array");
|
|
1218
|
+
Ie(d.name, g) && l.push({ path: Ce(d.name), text: new TextDecoder("utf-8").decode(g) });
|
|
1219
|
+
}
|
|
1220
|
+
const f = l.length ? $t(l, u) : null, m = l.find((d) => /(?:^|\/)(?:root|scene|main)\.usd(?:a)?$/i.test(d.path)) ?? l[0];
|
|
1221
|
+
return {
|
|
1222
|
+
entryFound: !0,
|
|
1223
|
+
facts: Qe((m == null ? void 0 : m.text) ?? "", l, f ?? Ln()),
|
|
1224
|
+
isUsdz: s,
|
|
1225
|
+
zip: "readable",
|
|
1226
|
+
zipFileCount: a.length
|
|
1227
|
+
};
|
|
1228
|
+
} catch {
|
|
1229
|
+
return {
|
|
1230
|
+
entryFound: !0,
|
|
1231
|
+
facts: he(),
|
|
1232
|
+
isUsdz: s,
|
|
1233
|
+
zip: "invalid",
|
|
1234
|
+
zipFileCount: 0
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
return {
|
|
1238
|
+
entryFound: !0,
|
|
1239
|
+
facts: he(),
|
|
1240
|
+
isUsdz: !1,
|
|
1241
|
+
zip: "not-zip",
|
|
1242
|
+
zipFileCount: 0
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
async function yn(e) {
|
|
1246
|
+
const t = [];
|
|
1247
|
+
for (const n of e.files) {
|
|
1248
|
+
const o = K(n.locator);
|
|
1249
|
+
if (!/\.(?:usda|usd)$/i.test(o)) continue;
|
|
1250
|
+
const s = new Uint8Array(await n.blob.arrayBuffer());
|
|
1251
|
+
Ie(o, s) && t.push({
|
|
1252
|
+
locator: n.locator,
|
|
1253
|
+
path: o,
|
|
1254
|
+
text: new TextDecoder("utf-8").decode(s)
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
return t;
|
|
1258
|
+
}
|
|
1259
|
+
function Qe(e, t, n) {
|
|
1260
|
+
const o = t.map((a) => a.text).join(`
|
|
1261
|
+
`), s = In(e || o), r = s.filter((a) => /Mesh$/i.test(a.typeName)).map(Cn), c = s.flatMap((a) => {
|
|
1262
|
+
var u;
|
|
1263
|
+
const l = (u = /\brel\s+material:binding(?:\s*=\s*<([^>]+)>)/.exec(a.body)) == null ? void 0 : u[1];
|
|
1264
|
+
return l ? [`${a.path} -> ${l.trim()}`] : [];
|
|
1265
|
+
}), i = {};
|
|
1266
|
+
for (const a of s)
|
|
1267
|
+
for (const l of a.body.matchAll(/\b(semantic:[A-Za-z0-9_:]+)\s*=\s*([^\n]+)/g)) {
|
|
1268
|
+
const u = i[l[1]] ?? [];
|
|
1269
|
+
u.push(`${a.path}: ${l[2].trim()}`), i[l[1]] = u;
|
|
1270
|
+
}
|
|
1271
|
+
return {
|
|
1272
|
+
textual: !0,
|
|
1273
|
+
text: o,
|
|
1274
|
+
prims: s,
|
|
1275
|
+
meshes: r,
|
|
1276
|
+
materialBindings: c,
|
|
1277
|
+
semanticFields: i,
|
|
1278
|
+
physics: An(s),
|
|
1279
|
+
dependencies: n,
|
|
1280
|
+
payloads: [...new Set([...o.matchAll(/\bpayload\s*=\s*@([^@]+)@/g)].map((a) => a[1].trim()))],
|
|
1281
|
+
sublayers: [...o.matchAll(/\bsubLayers\s*=\s*\[([\s\S]*?)\]/g)].flatMap((a) => [...a[1].matchAll(/@([^@]+)@/g)].map((l) => l[1].trim()))
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
function In(e) {
|
|
1285
|
+
const t = [], n = (o, s, r) => {
|
|
1286
|
+
const c = /\b(?:def|over|class)\s+([A-Za-z0-9_:]+)\s+"([^"]+)"/g;
|
|
1287
|
+
for (c.lastIndex = o; c.lastIndex < s; ) {
|
|
1288
|
+
const i = c.exec(e);
|
|
1289
|
+
if (!i || i.index >= s) break;
|
|
1290
|
+
const a = $n(e, c.lastIndex, s);
|
|
1291
|
+
if (a < 0) continue;
|
|
1292
|
+
const l = Fn(e, a, s);
|
|
1293
|
+
if (l < 0) break;
|
|
1294
|
+
const u = i[2], f = `${r}/${u}`.replace(/\/+/g, "/");
|
|
1295
|
+
t.push({
|
|
1296
|
+
path: f,
|
|
1297
|
+
name: u,
|
|
1298
|
+
typeName: i[1],
|
|
1299
|
+
body: e.slice(a + 1, l),
|
|
1300
|
+
source: e.slice(i.index, l + 1)
|
|
1301
|
+
}), n(a + 1, l, f), c.lastIndex = l + 1;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
return n(0, e.length, ""), t;
|
|
1305
|
+
}
|
|
1306
|
+
function Cn(e) {
|
|
1307
|
+
var i, a;
|
|
1308
|
+
const t = pe(e.body, /\bpoint3f\[\]\s+points\s*=\s*[\[(]/), n = pe(e.body, /\bint\[\]\s+faceVertexCounts\s*=\s*[\[(]/), o = pe(e.body, /\bint\[\]\s+faceVertexIndices\s*=\s*[\[(]/);
|
|
1309
|
+
let s = 0, r = 0, c = 0;
|
|
1310
|
+
for (const l of n.length ? n : Array.from({ length: Math.floor(o.length / 3) }, () => 3)) {
|
|
1311
|
+
if (l < 3) {
|
|
1312
|
+
r += Math.max(0, l);
|
|
1313
|
+
continue;
|
|
1314
|
+
}
|
|
1315
|
+
s += Math.floor(l - 2);
|
|
1316
|
+
for (let u = 1; u < l - 1; u += 1) {
|
|
1317
|
+
const f = o[r], m = o[r + u], d = o[r + u + 1];
|
|
1318
|
+
(f === void 0 || m === void 0 || d === void 0 || f === m || m === d || f === d) && (c += 1);
|
|
1319
|
+
}
|
|
1320
|
+
r += l;
|
|
1321
|
+
}
|
|
1322
|
+
return !n.length && o.length && (s = Math.floor(o.length / 3)), {
|
|
1323
|
+
path: e.path,
|
|
1324
|
+
vertexCount: Math.floor(t.length / 3),
|
|
1325
|
+
triangleCount: s,
|
|
1326
|
+
normals: /\b(?:normal3f\[\]|texCoord2f\[\]|primvars:normals)\b/.test(e.body),
|
|
1327
|
+
orientation: ((i = /\borientation\s*=\s*"([^"]+)"/.exec(e.body)) == null ? void 0 : i[1]) ?? null,
|
|
1328
|
+
degenerateTriangles: c,
|
|
1329
|
+
materialBinding: ((a = /\brel\s+material:binding(?:\s*=\s*<([^>]+)>)?/.exec(e.body)) == null ? void 0 : a[1]) ?? null
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
function An(e) {
|
|
1333
|
+
const t = e.filter((o) => /PhysicsRigidBodyAPI/.test(o.source)), n = e.filter((o) => /PhysicsCollisionAPI/.test(o.source));
|
|
1334
|
+
return {
|
|
1335
|
+
rigidBodyCount: t.length,
|
|
1336
|
+
colliderCount: n.length,
|
|
1337
|
+
staticColliderCount: n.filter((o) => !/PhysicsRigidBodyAPI/.test(o.source)).length,
|
|
1338
|
+
articulationRootCount: e.filter((o) => /PhysicsArticulationRootAPI/.test(o.source)).length,
|
|
1339
|
+
jointCount: e.filter((o) => /^Physics(?:Fixed|Revolute|Prismatic|Spherical)Joint$/.test(o.typeName)).length,
|
|
1340
|
+
driveCount: e.reduce((o, s) => o + (s.body.match(/\bdrive:/g) ?? []).length, 0),
|
|
1341
|
+
mimicCount: e.reduce((o, s) => o + (s.body.match(/mimic|(?:newton|mjc):mimic/gi) ?? []).length, 0),
|
|
1342
|
+
massCount: e.reduce((o, s) => o + (s.body.match(/\bphysics:mass\s*=/g) ?? []).length, 0),
|
|
1343
|
+
densityCount: e.reduce((o, s) => o + (s.body.match(/\bphysics:density\s*=/g) ?? []).length, 0),
|
|
1344
|
+
centerOfMassCount: e.reduce((o, s) => o + (s.body.match(/\bphysics:centerOfMass\s*=/g) ?? []).length, 0),
|
|
1345
|
+
inertiaCount: e.reduce((o, s) => o + (s.body.match(/\bphysics:diagonalInertia\s*=/g) ?? []).length, 0),
|
|
1346
|
+
materialCount: e.filter((o) => /PhysicsMaterialAPI/.test(o.source)).length
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
async function bn(e, t) {
|
|
1350
|
+
var a;
|
|
1351
|
+
const n = e.files.map((l) => ({
|
|
1352
|
+
locator: l.locator,
|
|
1353
|
+
path: K(l.locator),
|
|
1354
|
+
blob: l.blob
|
|
1355
|
+
})), o = t.resolvedPath ? ((a = n.find((l) => l.path === t.resolvedPath)) == null ? void 0 : a.locator) ?? null : rt(
|
|
1356
|
+
t.fromLocator,
|
|
1357
|
+
t.path,
|
|
1358
|
+
n.map((l) => l.locator)
|
|
1359
|
+
), s = o ? w(o) : null, r = t.fromLocator.kind === "package-path" ? Ce(t.path.replace(/^@|@$/g, "")) : null, c = (s ? n.find((l) => w(l.locator) === s) : void 0) ?? (t.fromLocator.kind === "package-path" ? n.find((l) => l.path.endsWith(`/${r}`)) ?? n.find((l) => l.path.split("/").pop() === (r == null ? void 0 : r.split("/").pop())) : void 0), i = (c == null ? void 0 : c.path) ?? null;
|
|
1360
|
+
if (!c)
|
|
1361
|
+
return {
|
|
1362
|
+
path: t.path,
|
|
1363
|
+
from: K(t.fromLocator),
|
|
1364
|
+
resolved: i,
|
|
1365
|
+
found: !1,
|
|
1366
|
+
width: null,
|
|
1367
|
+
height: null,
|
|
1368
|
+
error: "资产包中未找到纹理文件。"
|
|
1369
|
+
};
|
|
1370
|
+
if (typeof createImageBitmap != "function")
|
|
1371
|
+
return {
|
|
1372
|
+
path: t.path,
|
|
1373
|
+
from: K(t.fromLocator),
|
|
1374
|
+
resolved: i,
|
|
1375
|
+
found: !0,
|
|
1376
|
+
width: null,
|
|
1377
|
+
height: null,
|
|
1378
|
+
error: "当前宿主不支持 createImageBitmap。"
|
|
1379
|
+
};
|
|
1380
|
+
try {
|
|
1381
|
+
const l = await createImageBitmap(c.blob);
|
|
1382
|
+
try {
|
|
1383
|
+
return {
|
|
1384
|
+
path: t.path,
|
|
1385
|
+
from: K(t.fromLocator),
|
|
1386
|
+
resolved: i,
|
|
1387
|
+
found: !0,
|
|
1388
|
+
width: l.width,
|
|
1389
|
+
height: l.height,
|
|
1390
|
+
error: null
|
|
1391
|
+
};
|
|
1392
|
+
} finally {
|
|
1393
|
+
l.close();
|
|
1394
|
+
}
|
|
1395
|
+
} catch (l) {
|
|
1396
|
+
return {
|
|
1397
|
+
path: t.path,
|
|
1398
|
+
from: K(t.fromLocator),
|
|
1399
|
+
resolved: i,
|
|
1400
|
+
found: !0,
|
|
1401
|
+
width: null,
|
|
1402
|
+
height: null,
|
|
1403
|
+
error: l instanceof Error ? l.message : String(l)
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
function _n(e, t) {
|
|
1408
|
+
const n = L(t == null ? void 0 : t.stage), o = N(n == null ? void 0 : n.defaultPrim) ?? (e == null ? void 0 : e.defaultPrim) ?? null;
|
|
1409
|
+
return {
|
|
1410
|
+
defaultPrim: dt(o),
|
|
1411
|
+
upAxis: N(n == null ? void 0 : n.upAxis) ?? (e == null ? void 0 : e.upAxis) ?? null,
|
|
1412
|
+
metersPerUnit: G(n == null ? void 0 : n.metersPerUnit) ?? (e == null ? void 0 : e.metersPerUnit) ?? null,
|
|
1413
|
+
kilogramsPerUnit: G(n == null ? void 0 : n.kilogramsPerUnit) ?? (e == null ? void 0 : e.kilogramsPerUnit) ?? null,
|
|
1414
|
+
extent: (e == null ? void 0 : e.extent) ?? null
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
function vn(e, t, n) {
|
|
1418
|
+
const o = $(t == null ? void 0 : t.prims);
|
|
1419
|
+
return o.length ? o.flatMap((s) => {
|
|
1420
|
+
const r = N(s.path);
|
|
1421
|
+
return r ? [{
|
|
1422
|
+
path: r,
|
|
1423
|
+
name: N(s.name) ?? r.split("/").pop() ?? r,
|
|
1424
|
+
typeName: N(s.typeName) || "unknown",
|
|
1425
|
+
variant: null,
|
|
1426
|
+
source: "runtime"
|
|
1427
|
+
}] : [];
|
|
1428
|
+
}) : e.prims.map((s) => ({
|
|
1429
|
+
path: s.path,
|
|
1430
|
+
name: s.name,
|
|
1431
|
+
typeName: s.typeName,
|
|
1432
|
+
variant: null,
|
|
1433
|
+
source: "authored"
|
|
1434
|
+
}));
|
|
1435
|
+
}
|
|
1436
|
+
function Rn(e, t) {
|
|
1437
|
+
var o;
|
|
1438
|
+
const n = $(t == null ? void 0 : t.meshes);
|
|
1439
|
+
if (n.length) {
|
|
1440
|
+
const s = n.flatMap((r) => {
|
|
1441
|
+
const c = G(r.degenerateTriangles) ?? 0, i = N(r.path) ?? "unknown";
|
|
1442
|
+
return c > 0 ? [{
|
|
1443
|
+
path: i,
|
|
1444
|
+
triangles: c,
|
|
1445
|
+
role: Nn(i, t) ? "collision" : "visual"
|
|
1446
|
+
}] : [];
|
|
1447
|
+
});
|
|
1448
|
+
return {
|
|
1449
|
+
meshCount: n.length,
|
|
1450
|
+
vertexCount: J(n.map((r) => G(r.vertexCount) ?? 0)),
|
|
1451
|
+
triangleCount: J(n.map((r) => G(r.triangleCount) ?? 0)),
|
|
1452
|
+
degenerateTriangles: J(n.map((r) => G(r.degenerateTriangles) ?? 0)),
|
|
1453
|
+
collisionDegenerateTriangles: J(
|
|
1454
|
+
s.filter((r) => r.role === "collision").map((r) => r.triangles)
|
|
1455
|
+
),
|
|
1456
|
+
degenerateMeshes: s,
|
|
1457
|
+
normals: n.every((r) => (G(r.normalCount) ?? 0) > 0),
|
|
1458
|
+
orientation: null,
|
|
1459
|
+
meshSource: "runtime"
|
|
1460
|
+
};
|
|
1461
|
+
}
|
|
1462
|
+
if (e.meshes.length) {
|
|
1463
|
+
const s = e.meshes.filter((r) => r.degenerateTriangles > 0).map((r) => ({
|
|
1464
|
+
path: r.path,
|
|
1465
|
+
triangles: r.degenerateTriangles,
|
|
1466
|
+
role: "unknown"
|
|
1467
|
+
}));
|
|
1468
|
+
return {
|
|
1469
|
+
meshCount: e.meshes.length,
|
|
1470
|
+
vertexCount: J(e.meshes.map((r) => r.vertexCount)),
|
|
1471
|
+
triangleCount: J(e.meshes.map((r) => r.triangleCount)),
|
|
1472
|
+
degenerateTriangles: J(e.meshes.map((r) => r.degenerateTriangles)),
|
|
1473
|
+
collisionDegenerateTriangles: 0,
|
|
1474
|
+
degenerateMeshes: s,
|
|
1475
|
+
normals: e.meshes.every((r) => r.normals),
|
|
1476
|
+
orientation: ((o = e.meshes.find((r) => r.orientation)) == null ? void 0 : o.orientation) ?? null,
|
|
1477
|
+
meshSource: "probed"
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
return {
|
|
1481
|
+
meshCount: null,
|
|
1482
|
+
vertexCount: null,
|
|
1483
|
+
triangleCount: null,
|
|
1484
|
+
degenerateTriangles: null,
|
|
1485
|
+
collisionDegenerateTriangles: 0,
|
|
1486
|
+
degenerateMeshes: [],
|
|
1487
|
+
normals: null,
|
|
1488
|
+
orientation: null,
|
|
1489
|
+
meshSource: "probed"
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
function Nn(e, t) {
|
|
1493
|
+
var o;
|
|
1494
|
+
return $((o = L(t == null ? void 0 : t.physics)) == null ? void 0 : o.colliders).some((s) => {
|
|
1495
|
+
const r = N(s.path);
|
|
1496
|
+
return s.enabled !== !1 && !!r && (e === r || e.startsWith(`${r}/`));
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
function Pn(e) {
|
|
1500
|
+
const t = Object.fromEntries([
|
|
1501
|
+
"not-run",
|
|
1502
|
+
"running",
|
|
1503
|
+
"pass",
|
|
1504
|
+
"conditional",
|
|
1505
|
+
"fail",
|
|
1506
|
+
"unsupported",
|
|
1507
|
+
"unknown",
|
|
1508
|
+
"stale"
|
|
1509
|
+
].map((i) => [i, 0]));
|
|
1510
|
+
for (const i of e) t[i.status] += 1;
|
|
1511
|
+
const n = e.filter((i) => i.status === "fail" && et(i, me)).map((i) => i.code), o = e.filter((i) => i.status === "fail" && !et(i, me)).map((i) => i.code), s = e.filter((i) => ["conditional", "unknown", "unsupported", "stale"].includes(i.status) || i.status === "not-run" && i.severity === "warning").map((i) => i.code), r = e.find((i) => i.code === "SCENE_PHYSICS_COMPILE"), c = n.length ? "blocked" : (r == null ? void 0 : r.status) === "pass" ? "ready" : (r == null ? void 0 : r.status) === "not-run" ? "not-applicable" : "unknown";
|
|
1512
|
+
return {
|
|
1513
|
+
counts: t,
|
|
1514
|
+
simulation: {
|
|
1515
|
+
target: me,
|
|
1516
|
+
status: c,
|
|
1517
|
+
blockingCodes: [...new Set(n)]
|
|
1518
|
+
},
|
|
1519
|
+
diagnostics: {
|
|
1520
|
+
status: o.length ? "fail" : s.length ? "conditional" : "pass",
|
|
1521
|
+
failingCodes: [...new Set(o)],
|
|
1522
|
+
conditionalCodes: [...new Set(s)]
|
|
1523
|
+
},
|
|
1524
|
+
profile: {
|
|
1525
|
+
id: "simready",
|
|
1526
|
+
status: "not-run",
|
|
1527
|
+
reason: "Studio 执行本地运行时可行性预检;完整 SimReady / Isaac Asset Validator 未运行。"
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
}
|
|
1531
|
+
function et(e, t) {
|
|
1532
|
+
return e.blocking === "always" ? !0 : e.blocking === "target" && e.targets.includes(t);
|
|
1533
|
+
}
|
|
1534
|
+
function Tn(e) {
|
|
1535
|
+
var t;
|
|
1536
|
+
return L((t = L(e == null ? void 0 : e.visualDiagnostics)) == null ? void 0 : t.usd);
|
|
1537
|
+
}
|
|
1538
|
+
function wn(e, t, n) {
|
|
1539
|
+
const o = t == null ? void 0 : t.deterministic;
|
|
1540
|
+
if (o && n) return o.bounds[n] ?? null;
|
|
1541
|
+
const r = $(e == null ? void 0 : e.meshes).map((u) => L(u.bounds)).filter(Boolean);
|
|
1542
|
+
if (!r.length) return null;
|
|
1543
|
+
const c = r.map((u) => se(u.min)).filter((u) => u.length === 3), i = r.map((u) => se(u.max)).filter((u) => u.length === 3);
|
|
1544
|
+
if (!c.length || !i.length) return null;
|
|
1545
|
+
const a = [0, 1, 2].map((u) => Math.min(...c.map((f) => f[u]))), l = [0, 1, 2].map((u) => Math.max(...i.map((f) => f[u])));
|
|
1546
|
+
return { min: a, max: l, size: l.map((u, f) => u - a[f]) };
|
|
1547
|
+
}
|
|
1548
|
+
function tt(e) {
|
|
1549
|
+
var t;
|
|
1550
|
+
return $((t = L(e == null ? void 0 : e.physics)) == null ? void 0 : t.colliders).length > 0;
|
|
1551
|
+
}
|
|
1552
|
+
function Mn(e) {
|
|
1553
|
+
const t = /* @__PURE__ */ new Map();
|
|
1554
|
+
for (const n of e) {
|
|
1555
|
+
if (n.excludeFromArticulation === !0) continue;
|
|
1556
|
+
const o = N(n.body0), s = N(n.body1);
|
|
1557
|
+
if (!o || !s) continue;
|
|
1558
|
+
const r = [o, s].sort().join(" <-> ");
|
|
1559
|
+
t.set(r, (t.get(r) ?? 0) + 1);
|
|
1560
|
+
}
|
|
1561
|
+
return [...t.entries()].filter(([, n]) => n > 1).map(([n]) => n);
|
|
1562
|
+
}
|
|
1563
|
+
function xn(e) {
|
|
1564
|
+
return e.filter((t) => e.some((n) => n !== t && n.startsWith(`${t}/`)));
|
|
1565
|
+
}
|
|
1566
|
+
function On(e, t) {
|
|
1567
|
+
const n = $(e == null ? void 0 : e.bodies);
|
|
1568
|
+
return n.length ? t === "PHYSICS_DENSITY" ? n.some((o) => {
|
|
1569
|
+
var s;
|
|
1570
|
+
return (G((s = L(o.mass)) == null ? void 0 : s.density) ?? G(o.density) ?? 0) > 0;
|
|
1571
|
+
}) : t === "PHYSICS_COM" ? n.some((o) => se(o.centerOfMass ?? o.position).length === 3) : t === "PHYSICS_INERTIA" ? n.some((o) => se(o.inertia).some((s) => s > 0)) : !1 : !1;
|
|
1572
|
+
}
|
|
1573
|
+
function Dn(e, t) {
|
|
1574
|
+
const n = /* @__PURE__ */ new Set([...Object.keys(e), ...t]), o = Object.values(e).flat(), s = new Set(o.map((r) => r.split(":", 1)[0]));
|
|
1575
|
+
return {
|
|
1576
|
+
attributeCount: n.size,
|
|
1577
|
+
primCount: s.size,
|
|
1578
|
+
valueCount: o.length + t.length,
|
|
1579
|
+
evidence: { fields: [...n], authored: e }
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
function Un(e, t) {
|
|
1583
|
+
var o, s;
|
|
1584
|
+
if (!t) return ((o = e[0]) == null ? void 0 : o.path) ?? null;
|
|
1585
|
+
const n = dt(t);
|
|
1586
|
+
return ((s = e.find((r) => r.path === n)) == null ? void 0 : s.path) ?? null;
|
|
1587
|
+
}
|
|
1588
|
+
function dt(e) {
|
|
1589
|
+
return e ? `/${e.replace(/^\/+/, "")}`.replace(/\/+/g, "/") : null;
|
|
1590
|
+
}
|
|
1591
|
+
function he() {
|
|
1592
|
+
return {
|
|
1593
|
+
textual: !1,
|
|
1594
|
+
text: "",
|
|
1595
|
+
prims: [],
|
|
1596
|
+
meshes: [],
|
|
1597
|
+
materialBindings: [],
|
|
1598
|
+
semanticFields: {},
|
|
1599
|
+
physics: fn,
|
|
1600
|
+
dependencies: null,
|
|
1601
|
+
payloads: [],
|
|
1602
|
+
sublayers: []
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
function Ln() {
|
|
1606
|
+
return {
|
|
1607
|
+
references: [],
|
|
1608
|
+
missing: [],
|
|
1609
|
+
external: [],
|
|
1610
|
+
unanchored: [],
|
|
1611
|
+
materialModules: [],
|
|
1612
|
+
layers: []
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
function pe(e, t) {
|
|
1616
|
+
var s;
|
|
1617
|
+
const n = t.exec(e);
|
|
1618
|
+
return n ? ((s = kn(e, n.index + n[0].length - 1).match(/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g)) == null ? void 0 : s.map(Number).filter(Number.isFinite)) ?? [] : [];
|
|
1619
|
+
}
|
|
1620
|
+
function kn(e, t) {
|
|
1621
|
+
const n = e[t], o = n === "(" ? ")" : n === "[" ? "]" : n === "{" ? "}" : "";
|
|
1622
|
+
if (!o) return "";
|
|
1623
|
+
let s = 0, r = !1;
|
|
1624
|
+
for (let c = t; c < e.length; c += 1) {
|
|
1625
|
+
const i = e[c];
|
|
1626
|
+
if (i === '"' && e[c - 1] !== "\\" && (r = !r), !r) {
|
|
1627
|
+
if (i === n) s += 1;
|
|
1628
|
+
else if (i === o && (s -= 1, s === 0))
|
|
1629
|
+
return e.slice(t + 1, c);
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
return "";
|
|
1633
|
+
}
|
|
1634
|
+
function $n(e, t, n) {
|
|
1635
|
+
let o = !1;
|
|
1636
|
+
for (let s = t; s < n; s += 1) {
|
|
1637
|
+
const r = e[s];
|
|
1638
|
+
if (r === '"' && e[s - 1] !== "\\" && (o = !o), !o && r === "{") return s;
|
|
1639
|
+
}
|
|
1640
|
+
return -1;
|
|
1641
|
+
}
|
|
1642
|
+
function Fn(e, t, n) {
|
|
1643
|
+
let o = 0, s = !1, r = !1;
|
|
1644
|
+
for (let c = t; c < n; c += 1) {
|
|
1645
|
+
if (!s && e.slice(c, c + 3) === "'''") {
|
|
1646
|
+
r = !r, c += 2;
|
|
1647
|
+
continue;
|
|
1648
|
+
}
|
|
1649
|
+
if (r) continue;
|
|
1650
|
+
const i = e[c];
|
|
1651
|
+
if (i === '"' && e[c - 1] !== "\\" && (s = !s), !s) {
|
|
1652
|
+
if (i === "{") o += 1;
|
|
1653
|
+
else if (i === "}" && (o -= 1, o === 0))
|
|
1654
|
+
return c;
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
return -1;
|
|
1658
|
+
}
|
|
1659
|
+
function Gn(e) {
|
|
1660
|
+
return e.length >= 4 && e[0] === 80 && e[1] === 75;
|
|
1661
|
+
}
|
|
1662
|
+
function Vn(e) {
|
|
1663
|
+
return /\.(?:png|jpe?g|exr|hdr|ktx2|webp|tga|dds)(?:[?#].*)?$/i.test(e);
|
|
1664
|
+
}
|
|
1665
|
+
function L(e) {
|
|
1666
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : null;
|
|
1667
|
+
}
|
|
1668
|
+
function $(e) {
|
|
1669
|
+
return Array.isArray(e) ? e.map(L).filter((t) => !!t) : [];
|
|
1670
|
+
}
|
|
1671
|
+
function se(e) {
|
|
1672
|
+
return Array.isArray(e) && e.every((t) => typeof t == "number" && Number.isFinite(t)) ? e : [];
|
|
1673
|
+
}
|
|
1674
|
+
function G(e) {
|
|
1675
|
+
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
1676
|
+
}
|
|
1677
|
+
function N(e) {
|
|
1678
|
+
return typeof e == "string" && e ? e : null;
|
|
1679
|
+
}
|
|
1680
|
+
function J(e) {
|
|
1681
|
+
return e.reduce((t, n) => t + n, 0);
|
|
1682
|
+
}
|
|
1683
|
+
function ge(e) {
|
|
1684
|
+
return e.map((t) => Number(t.toFixed(4))).join(" × ");
|
|
1685
|
+
}
|
|
1686
|
+
function T(e, t, n, o, s, r, c, i, a, l, u) {
|
|
1687
|
+
const f = u ?? dn[t];
|
|
1688
|
+
if (!f) throw new Error(`Missing inspection finding contract: ${t}`);
|
|
1689
|
+
e({
|
|
1690
|
+
code: t,
|
|
1691
|
+
scope: n,
|
|
1692
|
+
status: o,
|
|
1693
|
+
severity: s,
|
|
1694
|
+
source: r,
|
|
1695
|
+
message: c,
|
|
1696
|
+
remediation: i,
|
|
1697
|
+
impact: f.impact,
|
|
1698
|
+
blocking: f.blocking,
|
|
1699
|
+
targets: f.targets,
|
|
1700
|
+
primPath: l,
|
|
1701
|
+
evidence: a
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
const Se = Object.freeze({
|
|
1705
|
+
textual: !1,
|
|
1706
|
+
defaultPrim: null,
|
|
1707
|
+
upAxis: null,
|
|
1708
|
+
metersPerUnit: null,
|
|
1709
|
+
kilogramsPerUnit: null,
|
|
1710
|
+
creator: null,
|
|
1711
|
+
startTimeCode: null,
|
|
1712
|
+
endTimeCode: null,
|
|
1713
|
+
timeCodesPerSecond: null,
|
|
1714
|
+
rootPrim: null,
|
|
1715
|
+
simReady: null,
|
|
1716
|
+
packageEvidence: null,
|
|
1717
|
+
sourcePhysics: null,
|
|
1718
|
+
extent: null,
|
|
1719
|
+
references: [],
|
|
1720
|
+
payloads: [],
|
|
1721
|
+
sublayers: [],
|
|
1722
|
+
materials: [],
|
|
1723
|
+
materialBindings: [],
|
|
1724
|
+
textures: [],
|
|
1725
|
+
semanticFields: [],
|
|
1726
|
+
variantSets: [],
|
|
1727
|
+
meshCount: 0,
|
|
1728
|
+
hasRigidBodyApi: !1,
|
|
1729
|
+
hasCollisionApi: !1,
|
|
1730
|
+
jointCount: 0
|
|
1731
|
+
});
|
|
1732
|
+
async function Ps(e) {
|
|
1733
|
+
var O, F, D, h;
|
|
1734
|
+
const t = ve(e), n = w(e.entryLocator), o = e.files.find((A) => w(A.locator) === n);
|
|
1735
|
+
if (!o || !/\.(usda|usd)$/i.test(t)) return Se;
|
|
1736
|
+
const s = new Uint8Array(await o.blob.arrayBuffer());
|
|
1737
|
+
if (s.length >= 8 && new TextDecoder("ascii").decode(s.subarray(0, 8)) === "PXR-USDC") return Se;
|
|
1738
|
+
const r = new TextDecoder("utf-8").decode(s);
|
|
1739
|
+
if (!r.includes("#usda")) return Se;
|
|
1740
|
+
const c = ((O = /\bdefaultPrim\s*=\s*"([^"]+)"/.exec(r)) == null ? void 0 : O[1]) ?? null, i = ((F = /\bupAxis\s*=\s*"([^"]+)"/.exec(r)) == null ? void 0 : F[1]) ?? null, a = (D = /\bmetersPerUnit\s*=\s*([0-9.eE+-]+)/.exec(r)) == null ? void 0 : D[1], l = (h = /\bkilogramsPerUnit\s*=\s*([0-9.eE+-]+)/.exec(r)) == null ? void 0 : h[1], u = Z(Q(r, /\breferences?\s*=\s*@([^@]+)@/g)), f = Z(Q(r, /\bpayload\s*=\s*@([^@]+)@/g)), m = Z([...r.matchAll(/\bsubLayers\s*=\s*\[([\s\S]*?)\]/g)].flatMap((A) => [...A[1].matchAll(/@([^@]+)@/g)].map((P) => P[1].trim()))), d = Z(Q(r, /\bmaterial:binding\s*=\s*<([^>]+)>/g)), g = Z(Q(r, /\bdef\s+Material\s+"([^"]+)"/g)), p = Z(Q(r, /@([^@]+\.(?:png|jpe?g|exr|ktx2))@/gi)), S = Z([...r.matchAll(/\b(semantic:[A-Za-z0-9_:]+)\s*=/g)].map((A) => A[1])), I = /\bfloat3\[\]\s+extent\s*=\s*\[\s*\(([^)]+)\)\s*,\s*\(([^)]+)\)\s*\]/.exec(r), C = I ? nt(I[1]) : null, v = I ? nt(I[2]) : null, _ = Ft(r), R = e.files.map((A) => ({
|
|
1741
|
+
path: K(A.locator),
|
|
1742
|
+
blob: A.blob
|
|
1743
|
+
})), [M, k] = await Promise.all([
|
|
1744
|
+
Gt(R),
|
|
1745
|
+
Vt(R)
|
|
1746
|
+
]);
|
|
1747
|
+
return Object.freeze({
|
|
1748
|
+
textual: !0,
|
|
1749
|
+
defaultPrim: c,
|
|
1750
|
+
upAxis: i,
|
|
1751
|
+
metersPerUnit: a && Number.isFinite(Number(a)) ? Number(a) : null,
|
|
1752
|
+
kilogramsPerUnit: l && Number.isFinite(Number(l)) ? Number(l) : null,
|
|
1753
|
+
creator: _.creator,
|
|
1754
|
+
startTimeCode: _.startTimeCode,
|
|
1755
|
+
endTimeCode: _.endTimeCode,
|
|
1756
|
+
timeCodesPerSecond: _.timeCodesPerSecond,
|
|
1757
|
+
rootPrim: _.rootPrim,
|
|
1758
|
+
simReady: _.simReady,
|
|
1759
|
+
packageEvidence: M,
|
|
1760
|
+
sourcePhysics: k,
|
|
1761
|
+
extent: C && v ? { min: C, max: v } : null,
|
|
1762
|
+
references: u,
|
|
1763
|
+
payloads: f,
|
|
1764
|
+
sublayers: m,
|
|
1765
|
+
materials: g,
|
|
1766
|
+
materialBindings: d,
|
|
1767
|
+
textures: p,
|
|
1768
|
+
semanticFields: S,
|
|
1769
|
+
variantSets: _.variantSets,
|
|
1770
|
+
meshCount: (r.match(/\bdef\s+Mesh\b/g) ?? []).length,
|
|
1771
|
+
hasRigidBodyApi: r.includes("PhysicsRigidBodyAPI"),
|
|
1772
|
+
hasCollisionApi: r.includes("PhysicsCollisionAPI"),
|
|
1773
|
+
jointCount: (r.match(/\bdef\s+Physics(?:Revolute|Prismatic|Fixed|Spherical)Joint\b/g) ?? []).length
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
function Q(e, t) {
|
|
1777
|
+
return [...e.matchAll(t)].map((n) => {
|
|
1778
|
+
var o;
|
|
1779
|
+
return ((o = n[1]) == null ? void 0 : o.trim()) ?? "";
|
|
1780
|
+
}).filter(Boolean);
|
|
1781
|
+
}
|
|
1782
|
+
function nt(e) {
|
|
1783
|
+
const t = e.trim().split(/\s*,\s*|\s+/).map(Number);
|
|
1784
|
+
return t.length === 3 && t.every(Number.isFinite) ? [t[0], t[1], t[2]] : null;
|
|
1785
|
+
}
|
|
1786
|
+
function Z(e) {
|
|
1787
|
+
return [...new Set(e)].sort((t, n) => t.localeCompare(n));
|
|
1788
|
+
}
|
|
1789
|
+
const Bn = { instanceIds: [], primaryId: null }, st = "scene-instance:";
|
|
1790
|
+
function ot(e) {
|
|
1791
|
+
if (!e.startsWith(st)) return null;
|
|
1792
|
+
const t = e.slice(st.length);
|
|
1793
|
+
return t.length > 0 ? t : null;
|
|
1794
|
+
}
|
|
1795
|
+
function Ts(e) {
|
|
1796
|
+
let t = null;
|
|
1797
|
+
for (const n of e)
|
|
1798
|
+
ot(n.objectName) !== null && Number.isFinite(n.distance) && (t === null || n.distance < t.distance) && (t = n);
|
|
1799
|
+
return t === null ? null : ot(t.objectName);
|
|
1800
|
+
}
|
|
1801
|
+
function ws(e, t, n = "replace", o = [], s = {}) {
|
|
1802
|
+
const r = (c) => {
|
|
1803
|
+
const i = o.find((l) => l.nodeId === c);
|
|
1804
|
+
if (!i) return !0;
|
|
1805
|
+
const a = s[i.nodeId];
|
|
1806
|
+
return i.visible && !(a != null && a.hidden);
|
|
1807
|
+
};
|
|
1808
|
+
if (t === null)
|
|
1809
|
+
return n === "replace" ? Bn : e;
|
|
1810
|
+
if (!r(t)) return e;
|
|
1811
|
+
switch (n) {
|
|
1812
|
+
case "replace":
|
|
1813
|
+
return { instanceIds: [t], primaryId: t };
|
|
1814
|
+
case "add":
|
|
1815
|
+
return e.instanceIds.includes(t) ? e : { instanceIds: [...e.instanceIds, t], primaryId: t };
|
|
1816
|
+
case "toggle": {
|
|
1817
|
+
if (!e.instanceIds.includes(t))
|
|
1818
|
+
return { instanceIds: [...e.instanceIds, t], primaryId: t };
|
|
1819
|
+
const c = e.instanceIds.filter((i) => i !== t);
|
|
1820
|
+
return {
|
|
1821
|
+
instanceIds: c,
|
|
1822
|
+
// Fall back to the last remaining item so the inspector is never empty.
|
|
1823
|
+
primaryId: c.length > 0 ? c[c.length - 1] : null
|
|
1824
|
+
};
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
function Ms(e, t) {
|
|
1829
|
+
const n = new Set(t), o = e.instanceIds.filter((r) => n.has(r));
|
|
1830
|
+
if (o.length === e.instanceIds.length && o.every((r, c) => r === e.instanceIds[c]))
|
|
1831
|
+
return e;
|
|
1832
|
+
const s = e.primaryId !== null && n.has(e.primaryId) ? e.primaryId : o[o.length - 1] ?? null;
|
|
1833
|
+
return { instanceIds: o, primaryId: s };
|
|
1834
|
+
}
|
|
1835
|
+
function xs(e, t = e.assets) {
|
|
1836
|
+
const n = Object.isFrozen(e) ? e : je(Ke(e));
|
|
1837
|
+
return {
|
|
1838
|
+
doc: n,
|
|
1839
|
+
library: t === e.assets ? n.assets : je(Ke(t))
|
|
1840
|
+
};
|
|
1841
|
+
}
|
|
1842
|
+
function ft(e, t, n) {
|
|
1843
|
+
const o = [], s = [];
|
|
1844
|
+
let r = e;
|
|
1845
|
+
for (const c of t) {
|
|
1846
|
+
const i = zn(c, r);
|
|
1847
|
+
if (i !== null)
|
|
1848
|
+
return s.push({
|
|
1849
|
+
code: "AI_UNKNOWN_ASSET",
|
|
1850
|
+
level: "error",
|
|
1851
|
+
message: `AI referenced asset ${i}, which is not in the scene library.`,
|
|
1852
|
+
assetId: i
|
|
1853
|
+
}), { records: o, diagnostics: s };
|
|
1854
|
+
const a = jn(c, r);
|
|
1855
|
+
if (a !== null)
|
|
1856
|
+
return s.push({
|
|
1857
|
+
code: "AI_UNKNOWN_INSTANCE",
|
|
1858
|
+
level: "error",
|
|
1859
|
+
message: `AI referenced instance ${a}, which does not exist in the scene.`,
|
|
1860
|
+
instanceId: a
|
|
1861
|
+
}), { records: o, diagnostics: s };
|
|
1862
|
+
const l = Pt(r, c);
|
|
1863
|
+
if (l.diagnostics.length > 0)
|
|
1864
|
+
return s.push(...l.diagnostics), { records: o, diagnostics: s };
|
|
1865
|
+
o.push(Tt(c, {
|
|
1866
|
+
batchId: n.batchId,
|
|
1867
|
+
label: n.label,
|
|
1868
|
+
// Provenance matters: the undo stack and audit log distinguish AI edits
|
|
1869
|
+
// even though the command shape is identical to a human edit.
|
|
1870
|
+
source: "ai",
|
|
1871
|
+
now: (/* @__PURE__ */ new Date()).toISOString()
|
|
1872
|
+
})), r = l.doc;
|
|
1873
|
+
}
|
|
1874
|
+
return { records: o, diagnostics: s };
|
|
1875
|
+
}
|
|
1876
|
+
function Os(e, t, n) {
|
|
1877
|
+
const o = ft(e, t, n);
|
|
1878
|
+
if (o.diagnostics.length > 0)
|
|
1879
|
+
return { doc: e, result: { applied: [], diagnostics: o.diagnostics, rejected: !0 } };
|
|
1880
|
+
const s = Ae(e);
|
|
1881
|
+
if (!s.ok) return { doc: e, result: { applied: [], diagnostics: s.diagnostics, rejected: !0 } };
|
|
1882
|
+
const r = Nt(e, o.records);
|
|
1883
|
+
return r.diagnostics.length > 0 ? { doc: e, result: { applied: [], diagnostics: r.diagnostics, rejected: !0 } } : {
|
|
1884
|
+
doc: r.doc,
|
|
1885
|
+
result: { applied: r.applied.length > 0 ? o.records : [], diagnostics: [], rejected: !1 }
|
|
1886
|
+
};
|
|
1887
|
+
}
|
|
1888
|
+
function zn(e, t) {
|
|
1889
|
+
switch (e.type) {
|
|
1890
|
+
case "node.add": {
|
|
1891
|
+
const n = e.node;
|
|
1892
|
+
return n.nodeType === "asset" ? t.assets.some((o) => o.revisionId === n.assetRevisionId) ? null : n.assetRevisionId : n.nodeType === "visual" ? t.visualAssets.some((o) => o.visualRevisionId === n.visualRevisionId) ? null : n.visualRevisionId : null;
|
|
1893
|
+
}
|
|
1894
|
+
case "asset.remove":
|
|
1895
|
+
return t.assets.some((n) => n.revisionId === e.revisionId) ? null : e.revisionId;
|
|
1896
|
+
case "visualAsset.remove":
|
|
1897
|
+
return t.visualAssets.some((n) => n.visualRevisionId === e.visualRevisionId) ? null : e.visualRevisionId;
|
|
1898
|
+
case "placeholder.bind":
|
|
1899
|
+
return e.after !== null && !t.assets.some((n) => n.revisionId === e.after) ? e.after : null;
|
|
1900
|
+
case "node.replaceModel":
|
|
1901
|
+
return e.after.nodeType === "asset" && !t.assets.some((n) => n.revisionId === e.after.assetRevisionId) ? e.after.assetRevisionId : null;
|
|
1902
|
+
default:
|
|
1903
|
+
return null;
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
function jn(e, t) {
|
|
1907
|
+
const n = new Set(Ot(t.root).map((o) => o.nodeId));
|
|
1908
|
+
return "nodeId" in e && !n.has(e.nodeId) ? e.nodeId : e.type === "node.add" && e.parentNodeId !== t.root.nodeId && !n.has(e.parentNodeId) ? e.parentNodeId : null;
|
|
1909
|
+
}
|
|
1910
|
+
function Ds(e, t, n, o = {}) {
|
|
1911
|
+
const s = ft(e.document, t, n);
|
|
1912
|
+
if (s.diagnostics.length > 0)
|
|
1913
|
+
return { applied: [], diagnostics: s.diagnostics, rejected: !0 };
|
|
1914
|
+
const r = e.commit({ ...o, commands: s.records });
|
|
1915
|
+
return {
|
|
1916
|
+
applied: r.changed ? s.records : [],
|
|
1917
|
+
diagnostics: r.diagnostics,
|
|
1918
|
+
rejected: !r.changed
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1921
|
+
const mt = "sim-studio.scene-package@5", Kn = "sim-studio.package-scene@5", Hn = "sim-studio.editorial-state@1", Yn = "sim-studio.asset-catalog@3", ht = "sim-studio.resource-manifest@2", Us = 5;
|
|
1922
|
+
function Jn(e, t) {
|
|
1923
|
+
const n = es(t);
|
|
1924
|
+
return {
|
|
1925
|
+
format: "sim-studio.package-scene@5",
|
|
1926
|
+
schemaVersion: 5,
|
|
1927
|
+
sceneId: e.sceneId,
|
|
1928
|
+
meta: { ...e.meta },
|
|
1929
|
+
coordinateSystem: e.coordinateSystem,
|
|
1930
|
+
environment: e.environment,
|
|
1931
|
+
root: gt(e.root, n),
|
|
1932
|
+
...e.semantic ? { semantic: e.semantic } : {},
|
|
1933
|
+
...e.domains ? { domains: e.domains } : {},
|
|
1934
|
+
...e.extensions ? { extensions: e.extensions } : {}
|
|
1935
|
+
};
|
|
1936
|
+
}
|
|
1937
|
+
function Zn(e, t) {
|
|
1938
|
+
const n = new Map(t.entries.map((i) => [i.source.sourceRevisionId, i])), o = t.entries.filter((i) => i.kind === "usd").map((i) => i.interpretation.runtimeRevision).map((i) => i), s = t.entries.filter((i) => i.kind === "visual").map((i) => i.interpretation.runtimeRevision).map((i) => i), r = {
|
|
1939
|
+
schemaVersion: Dt,
|
|
1940
|
+
sceneId: e.sceneId,
|
|
1941
|
+
meta: e.meta,
|
|
1942
|
+
coordinateSystem: e.coordinateSystem,
|
|
1943
|
+
environment: e.environment,
|
|
1944
|
+
assets: o,
|
|
1945
|
+
visualAssets: s,
|
|
1946
|
+
root: St(e.root, n),
|
|
1947
|
+
...e.semantic ? { semantic: e.semantic } : {},
|
|
1948
|
+
...e.domains ? { domains: e.domains } : {},
|
|
1949
|
+
...e.extensions ? { extensions: e.extensions } : {}
|
|
1950
|
+
}, c = Ae(r);
|
|
1951
|
+
if (!c.ok)
|
|
1952
|
+
throw new Error(c.diagnostics.map((i) => i.message).join(`
|
|
1953
|
+
`));
|
|
1954
|
+
return r;
|
|
1955
|
+
}
|
|
1956
|
+
function pt(e, t) {
|
|
1957
|
+
const n = new Map(t.entries.map((s) => [s.source.sourceRevisionId, s])), o = (s) => {
|
|
1958
|
+
if (s.nodeType === "asset")
|
|
1959
|
+
ye(n, s.assetSourceRevisionId, "usd", s.nodeId);
|
|
1960
|
+
else if (s.nodeType === "visual")
|
|
1961
|
+
ye(n, s.visualSourceRevisionId, "visual", s.nodeId);
|
|
1962
|
+
else if (s.nodeType === "placeholder" && s.assetSourceRevisionId)
|
|
1963
|
+
ye(n, s.assetSourceRevisionId, "usd", s.nodeId);
|
|
1964
|
+
else if (s.nodeType === "group")
|
|
1965
|
+
for (const r of s.children) o(r);
|
|
1966
|
+
};
|
|
1967
|
+
o(e.root);
|
|
1968
|
+
}
|
|
1969
|
+
function gt(e, t) {
|
|
1970
|
+
return {
|
|
1971
|
+
nodeId: e.nodeId,
|
|
1972
|
+
label: e.label,
|
|
1973
|
+
localTransform: e.localTransform,
|
|
1974
|
+
...e.origin ? { origin: e.origin } : {},
|
|
1975
|
+
nodeType: "group",
|
|
1976
|
+
children: e.children.map((n) => Wn(n, t))
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
function Wn(e, t) {
|
|
1980
|
+
return e.nodeType === "group" ? gt(e, t) : e.nodeType === "asset" ? Xn(e, t) : e.nodeType === "visual" ? qn(e, t) : e.nodeType === "placeholder" ? Qn(e, t) : ts(e);
|
|
1981
|
+
}
|
|
1982
|
+
function Xn(e, t) {
|
|
1983
|
+
return {
|
|
1984
|
+
nodeId: e.nodeId,
|
|
1985
|
+
label: e.label,
|
|
1986
|
+
localTransform: e.localTransform,
|
|
1987
|
+
...e.origin ? { origin: e.origin } : {},
|
|
1988
|
+
nodeType: "asset",
|
|
1989
|
+
assetSourceRevisionId: Ne(t, "usd", e.assetRevisionId, e.nodeId),
|
|
1990
|
+
role: e.role,
|
|
1991
|
+
visible: e.visible,
|
|
1992
|
+
variantSelections: e.variantSelections,
|
|
1993
|
+
...e.appearance ? { appearance: e.appearance } : {},
|
|
1994
|
+
physics: e.physics,
|
|
1995
|
+
...e.initialPose ? { initialPose: e.initialPose } : {},
|
|
1996
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
function qn(e, t) {
|
|
2000
|
+
return {
|
|
2001
|
+
nodeId: e.nodeId,
|
|
2002
|
+
label: e.label,
|
|
2003
|
+
localTransform: e.localTransform,
|
|
2004
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2005
|
+
nodeType: "visual",
|
|
2006
|
+
visualSourceRevisionId: Ne(
|
|
2007
|
+
t,
|
|
2008
|
+
"visual",
|
|
2009
|
+
e.visualRevisionId,
|
|
2010
|
+
e.nodeId
|
|
2011
|
+
),
|
|
2012
|
+
visible: e.visible,
|
|
2013
|
+
renderLayer: e.renderLayer,
|
|
2014
|
+
selectionMode: e.selectionMode,
|
|
2015
|
+
...e.appearance ? { appearance: e.appearance } : {},
|
|
2016
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
function Qn(e, t) {
|
|
2020
|
+
return {
|
|
2021
|
+
nodeId: e.nodeId,
|
|
2022
|
+
label: e.label,
|
|
2023
|
+
localTransform: e.localTransform,
|
|
2024
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2025
|
+
nodeType: "placeholder",
|
|
2026
|
+
placeholderVersion: e.placeholderVersion,
|
|
2027
|
+
size: e.size,
|
|
2028
|
+
role: e.role,
|
|
2029
|
+
visible: e.visible,
|
|
2030
|
+
...e.assetRevisionId ? {
|
|
2031
|
+
assetSourceRevisionId: Ne(
|
|
2032
|
+
t,
|
|
2033
|
+
"usd",
|
|
2034
|
+
e.assetRevisionId,
|
|
2035
|
+
e.nodeId
|
|
2036
|
+
)
|
|
2037
|
+
} : {},
|
|
2038
|
+
...e.externalRef ? { externalRef: e.externalRef } : {},
|
|
2039
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
function es(e) {
|
|
2043
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
2044
|
+
for (const o of e.entries) {
|
|
2045
|
+
const s = o.interpretation.runtimeRevision;
|
|
2046
|
+
"revisionId" in s ? t.set(s.revisionId, o.source.sourceRevisionId) : n.set(s.visualRevisionId, o.source.sourceRevisionId);
|
|
2047
|
+
}
|
|
2048
|
+
return { usd: t, visual: n };
|
|
2049
|
+
}
|
|
2050
|
+
function Ne(e, t, n, o) {
|
|
2051
|
+
const s = e[t].get(n);
|
|
2052
|
+
if (!s)
|
|
2053
|
+
throw new Error(
|
|
2054
|
+
`Scene node ${o} references a ${t} runtime revision missing from AssetCatalog: ${n}.`
|
|
2055
|
+
);
|
|
2056
|
+
return s;
|
|
2057
|
+
}
|
|
2058
|
+
function ts(e) {
|
|
2059
|
+
return {
|
|
2060
|
+
nodeId: e.nodeId,
|
|
2061
|
+
label: e.label,
|
|
2062
|
+
localTransform: e.localTransform,
|
|
2063
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2064
|
+
nodeType: "domain",
|
|
2065
|
+
domainId: e.domainId,
|
|
2066
|
+
dataVersion: e.dataVersion,
|
|
2067
|
+
payload: e.payload,
|
|
2068
|
+
visible: e.visible,
|
|
2069
|
+
selectable: e.selectable,
|
|
2070
|
+
...e.bounds ? { bounds: e.bounds } : {},
|
|
2071
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
function St(e, t) {
|
|
2075
|
+
return {
|
|
2076
|
+
nodeId: e.nodeId,
|
|
2077
|
+
label: e.label,
|
|
2078
|
+
localTransform: e.localTransform,
|
|
2079
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2080
|
+
nodeType: "group",
|
|
2081
|
+
children: e.children.map((n) => ns(n, t))
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
function ns(e, t) {
|
|
2085
|
+
if (e.nodeType === "group") return St(e, t);
|
|
2086
|
+
if (e.nodeType === "asset") {
|
|
2087
|
+
const n = Ee(t, e.assetSourceRevisionId, "usd").interpretation.runtimeRevision;
|
|
2088
|
+
return {
|
|
2089
|
+
nodeId: e.nodeId,
|
|
2090
|
+
label: e.label,
|
|
2091
|
+
localTransform: e.localTransform,
|
|
2092
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2093
|
+
nodeType: "asset",
|
|
2094
|
+
assetRevisionId: "revisionId" in n ? n.revisionId : "",
|
|
2095
|
+
role: e.role,
|
|
2096
|
+
visible: e.visible,
|
|
2097
|
+
variantSelections: e.variantSelections,
|
|
2098
|
+
...e.appearance ? { appearance: e.appearance } : {},
|
|
2099
|
+
physics: e.physics,
|
|
2100
|
+
...e.initialPose ? { initialPose: e.initialPose } : {},
|
|
2101
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2102
|
+
};
|
|
2103
|
+
}
|
|
2104
|
+
if (e.nodeType === "visual") {
|
|
2105
|
+
const n = Ee(t, e.visualSourceRevisionId, "visual").interpretation.runtimeRevision;
|
|
2106
|
+
return {
|
|
2107
|
+
nodeId: e.nodeId,
|
|
2108
|
+
label: e.label,
|
|
2109
|
+
localTransform: e.localTransform,
|
|
2110
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2111
|
+
nodeType: "visual",
|
|
2112
|
+
visualRevisionId: "visualRevisionId" in n ? n.visualRevisionId : "",
|
|
2113
|
+
visible: e.visible,
|
|
2114
|
+
renderLayer: e.renderLayer,
|
|
2115
|
+
selectionMode: e.selectionMode,
|
|
2116
|
+
...e.appearance ? { appearance: e.appearance } : {},
|
|
2117
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
if (e.nodeType === "placeholder") {
|
|
2121
|
+
const n = e.assetSourceRevisionId ? Ee(t, e.assetSourceRevisionId, "usd").interpretation.runtimeRevision : null;
|
|
2122
|
+
return {
|
|
2123
|
+
nodeId: e.nodeId,
|
|
2124
|
+
label: e.label,
|
|
2125
|
+
localTransform: e.localTransform,
|
|
2126
|
+
...e.origin ? { origin: e.origin } : {},
|
|
2127
|
+
nodeType: "placeholder",
|
|
2128
|
+
placeholderVersion: e.placeholderVersion,
|
|
2129
|
+
size: e.size,
|
|
2130
|
+
...n && "revisionId" in n ? { assetRevisionId: n.revisionId } : {},
|
|
2131
|
+
...e.externalRef ? { externalRef: e.externalRef } : {},
|
|
2132
|
+
role: e.role,
|
|
2133
|
+
visible: e.visible,
|
|
2134
|
+
...e.semantic ? { semantic: e.semantic } : {}
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
return e;
|
|
2138
|
+
}
|
|
2139
|
+
function Ee(e, t, n) {
|
|
2140
|
+
const o = e.get(t);
|
|
2141
|
+
if (!o || o.kind !== n)
|
|
2142
|
+
throw new Error(`Scene references missing ${n} source revision ${t}.`);
|
|
2143
|
+
return o;
|
|
2144
|
+
}
|
|
2145
|
+
function ye(e, t, n, o) {
|
|
2146
|
+
const s = e.get(t);
|
|
2147
|
+
if (!s || s.kind !== n)
|
|
2148
|
+
throw new Error(`Scene node ${o} references missing ${n} source revision ${t}.`);
|
|
2149
|
+
}
|
|
2150
|
+
const Ls = "sim-studio.delivery-profile@1", ks = "sim-studio.usd-delivery-plan@4", $s = "sim-studio.delivery-evidence@1", Fs = "sim-studio.usd-export-evidence@3";
|
|
2151
|
+
function ss(e) {
|
|
2152
|
+
const t = {
|
|
2153
|
+
format: "sim-studio.delivery-evidence@1",
|
|
2154
|
+
schemaVersion: 1,
|
|
2155
|
+
subjectDigest: e.subjectDigest,
|
|
2156
|
+
profileDigest: it(e.profile),
|
|
2157
|
+
validator: { ...e.validator },
|
|
2158
|
+
axes: rs(e.axes)
|
|
2159
|
+
};
|
|
2160
|
+
return {
|
|
2161
|
+
...t,
|
|
2162
|
+
evidenceDigest: Et(t)
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
function os(e, t) {
|
|
2166
|
+
const n = it(t.profile);
|
|
2167
|
+
return e.format === "sim-studio.delivery-evidence@1" && e.schemaVersion === 1 && e.subjectDigest === t.subjectDigest && e.profileDigest === n && e.validator.id === t.validator.id && e.validator.version === t.validator.version && e.validator.optionsDigest === t.validator.optionsDigest && e.evidenceDigest === Et(is(e));
|
|
2168
|
+
}
|
|
2169
|
+
function Gs(e, t) {
|
|
2170
|
+
if (os(e, t)) return e;
|
|
2171
|
+
const n = {
|
|
2172
|
+
openUsdStructure: ae(e.axes.openUsdStructure),
|
|
2173
|
+
stormRender: ae(e.axes.stormRender),
|
|
2174
|
+
isaacProfileStatic: ae(e.axes.isaacProfileStatic),
|
|
2175
|
+
isaacRuntime: ae(e.axes.isaacRuntime)
|
|
2176
|
+
};
|
|
2177
|
+
return ss({
|
|
2178
|
+
subjectDigest: e.subjectDigest,
|
|
2179
|
+
profile: t.profile,
|
|
2180
|
+
validator: t.validator,
|
|
2181
|
+
axes: n
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
function Vs(e) {
|
|
2185
|
+
return U(be(e));
|
|
2186
|
+
}
|
|
2187
|
+
function ae(e) {
|
|
2188
|
+
return { status: e.status === "not_run" || e.status === "not_applicable" ? e.status : "stale" };
|
|
2189
|
+
}
|
|
2190
|
+
function rs(e) {
|
|
2191
|
+
return {
|
|
2192
|
+
openUsdStructure: ce(e.openUsdStructure.status),
|
|
2193
|
+
stormRender: ce(e.stormRender.status),
|
|
2194
|
+
isaacProfileStatic: ce(e.isaacProfileStatic.status),
|
|
2195
|
+
isaacRuntime: ce(e.isaacRuntime.status)
|
|
2196
|
+
};
|
|
2197
|
+
}
|
|
2198
|
+
function ce(e) {
|
|
2199
|
+
return { status: e };
|
|
2200
|
+
}
|
|
2201
|
+
function Et(e) {
|
|
2202
|
+
return U(be(e));
|
|
2203
|
+
}
|
|
2204
|
+
function is(e) {
|
|
2205
|
+
const { evidenceDigest: t, ...n } = e;
|
|
2206
|
+
return n;
|
|
2207
|
+
}
|
|
2208
|
+
async function Bs(e, t, n = {}) {
|
|
2209
|
+
return as({
|
|
2210
|
+
document: e.document,
|
|
2211
|
+
editorial: t.editorial,
|
|
2212
|
+
assetCatalog: t.assetCatalog,
|
|
2213
|
+
resourceManifest: t.resourceManifest,
|
|
2214
|
+
...t.resources ? { resources: t.resources } : {}
|
|
2215
|
+
}, n);
|
|
2216
|
+
}
|
|
2217
|
+
const yt = /* @__PURE__ */ new Date("1980-01-01T00:00:00.000Z"), j = {
|
|
2218
|
+
scene: "scene.json",
|
|
2219
|
+
editorial: "editorial.json",
|
|
2220
|
+
assetCatalog: "asset-catalog.json",
|
|
2221
|
+
resourceManifest: "resource-manifest.json"
|
|
2222
|
+
};
|
|
2223
|
+
class y extends Error {
|
|
2224
|
+
constructor(t, n) {
|
|
2225
|
+
super(n), this.code = t, this.name = "ScenePackageError";
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
async function as(e, t = {}) {
|
|
2229
|
+
hs(e.document), At(e.assetCatalog), It(e.resourceManifest), Ct(e.assetCatalog, e.resourceManifest), at(e.editorial, e.document);
|
|
2230
|
+
const n = Jn(e.document, e.assetCatalog);
|
|
2231
|
+
pt(n, e.assetCatalog), bt(n, e.assetCatalog);
|
|
2232
|
+
const o = te(n), s = te(e.editorial), r = te(e.assetCatalog), c = te(e.resourceManifest), i = {
|
|
2233
|
+
format: mt,
|
|
2234
|
+
schemaVersion: 5,
|
|
2235
|
+
minReaderVersion: 5,
|
|
2236
|
+
documents: {
|
|
2237
|
+
scene: { path: j.scene, contentHash: U(o) },
|
|
2238
|
+
editorial: { path: j.editorial, contentHash: U(s) },
|
|
2239
|
+
assetCatalog: { path: j.assetCatalog, contentHash: U(r) },
|
|
2240
|
+
resourceManifest: {
|
|
2241
|
+
path: j.resourceManifest,
|
|
2242
|
+
contentHash: U(c)
|
|
2243
|
+
}
|
|
2244
|
+
},
|
|
2245
|
+
resourceRoot: "resources"
|
|
2246
|
+
}, a = te(i), l = new re();
|
|
2247
|
+
ee(l, j.scene, o), ee(l, j.editorial, s), ee(l, j.assetCatalog, r), ee(l, j.resourceManifest, c), ee(l, "manifest.json", a);
|
|
2248
|
+
const u = ps(e.resourceManifest), f = new Map((e.resources ?? []).map((d) => [d.sha256, d]));
|
|
2249
|
+
for (const d of u) {
|
|
2250
|
+
const g = f.get(d.sha256);
|
|
2251
|
+
if (!g)
|
|
2252
|
+
throw new y(
|
|
2253
|
+
"SCENE_PACKAGE_EMBEDDED_RESOURCE_MISSING",
|
|
2254
|
+
`Embedded resource data is missing: ${d.resourceId} (${d.sha256}).`
|
|
2255
|
+
);
|
|
2256
|
+
if (U(g.bytes) !== d.sha256)
|
|
2257
|
+
throw new y(
|
|
2258
|
+
"SCENE_PACKAGE_RESOURCE_HASH_MISMATCH",
|
|
2259
|
+
`Embedded resource hash mismatch: ${d.resourceId}.`
|
|
2260
|
+
);
|
|
2261
|
+
if (g.bytes.byteLength !== d.byteSize)
|
|
2262
|
+
throw new y(
|
|
2263
|
+
"SCENE_PACKAGE_RESOURCE_SIZE_MISMATCH",
|
|
2264
|
+
`Embedded resource byteSize mismatch: ${d.resourceId}.`
|
|
2265
|
+
);
|
|
2266
|
+
const p = de(d);
|
|
2267
|
+
l.file(p) || l.file(p, g.bytes, {
|
|
2268
|
+
binary: !0,
|
|
2269
|
+
date: yt,
|
|
2270
|
+
createFolders: !1
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
const m = await l.generateAsync({
|
|
2274
|
+
type: "uint8array",
|
|
2275
|
+
compression: "DEFLATE",
|
|
2276
|
+
compressionOptions: { level: 6 },
|
|
2277
|
+
platform: "DOS"
|
|
2278
|
+
});
|
|
2279
|
+
return {
|
|
2280
|
+
bytes: m,
|
|
2281
|
+
manifest: i,
|
|
2282
|
+
packageDigest: U(m)
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
async function zs(e, t = {}) {
|
|
2286
|
+
const n = await re.loadAsync(e), o = n.file("manifest.json");
|
|
2287
|
+
if (!o)
|
|
2288
|
+
throw new y(
|
|
2289
|
+
"UNSUPPORTED_SCENE_PACKAGE_FORMAT",
|
|
2290
|
+
"Scene package manifest.json is missing; legacy scene archives are not supported."
|
|
2291
|
+
);
|
|
2292
|
+
const s = ne(await o.async("string"), "manifest");
|
|
2293
|
+
if (!B(s) || s.format !== mt)
|
|
2294
|
+
throw new y(
|
|
2295
|
+
"UNSUPPORTED_SCENE_PACKAGE_FORMAT",
|
|
2296
|
+
`Unsupported scene package format: ${String(B(s) ? s.format : s)}.`
|
|
2297
|
+
);
|
|
2298
|
+
cs(s);
|
|
2299
|
+
const r = s, c = await le(n, r.documents.scene), i = await le(n, r.documents.editorial), a = await le(n, r.documents.assetCatalog), l = await le(n, r.documents.resourceManifest), u = ne(c, "scene"), f = ne(i, "editorial"), m = ne(a, "asset catalog"), d = ne(l, "resource manifest");
|
|
2300
|
+
ms(u, f, m, d);
|
|
2301
|
+
const g = u, p = f, S = m, I = d;
|
|
2302
|
+
At(S), It(I), pt(g, S), Ct(S, I);
|
|
2303
|
+
const C = await us(n, I, t), v = bt(g, S);
|
|
2304
|
+
return at(p, v), {
|
|
2305
|
+
document: v,
|
|
2306
|
+
editorial: p,
|
|
2307
|
+
assetCatalog: S,
|
|
2308
|
+
resourceManifest: I,
|
|
2309
|
+
resources: C,
|
|
2310
|
+
manifest: r,
|
|
2311
|
+
packageDigest: U(e)
|
|
2312
|
+
};
|
|
2313
|
+
}
|
|
2314
|
+
function cs(e) {
|
|
2315
|
+
if (!B(e))
|
|
2316
|
+
throw new y("SCENE_PACKAGE_INVALID_MANIFEST", "Scene package manifest must be an object.");
|
|
2317
|
+
if (e.schemaVersion !== 5 || e.minReaderVersion !== 5)
|
|
2318
|
+
throw new y(
|
|
2319
|
+
"SCENE_PACKAGE_VERSION_UNSUPPORTED",
|
|
2320
|
+
`Scene package schema ${String(e.schemaVersion)} requires reader ${String(e.minReaderVersion)}.`
|
|
2321
|
+
);
|
|
2322
|
+
if (e.resourceRoot !== "resources")
|
|
2323
|
+
throw new y("SCENE_PACKAGE_INVALID_MANIFEST", "Scene package resourceRoot must be resources.");
|
|
2324
|
+
if (!B(e.documents))
|
|
2325
|
+
throw new y(
|
|
2326
|
+
"SCENE_PACKAGE_INVALID_MANIFEST",
|
|
2327
|
+
"Scene package documents must be an object."
|
|
2328
|
+
);
|
|
2329
|
+
const t = ["scene", "editorial", "assetCatalog", "resourceManifest"];
|
|
2330
|
+
if (Object.keys(e.documents).length !== t.length)
|
|
2331
|
+
throw new y(
|
|
2332
|
+
"SCENE_PACKAGE_INVALID_MANIFEST",
|
|
2333
|
+
"Scene package manifest must contain exactly the four fixed documents."
|
|
2334
|
+
);
|
|
2335
|
+
for (const n of t) {
|
|
2336
|
+
const o = e.documents[n];
|
|
2337
|
+
if (!B(o) || o.path !== j[n] || typeof o.contentHash != "string")
|
|
2338
|
+
throw new y(
|
|
2339
|
+
"SCENE_PACKAGE_INVALID_MANIFEST",
|
|
2340
|
+
`Scene package document ${n} must use the fixed path ${j[n]}.`
|
|
2341
|
+
);
|
|
2342
|
+
if (!/^[a-f0-9]{64}$/.test(o.contentHash))
|
|
2343
|
+
throw new y("SCENE_PACKAGE_INVALID_MANIFEST", "Document content hashes must be SHA-256.");
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
function It(e) {
|
|
2347
|
+
if (!B(e) || e.format !== ht || e.schemaVersion !== 2 || !Array.isArray(e.resources))
|
|
2348
|
+
throw new y("SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST", "Unsupported resource manifest.");
|
|
2349
|
+
if (e.storagePolicy !== "embedded" && e.storagePolicy !== "remote" && e.storagePolicy !== "mixed")
|
|
2350
|
+
throw new y(
|
|
2351
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2352
|
+
`Unsupported resource storage policy: ${String(e.storagePolicy)}.`
|
|
2353
|
+
);
|
|
2354
|
+
const t = /* @__PURE__ */ new Set();
|
|
2355
|
+
for (const s of e.resources) {
|
|
2356
|
+
if (!B(s) || typeof s.resourceId != "string" || s.resourceId.length === 0 || typeof s.sourceRevisionId != "string" || !/^[a-f0-9]{64}$/.test(s.sourceRevisionId) || !B(s.locator) || typeof s.sha256 != "string" || typeof s.mediaType != "string" || s.mediaType.length === 0 || typeof s.byteSize != "number" || !Number.isInteger(s.byteSize) || s.byteSize < 0 || s.artifactId !== void 0 && typeof s.artifactId != "string" || !B(s.storage))
|
|
2357
|
+
throw new y(
|
|
2358
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2359
|
+
"Resource manifest entry is invalid."
|
|
2360
|
+
);
|
|
2361
|
+
if (t.has(s.resourceId))
|
|
2362
|
+
throw new y("SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST", `Duplicate resource ${s.resourceId}.`);
|
|
2363
|
+
if (t.add(s.resourceId), !/^[a-f0-9]{64}$/.test(s.sha256))
|
|
2364
|
+
throw new y("SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST", `Invalid resource facts: ${s.resourceId}.`);
|
|
2365
|
+
if (ls(s.locator, s.resourceId), s.storage.kind === "embedded") {
|
|
2366
|
+
if (typeof s.storage.packagePath != "string" || s.storage.packagePath !== `resources/${s.sha256}`)
|
|
2367
|
+
throw new y(
|
|
2368
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2369
|
+
`Embedded resource path must be resources/<sha256>: ${s.resourceId}.`
|
|
2370
|
+
);
|
|
2371
|
+
} else if (s.storage.kind === "remote") {
|
|
2372
|
+
if (s.locator.kind !== "remote-url")
|
|
2373
|
+
throw new y(
|
|
2374
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2375
|
+
`Remote storage requires a remote-url locator: ${s.resourceId}.`
|
|
2376
|
+
);
|
|
2377
|
+
} else
|
|
2378
|
+
throw new y(
|
|
2379
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2380
|
+
`Unsupported resource storage kind: ${s.resourceId}.`
|
|
2381
|
+
);
|
|
2382
|
+
}
|
|
2383
|
+
if (e.resources.length === 0) return;
|
|
2384
|
+
const n = e.resources.some((s) => s.storage.kind === "embedded"), o = e.resources.some((s) => s.storage.kind === "remote");
|
|
2385
|
+
if (e.storagePolicy === "embedded" && (!n || o) || e.storagePolicy === "remote" && (n || !o) || e.storagePolicy === "mixed" && !(n && o))
|
|
2386
|
+
throw new y(
|
|
2387
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2388
|
+
`Resource storage policy ${e.storagePolicy} does not match its entries.`
|
|
2389
|
+
);
|
|
2390
|
+
}
|
|
2391
|
+
function ls(e, t) {
|
|
2392
|
+
if (e.kind === "package-path") {
|
|
2393
|
+
if (typeof e.path != "string")
|
|
2394
|
+
throw new y(
|
|
2395
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2396
|
+
`Package-path resource locator is invalid: ${t}.`
|
|
2397
|
+
);
|
|
2398
|
+
try {
|
|
2399
|
+
zt(e.path);
|
|
2400
|
+
return;
|
|
2401
|
+
} catch (n) {
|
|
2402
|
+
throw new y(
|
|
2403
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2404
|
+
`Invalid resource path for ${t}: ${oe(n)}`
|
|
2405
|
+
);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
if (e.kind === "remote-url" && typeof e.url == "string")
|
|
2409
|
+
try {
|
|
2410
|
+
if (Lt(e.url) !== e.url)
|
|
2411
|
+
throw new Error("URL is not canonical and queryless.");
|
|
2412
|
+
return;
|
|
2413
|
+
} catch (n) {
|
|
2414
|
+
throw new y(
|
|
2415
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2416
|
+
`Invalid remote-url locator for ${t}: ${oe(n)}`
|
|
2417
|
+
);
|
|
2418
|
+
}
|
|
2419
|
+
throw new y(
|
|
2420
|
+
"SCENE_PACKAGE_INVALID_RESOURCE_MANIFEST",
|
|
2421
|
+
`Invalid resource locator for ${t}.`
|
|
2422
|
+
);
|
|
2423
|
+
}
|
|
2424
|
+
function Ct(e, t) {
|
|
2425
|
+
const n = /* @__PURE__ */ new Map();
|
|
2426
|
+
for (const o of t.resources) {
|
|
2427
|
+
const s = `${o.sourceRevisionId}\0${w(o.locator)}`, r = n.get(s) ?? [];
|
|
2428
|
+
r.push(o), n.set(s, r);
|
|
2429
|
+
}
|
|
2430
|
+
for (const o of e.entries)
|
|
2431
|
+
for (const s of o.source.files) {
|
|
2432
|
+
const r = `${o.source.sourceRevisionId}\0${w(s.locator)}`, c = n.get(r);
|
|
2433
|
+
if (!c)
|
|
2434
|
+
throw new y(
|
|
2435
|
+
"SCENE_PACKAGE_RESOURCE_MANIFEST_INCOMPLETE",
|
|
2436
|
+
`Resource manifest does not cover ${o.source.sourceRevisionId}:${w(s.locator)}.`
|
|
2437
|
+
);
|
|
2438
|
+
if (!c.some((i) => i.sha256 === s.sha256 && i.mediaType === s.mediaType && i.byteSize === s.byteSize))
|
|
2439
|
+
throw new y(
|
|
2440
|
+
"SCENE_PACKAGE_RESOURCE_MANIFEST_MISMATCH",
|
|
2441
|
+
`Resource manifest facts do not match ${o.source.sourceRevisionId}:${w(s.locator)}.`
|
|
2442
|
+
);
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
async function us(e, t, n) {
|
|
2446
|
+
const o = [];
|
|
2447
|
+
for (const s of t.resources) {
|
|
2448
|
+
const r = s.storage.kind === "embedded" ? await ds(e, s) : await fs(s, n);
|
|
2449
|
+
if (U(r) !== s.sha256)
|
|
2450
|
+
throw new y(
|
|
2451
|
+
"SCENE_PACKAGE_RESOURCE_HASH_MISMATCH",
|
|
2452
|
+
`Resource hash mismatch: ${s.resourceId}.`
|
|
2453
|
+
);
|
|
2454
|
+
if (r.byteLength !== s.byteSize)
|
|
2455
|
+
throw new y(
|
|
2456
|
+
"SCENE_PACKAGE_RESOURCE_SIZE_MISMATCH",
|
|
2457
|
+
`Resource byteSize mismatch: ${s.resourceId}.`
|
|
2458
|
+
);
|
|
2459
|
+
o.push({ sha256: s.sha256, mediaType: s.mediaType, bytes: r });
|
|
2460
|
+
}
|
|
2461
|
+
return o.sort((s, r) => s.sha256.localeCompare(r.sha256));
|
|
2462
|
+
}
|
|
2463
|
+
async function ds(e, t) {
|
|
2464
|
+
const n = e.file(de(t));
|
|
2465
|
+
if (!n)
|
|
2466
|
+
throw new y(
|
|
2467
|
+
"SCENE_PACKAGE_RESOURCE_MISSING",
|
|
2468
|
+
`Embedded resource is missing: ${t.resourceId}.`
|
|
2469
|
+
);
|
|
2470
|
+
return n.async("uint8array");
|
|
2471
|
+
}
|
|
2472
|
+
async function fs(e, t) {
|
|
2473
|
+
if (e.storage.kind !== "remote") throw new Error("Internal remote resource mismatch.");
|
|
2474
|
+
if (!t.remoteResolver)
|
|
2475
|
+
throw new y(
|
|
2476
|
+
"SCENE_PACKAGE_REMOTE_RESOLVER_MISSING",
|
|
2477
|
+
`Remote resolver is required for ${e.resourceId}.`
|
|
2478
|
+
);
|
|
2479
|
+
const n = await t.remoteResolver.resolve(e.locator).catch(() => null);
|
|
2480
|
+
if (n) {
|
|
2481
|
+
const o = await gs(n).catch(() => null);
|
|
2482
|
+
if (o && U(o) === e.sha256) return o;
|
|
2483
|
+
}
|
|
2484
|
+
throw new y(
|
|
2485
|
+
"SCENE_PACKAGE_RESOURCE_MISSING",
|
|
2486
|
+
`All remote locators failed resolution or SHA-256 validation: ${e.resourceId}.`
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
async function le(e, t) {
|
|
2490
|
+
const n = e.file(t.path);
|
|
2491
|
+
if (!n)
|
|
2492
|
+
throw new y("SCENE_PACKAGE_DOCUMENT_MISSING", `Scene package document is missing: ${t.path}.`);
|
|
2493
|
+
const o = await n.async("string");
|
|
2494
|
+
if (U(o) !== t.contentHash)
|
|
2495
|
+
throw new y("SCENE_PACKAGE_DOCUMENT_HASH_MISMATCH", `Document hash mismatch: ${t.path}.`);
|
|
2496
|
+
return o;
|
|
2497
|
+
}
|
|
2498
|
+
function ms(e, t, n, o) {
|
|
2499
|
+
const s = [
|
|
2500
|
+
[e, Kn, 5],
|
|
2501
|
+
[t, Hn, 1],
|
|
2502
|
+
[n, Yn, 3],
|
|
2503
|
+
[o, ht, 2]
|
|
2504
|
+
];
|
|
2505
|
+
for (const [r, c, i] of s)
|
|
2506
|
+
if (!B(r) || r.format !== c || r.schemaVersion !== i)
|
|
2507
|
+
throw new y(
|
|
2508
|
+
"SCENE_PACKAGE_DOCUMENT_FORMAT_UNSUPPORTED",
|
|
2509
|
+
`Unsupported scene package document format or version: ${String(B(r) ? r.format : r)}.`
|
|
2510
|
+
);
|
|
2511
|
+
}
|
|
2512
|
+
function ee(e, t, n) {
|
|
2513
|
+
e.file(t, n, {
|
|
2514
|
+
binary: !1,
|
|
2515
|
+
date: yt,
|
|
2516
|
+
createFolders: !1
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2519
|
+
function te(e) {
|
|
2520
|
+
return `${be(e)}
|
|
2521
|
+
`;
|
|
2522
|
+
}
|
|
2523
|
+
function hs(e) {
|
|
2524
|
+
let t;
|
|
2525
|
+
try {
|
|
2526
|
+
t = Ae(e);
|
|
2527
|
+
} catch (n) {
|
|
2528
|
+
throw new y(
|
|
2529
|
+
"SCENE_PACKAGE_DOCUMENT_INVALID",
|
|
2530
|
+
`Scene document validation failed: ${oe(n)}`
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
if (!t.ok)
|
|
2534
|
+
throw new y(
|
|
2535
|
+
"SCENE_PACKAGE_DOCUMENT_INVALID",
|
|
2536
|
+
t.diagnostics.map((n) => n.message).join(`
|
|
2537
|
+
`)
|
|
2538
|
+
);
|
|
2539
|
+
}
|
|
2540
|
+
function At(e) {
|
|
2541
|
+
try {
|
|
2542
|
+
Bt(e);
|
|
2543
|
+
} catch (t) {
|
|
2544
|
+
throw new y(
|
|
2545
|
+
"SCENE_PACKAGE_ASSET_CATALOG_INVALID",
|
|
2546
|
+
`Asset catalog validation failed: ${oe(t)}`
|
|
2547
|
+
);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
function bt(e, t) {
|
|
2551
|
+
try {
|
|
2552
|
+
return Zn(e, t);
|
|
2553
|
+
} catch (n) {
|
|
2554
|
+
throw new y(
|
|
2555
|
+
"SCENE_PACKAGE_SCENE_INVALID",
|
|
2556
|
+
`Scene package projection is invalid: ${oe(n)}`
|
|
2557
|
+
);
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
function ne(e, t) {
|
|
2561
|
+
try {
|
|
2562
|
+
return JSON.parse(e);
|
|
2563
|
+
} catch (n) {
|
|
2564
|
+
throw new y(
|
|
2565
|
+
"SCENE_PACKAGE_DOCUMENT_INVALID",
|
|
2566
|
+
`${t} is not valid JSON: ${n instanceof Error ? n.message : String(n)}`
|
|
2567
|
+
);
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
function B(e) {
|
|
2571
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
2572
|
+
}
|
|
2573
|
+
function oe(e) {
|
|
2574
|
+
return e instanceof Error ? e.message : String(e);
|
|
2575
|
+
}
|
|
2576
|
+
function ps(e) {
|
|
2577
|
+
return e.resources.filter((t) => t.storage.kind === "embedded").sort((t, n) => de(t).localeCompare(de(n)));
|
|
2578
|
+
}
|
|
2579
|
+
function de(e) {
|
|
2580
|
+
if (e.storage.kind !== "embedded") throw new Error("Resource is not embedded.");
|
|
2581
|
+
return e.storage.packagePath;
|
|
2582
|
+
}
|
|
2583
|
+
async function gs(e) {
|
|
2584
|
+
if (e instanceof Uint8Array) return e;
|
|
2585
|
+
if (e instanceof ArrayBuffer) return new Uint8Array(e);
|
|
2586
|
+
if (typeof Blob < "u" && e instanceof Blob)
|
|
2587
|
+
return new Uint8Array(await e.arrayBuffer());
|
|
2588
|
+
throw new Error("Remote resource resolver returned an unsupported value.");
|
|
2589
|
+
}
|
|
2590
|
+
export {
|
|
2591
|
+
Yn as ASSET_CATALOG_FORMAT,
|
|
2592
|
+
Ko as ASSET_CATEGORIES,
|
|
2593
|
+
Hs as COMMAND_DIAGNOSTIC,
|
|
2594
|
+
Ys as CREATE_NODE_DIAGNOSTIC,
|
|
2595
|
+
pa as DEFAULT_NODE_ORIGIN,
|
|
2596
|
+
ji as DEFAULT_PLACEMENT_POLICY,
|
|
2597
|
+
Ki as DEFAULT_SNAP,
|
|
2598
|
+
$s as DELIVERY_EVIDENCE_FORMAT,
|
|
2599
|
+
Ls as DELIVERY_PROFILE_FORMAT,
|
|
2600
|
+
Js as DiagnosticBag,
|
|
2601
|
+
Hn as EDITORIAL_STATE_FORMAT,
|
|
2602
|
+
Bn as EMPTY_SELECTION,
|
|
2603
|
+
Ho as GAUSSIAN_VISUAL_FORMATS,
|
|
2604
|
+
Yo as ID_PREFIX,
|
|
2605
|
+
Jo as INSTANCE_ROLES,
|
|
2606
|
+
Zo as INSTANCE_ROLE_LABELS,
|
|
2607
|
+
Jr as INTAKE_DIAGNOSTIC,
|
|
2608
|
+
Zr as ISAAC_SIM_M1_PROFILE,
|
|
2609
|
+
ga as NODE_ORIGIN_PRESETS,
|
|
2610
|
+
Kn as PACKAGE_SCENE_FORMAT,
|
|
2611
|
+
ht as RESOURCE_MANIFEST_FORMAT,
|
|
2612
|
+
Zs as SCENE_DIAGNOSTIC,
|
|
2613
|
+
Wr as SCENE_DOCUMENT_FILE_NAME,
|
|
2614
|
+
Xr as SCENE_DOCUMENT_FORMAT,
|
|
2615
|
+
qr as SCENE_FILE_DIAGNOSTIC,
|
|
2616
|
+
mt as SCENE_PACKAGE_FORMAT,
|
|
2617
|
+
Us as SCENE_PACKAGE_SCHEMA_VERSION,
|
|
2618
|
+
Dt as SCENE_SCHEMA_VERSION,
|
|
2619
|
+
xr as STUDIO_ASSET_SOURCE_ERROR,
|
|
2620
|
+
Ws as STUDIO_DOCUMENT_DOMAIN_API_VERSION,
|
|
2621
|
+
Xs as STUDIO_DOMAIN_DIAGNOSTIC,
|
|
2622
|
+
Qr as SceneHistory,
|
|
2623
|
+
y as ScenePackageError,
|
|
2624
|
+
qs as SimStudioError,
|
|
2625
|
+
ks as USD_DELIVERY_PLAN_FORMAT,
|
|
2626
|
+
Fs as USD_EXPORT_EVIDENCE_FORMAT,
|
|
2627
|
+
Yt as VISUAL_ASSET_CAPABILITIES,
|
|
2628
|
+
Hi as adaptiveGridStepForBounds,
|
|
2629
|
+
ei as anchorReferences,
|
|
2630
|
+
Os as applyAiCommands,
|
|
2631
|
+
Ds as applyAiCommandsToHost,
|
|
2632
|
+
Pt as applyCommand,
|
|
2633
|
+
Nt as applyCommandBatch,
|
|
2634
|
+
Gs as applyDeliveryEvidenceFreshness,
|
|
2635
|
+
Yi as applyDelta,
|
|
2636
|
+
Ji as applyRotate,
|
|
2637
|
+
Zi as applyScale,
|
|
2638
|
+
Wi as applyTranslate,
|
|
2639
|
+
at as assertEditorialState,
|
|
2640
|
+
ti as assertExplicitDependenciesCoverDerived,
|
|
2641
|
+
pt as assertSceneCatalogConsistency,
|
|
2642
|
+
Or as assertStudioAssetSourceMatchesRevision,
|
|
2643
|
+
ni as assertUsdDeliveryPlanV4,
|
|
2644
|
+
Qs as assertValidSceneDoc,
|
|
2645
|
+
w as assetResourceLocatorKey,
|
|
2646
|
+
Wo as assetRevisionForNode,
|
|
2647
|
+
si as assignPrimNames,
|
|
2648
|
+
eo as buildAddAsset,
|
|
2649
|
+
_t as buildAddNode,
|
|
2650
|
+
to as buildAddVisualAsset,
|
|
2651
|
+
no as buildCoordinateSystemUpdate,
|
|
2652
|
+
so as buildDomainUpdate,
|
|
2653
|
+
oo as buildDuplicateNode,
|
|
2654
|
+
ro as buildEnvironmentUpdate,
|
|
2655
|
+
io as buildGroupNodes,
|
|
2656
|
+
ao as buildMetaUpdate,
|
|
2657
|
+
co as buildRemoveAsset,
|
|
2658
|
+
lo as buildRemoveNode,
|
|
2659
|
+
uo as buildRemoveVisualAsset,
|
|
2660
|
+
fo as buildRenameNode,
|
|
2661
|
+
mo as buildReparentNode,
|
|
2662
|
+
ho as buildReplaceModel,
|
|
2663
|
+
po as buildSceneSemanticUpdate,
|
|
2664
|
+
go as buildSetAppearance,
|
|
2665
|
+
So as buildSetDomainNodeData,
|
|
2666
|
+
Eo as buildSetExtension,
|
|
2667
|
+
yo as buildSetInitialPose,
|
|
2668
|
+
Io as buildSetNodeOrigin,
|
|
2669
|
+
Co as buildSetNodeSemantic,
|
|
2670
|
+
Ao as buildSetPhysics,
|
|
2671
|
+
bo as buildSetPlaceholderBinding,
|
|
2672
|
+
_o as buildSetRole,
|
|
2673
|
+
vo as buildSetVariants,
|
|
2674
|
+
Ro as buildSetVisible,
|
|
2675
|
+
No as buildSetVisualAppearance,
|
|
2676
|
+
Po as buildSetVisualRenderLayer,
|
|
2677
|
+
To as buildSetVisualSelectionMode,
|
|
2678
|
+
wo as buildTransformNode,
|
|
2679
|
+
Mo as buildUngroupNode,
|
|
2680
|
+
oi as buildUsdDeliveryPlan,
|
|
2681
|
+
xo as calculateAssetFactsHash,
|
|
2682
|
+
it as calculateDeliveryProfileDigest,
|
|
2683
|
+
ri as calculateSceneContentHash,
|
|
2684
|
+
ii as calculateUsdDeliveryPlanDigest,
|
|
2685
|
+
ai as calculateUsdPackageDigest,
|
|
2686
|
+
Vs as calculateValidatorOptionsDigest,
|
|
2687
|
+
vt as calculateVisualAssetFactsHash,
|
|
2688
|
+
ci as canonicalDocumentHash,
|
|
2689
|
+
Dr as canonicalEntryUrl,
|
|
2690
|
+
Lt as canonicalRemoteResourceUrl,
|
|
2691
|
+
Ke as cloneData,
|
|
2692
|
+
Xo as collectReferencedRevisionIds,
|
|
2693
|
+
Oo as compareStrings,
|
|
2694
|
+
qo as composeLocalTransforms,
|
|
2695
|
+
Ur as copyStudioAssetSource,
|
|
2696
|
+
li as createAssetCatalog,
|
|
2697
|
+
ui as createAssetInterpretation,
|
|
2698
|
+
Do as createAssetNodeFromRevision,
|
|
2699
|
+
di as createAssetRevision,
|
|
2700
|
+
Uo as createBoundingBoxPlaceholderNode,
|
|
2701
|
+
Tt as createCommandRecord,
|
|
2702
|
+
Qo as createDefaultCoordinateSystem,
|
|
2703
|
+
er as createDefaultEnvironment,
|
|
2704
|
+
ss as createDeliveryValidationEvidence,
|
|
2705
|
+
ua as createEditorialState,
|
|
2706
|
+
tr as createIdentityTransform,
|
|
2707
|
+
nr as createSceneAssetNode,
|
|
2708
|
+
sr as createSceneDocument,
|
|
2709
|
+
or as createSceneDomainNode,
|
|
2710
|
+
rr as createSceneGroupNode,
|
|
2711
|
+
as as createScenePackage,
|
|
2712
|
+
Bs as createScenePackageFromHost,
|
|
2713
|
+
Mt as createScenePlaceholderNode,
|
|
2714
|
+
xs as createSceneReader,
|
|
2715
|
+
ir as createSceneVisualNode,
|
|
2716
|
+
bs as createSeededPlaceholderBatch,
|
|
2717
|
+
Rt as createUlid,
|
|
2718
|
+
fi as createUsdExportEvidence,
|
|
2719
|
+
Jt as createVisualAssetRevision,
|
|
2720
|
+
Lo as createVisualNodeFromRevision,
|
|
2721
|
+
ar as deepEqualData,
|
|
2722
|
+
je as deepFreeze,
|
|
2723
|
+
ko as defaultPhysicsForAsset,
|
|
2724
|
+
cr as defaultRoleForCategory,
|
|
2725
|
+
mi as deriveSourceDependencies,
|
|
2726
|
+
hi as detectLayout,
|
|
2727
|
+
_s as diffAssetRevisions,
|
|
2728
|
+
da as editorialNodeState,
|
|
2729
|
+
fa as editorialStateToHost,
|
|
2730
|
+
Xi as effectiveGridStep,
|
|
2731
|
+
qi as evaluatePlacement,
|
|
2732
|
+
pi as extensionOf,
|
|
2733
|
+
gi as extractReferences,
|
|
2734
|
+
lr as findAssetRevision,
|
|
2735
|
+
ur as findAssetRevisionByAssetId,
|
|
2736
|
+
Si as findCatalogEntryByRuntimeRevision,
|
|
2737
|
+
dr as findSceneAssetNode,
|
|
2738
|
+
fr as findSceneDomainNode,
|
|
2739
|
+
mr as findSceneNode,
|
|
2740
|
+
hr as findSceneNodeLocation,
|
|
2741
|
+
pr as findScenePlaceholderNode,
|
|
2742
|
+
gr as findSceneVisualNode,
|
|
2743
|
+
Sr as findVisualAssetRevision,
|
|
2744
|
+
Er as findVisualAssetRevisionByAssetId,
|
|
2745
|
+
Qi as footprintOverlaps,
|
|
2746
|
+
Sa as getStudioAssetDimensions,
|
|
2747
|
+
Ea as getStudioNodeFrame,
|
|
2748
|
+
ya as getStudioPhysicsFacts,
|
|
2749
|
+
Ia as getStudioSelectionFrame,
|
|
2750
|
+
yr as insertSceneNode,
|
|
2751
|
+
Ps as inspectPublicUsd,
|
|
2752
|
+
ot as instanceIdFromName,
|
|
2753
|
+
Ei as intakePackage,
|
|
2754
|
+
Rs as intakeVisualFiles,
|
|
2755
|
+
yi as invertCommand,
|
|
2756
|
+
os as isDeliveryEvidenceCurrent,
|
|
2757
|
+
ea as isSupportSurfaceNormal,
|
|
2758
|
+
Ii as isTextualLayer,
|
|
2759
|
+
Ie as isTextualLayerBytes,
|
|
2760
|
+
Ci as isUsdPath,
|
|
2761
|
+
xt as listSceneAssetNodes,
|
|
2762
|
+
Ir as listSceneDomainNodes,
|
|
2763
|
+
Cr as listScenePlaceholderNodes,
|
|
2764
|
+
Ar as listSceneVisualNodes,
|
|
2765
|
+
br as localTransformFromWorld,
|
|
2766
|
+
Ai as makeRepair,
|
|
2767
|
+
ta as multiplyQuaternions,
|
|
2768
|
+
$o as nextCopyLabel,
|
|
2769
|
+
Ca as nodeOriginPivot,
|
|
2770
|
+
Aa as nodeOriginPresetLocal,
|
|
2771
|
+
Fo as normalizeDocumentDomains,
|
|
2772
|
+
ma as normalizeEditorialCamera,
|
|
2773
|
+
zt as normalizePackagePath,
|
|
2774
|
+
Lr as normalizePackageResourcePath,
|
|
2775
|
+
Ce as normalizePath,
|
|
2776
|
+
na as normalizePlacementPolicy,
|
|
2777
|
+
sa as normalizeQuaternion,
|
|
2778
|
+
kr as normalizeRemoteSource,
|
|
2779
|
+
ue as normalizeResourceLocator,
|
|
2780
|
+
bi as normalizeSceneDocument,
|
|
2781
|
+
$r as normalizeScopes,
|
|
2782
|
+
_i as normalizeSourceBundle,
|
|
2783
|
+
Fr as packagePathFromLocator,
|
|
2784
|
+
_r as parentWorldTransformForNode,
|
|
2785
|
+
vi as parseSceneDocument,
|
|
2786
|
+
Gr as pathMatchesPrefix,
|
|
2787
|
+
Ts as pickInstance,
|
|
2788
|
+
oa as placeAtPoint,
|
|
2789
|
+
ra as placementVolumesOverlap,
|
|
2790
|
+
ft as prepareAiCommands,
|
|
2791
|
+
Vr as prepareStudioAssetSource,
|
|
2792
|
+
Jn as projectSceneDocument,
|
|
2793
|
+
Ms as pruneSelection,
|
|
2794
|
+
Ri as readManifestText,
|
|
2795
|
+
Ni as readSceneDocument,
|
|
2796
|
+
zs as readScenePackage,
|
|
2797
|
+
Go as referencedRevisionIds,
|
|
2798
|
+
Br as remoteUrlFromLocator,
|
|
2799
|
+
Pi as removeReference,
|
|
2800
|
+
vr as removeSceneNode,
|
|
2801
|
+
Ti as replaceReferenceTarget,
|
|
2802
|
+
wi as requiresUsdCompilation,
|
|
2803
|
+
Mi as resolveExportVariantSelection,
|
|
2804
|
+
xi as resolveFrom,
|
|
2805
|
+
ba as resolveNodeOriginLocal,
|
|
2806
|
+
Zn as restoreSceneDocument,
|
|
2807
|
+
He as revisionEntryResource,
|
|
2808
|
+
Oi as revisionResourceByLocator,
|
|
2809
|
+
Di as revisionResourceLocatorKeys,
|
|
2810
|
+
Vo as roundDecimals,
|
|
2811
|
+
Ns as runModelInspection,
|
|
2812
|
+
Ui as sanitizeIdentifier,
|
|
2813
|
+
$t as scanDependencies,
|
|
2814
|
+
ia as seatOnFloor,
|
|
2815
|
+
ws as selectAt,
|
|
2816
|
+
Li as serializeSceneDocument,
|
|
2817
|
+
jt as simStudioVersion,
|
|
2818
|
+
ki as slugFromRoot,
|
|
2819
|
+
aa as snapValue,
|
|
2820
|
+
$i as sortRepairs,
|
|
2821
|
+
Bo as sortStable,
|
|
2822
|
+
zr as sourceBundleFromLocalSource,
|
|
2823
|
+
jr as sourceRevisionIdOf,
|
|
2824
|
+
Rr as stableStringify,
|
|
2825
|
+
Fi as stripExternalReferences,
|
|
2826
|
+
Kr as studioAssetSourceFingerprint,
|
|
2827
|
+
Gi as toSlug,
|
|
2828
|
+
ca as unionBounds,
|
|
2829
|
+
Nr as updateSceneAssetNode,
|
|
2830
|
+
Pr as updateSceneNode,
|
|
2831
|
+
Vi as validateDeliveryProfile,
|
|
2832
|
+
zo as validateDocumentDomains,
|
|
2833
|
+
Ae as validateSceneDoc,
|
|
2834
|
+
Hr as verifyStudioAssetSourceFacts,
|
|
2835
|
+
vs as visualRevisionEntryResource,
|
|
2836
|
+
Tr as visualRevisionForNode,
|
|
2837
|
+
Ot as walkSceneNodes,
|
|
2838
|
+
wr as worldTransformForNode,
|
|
2839
|
+
Bi as writeSceneDocument
|
|
2840
|
+
};
|