rig-review 1.2.1 → 1.4.0
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/docs/ANIMATION_INSPECTION.md +1 -1
- package/docs/DESIGN.md +2 -0
- package/docs/PANELS.md +8 -5
- package/docs/REVIEW_PACKAGE.md +6 -4
- package/package.json +1 -1
- package/src/environment.ts +12 -4
- package/src/front.ts +1 -1
- package/src/handoff.ts +25 -3
- package/src/manifest.ts +27 -4
- package/src/server.ts +3 -1
- package/web/animation-inspection.ts +10 -19
- package/web/catalog-en.ts +2 -3
- package/web/catalog-ko.ts +2 -3
- package/web/compare-picked-tools.ts +2 -5
- package/web/compare.css +4 -2
- package/web/compare.ts +6 -1
- package/web/i18n.ts +2 -1
- package/web/index.html +1 -1
- package/web/main.ts +10 -24
- package/web/stage-pick.ts +150 -0
- package/web/styles.css +4 -2
- package/web/view-controls.ts +17 -5
|
@@ -4,7 +4,7 @@ Animate → Transport offers a timeline, a stored-curve view and a bone tree for
|
|
|
4
4
|
|
|
5
5
|
The timeline lists bone groups followed by slot groups, one lane per stored timeline, with a mark per key including simultaneous keys. Key times remain exact seconds. Clicking a mark seeks through the existing transport; transport movement updates its playhead. No FPS is inferred. A selected bone filters its direct bone tracks; a selected slot filters that slot's tracks. Whole rig clears the filter.
|
|
6
6
|
|
|
7
|
-
Tree, Parts and stage share selection. Enable Bone points in Animate to pick bones on stage. A bone highlights its directly attached Parts rows, including an empty set for a bone without slots; it does not select an arbitrary child slot. Clicking drawn part geometry selects its slot. Picking uses the held drawn primitives and their resolved clip. Overlapping bone points pick the last active bone in compiled source order; the tree offers exact targets. Pan gestures remain pan; the existing Setup editors keep their own handles. Bone selection is page-local; existing slot identity/bookmark behavior is unchanged.
|
|
7
|
+
Tree, Parts and stage share selection. Enable Bone points in Animate to pick bones on stage. A bone highlights its directly attached Parts rows, including an empty set for a bone without slots; it does not select an arbitrary child slot. Clicking drawn part geometry selects its slot. Hovering previews that click with the same hit test: the part's outline, a faint tint and its slot name ([Inspect a part](PANELS.md#inspect-a-part)). Picking uses the held drawn primitives and their resolved clip. Overlapping bone points pick the last active bone in compiled source order; the tree offers exact targets. Pan gestures remain pan; the existing Setup editors keep their own handles. Bone selection is page-local; existing slot identity/bookmark behavior is unchanged.
|
|
8
8
|
|
|
9
9
|
## Curve values
|
|
10
10
|
|
package/docs/DESIGN.md
CHANGED
|
@@ -105,6 +105,8 @@ The Parts explorer (the review page's left column; the compare page's right one)
|
|
|
105
105
|
|
|
106
106
|
Published Play1.14.0 supplies a frozen `slotIdentity()` snapshot coherent with `posedFrame().generation`. Review retains copied frame/identity together only after equal-generation and source-slot/order checks, uses the player's default public filter, and never seeks/reposes/changes physics merely to read identity. Exact owning skin/key, active set/skin and null reasons come from that snapshot, not a unique-declaration or texture match. A resolved identity can remain known without visible geometry or fit bounds. Clip declarations do not invent keys when the API reports no drawable attachment.
|
|
107
107
|
|
|
108
|
+
A click on the rig view in Animate selects the slot under it, and hovering previews that click (#330): the same hit test (`web/stage-pick.ts` `pickAt`) draws the part's outline and tint with its slot name beside the pointer, styled apart from the selection box, and shows nothing where the click would select nothing. It is display state only, never written to a session, feedback or export. See [Inspect a part](PANELS.md#inspect-a-part).
|
|
109
|
+
|
|
108
110
|
Selecting the selected row again (click, Space or Enter) clears the selection, the same as **Whole rig**; the control value is then `null`.
|
|
109
111
|
|
|
110
112
|
Each row shows a 24×24 CSS-pixel thumbnail (2× backing store) of the attachment the held identity snapshot says is active: the region the compiled model's `pages[].regions[]` declares under that attachment's path (or name), cut from the loaded page image by its page UVs. It is drawn when the row scrolls into view and cached per skin/attachment key. A row whose attachment has no such region (no active attachment, a non-image kind, no or several regions of that name, a rotated packing, a page that did not load) shows the type icon, and its tooltip names the reason. A whole atlas page is never a part's thumbnail. Row text and the slot count are unchanged; on the compare page each side registers its own thumbnail source from that side's compiled model and loaded page images. Both pages keep the Parts heading, search input, Whole rig button, Solo toggle and result count in a fixed tool area above a scrolling list of single-line ellipsized rows with uniform height, preserving full row text in `title` and `aria-label`.
|
package/docs/PANELS.md
CHANGED
|
@@ -50,14 +50,13 @@ inspect: a **Wind** base (−100…100), **Breeze**, a **Gust** pulse
|
|
|
50
50
|
(peak 0…200, duration 0.1…20 s, **Repeat** every max(6, duration + 0.6) s)
|
|
51
51
|
and **Gravity** (0…4), applied through `player.environment` in the same frame
|
|
52
52
|
step that draws. The gust clock is the stepped player time, so pausing freezes
|
|
53
|
-
it. **Jolt** sends a translate-and-return impulse through `player.moved
|
|
54
|
-
|
|
55
|
-
instead of the camera (Space still pans). **Reset physics** returns the
|
|
53
|
+
it. **Jolt** sends a translate-and-return impulse through `player.moved`.
|
|
54
|
+
**Reset physics** returns the
|
|
56
55
|
runtime start values and re-poses from the current time, clearing the physics
|
|
57
56
|
history. Until a control is touched the player stays at the runtime start values. The
|
|
58
57
|
state is kept in the local draft and recorded in feedback as
|
|
59
|
-
`context.environment`; nothing is written to the model or motion.
|
|
60
|
-
page
|
|
58
|
+
`context.environment`; nothing is written to the model or motion. On the
|
|
59
|
+
compare page the block is in Animate (shared markup, #234) and drives the picked build only.
|
|
61
60
|
|
|
62
61
|
Below it, the **Physics tuning** panel (`#physics-panel`) edits the physics
|
|
63
62
|
constraints through the producer. Each row is a constraint of the inspected
|
|
@@ -256,6 +255,10 @@ The pinned published `@rig-c/play`1.14.0 supplies `slotIdentity()` and frame gen
|
|
|
256
255
|
|
|
257
256
|
Source-bound links/drafts and explicit feedback preserve that side/slot plus exact attachment/owning skin/set/active skin/null reason. A restored explicit target is checked after restoring its animation/time/set and drawing; `PART_IDENTITY_MISMATCH` rolls back rather than silently substituting another key. Older slot-only links remain readable and resolve from the current authoritative snapshot. Runtime generation is current observation/feedback evidence, never a persistent identity. Named vertex weights and original source alpha remain unavailable in this inspection; packed pages are not original part images.
|
|
258
257
|
|
|
258
|
+
**A drag on the rig view moves the physics.** A plain drag on the rig pane pans the camera and, on the same move, tells the rig's player it was carried, so hair and cloth trail the way they do in the Family viewer (rig-c/examples `family/viewer/index.html`, whose tuning this takes as written): each pointer move of `dx`, `dy` page px at root scale `s` calls `player.moved({x: clamp(dx/s × 0.25, ±8), y: clamp(−dy/s × 0.25, ±6)})`. A press is a click until it travels more than 3 px from where it went down (`CLICK_SLOP_PX` in `web/stage-pick.ts`, the one line both the pick and the drag read); a click selects a part as below and moves nothing, and a press that once passed the line is a drag even if it is released where it started. The first impulse carries the whole travel since the press. A press made with **Space** held pans only, a press an editor handle or comment mode takes is unchanged, and the reference pane pans without an impulse. On the compare page a drag on either build carries both, each by its own root scale, so A and B take the same stimulus. `player.moved` applies on the player's next step, so on a paused rig nothing swings until it steps. It is inspection only: nothing is recorded in drafts, feedback or exports. The earlier **Drag to trail** toggle, which moved the physics with the camera held, is retired (#331): the default drag covers it and **Jolt** gives an impulse without moving the camera.
|
|
259
|
+
|
|
260
|
+
**Hover preview on the stage.** In **Animate**, where a click on drawn part geometry selects its slot, resting the mouse over the rig view previews that click: the part a click at that point would select gets a solid white outline (dark halo) over a faint light tint, and its slot name sits beside the pointer. It is distinct from the selection's dashed amber box. The preview and the click are one hit test (`web/stage-pick.ts` `pickAt`: the held drawn primitives with their resolved clip, the last drawn on top, only a slot the inspection lists); where a click would select nothing — empty stage, Setup, a button or handle under the pointer, Space held — nothing is shown. It is hidden while a button is pressed (a pan or a drag), while comment mode or an editor handle owns the press, and when the pointer leaves the view. It repaints only when what it would draw changes, so a still pointer over a paused rig paints nothing. Touch and keyboard show no preview, and tap and keyboard selection are unchanged. On the compare page it follows the picked build's own rig. The preview is never recorded: sessions, drafts, feedback and exports are unchanged.
|
|
261
|
+
|
|
259
262
|
This explorer is inspection. Producer-backed optimization and candidate Apply/undo/export remain separate work; the explorer does not generate mesh, rig or motion bytes.
|
|
260
263
|
|
|
261
264
|
## Chest regions (designate, rebuild, watch)
|
package/docs/REVIEW_PACKAGE.md
CHANGED
|
@@ -10,7 +10,7 @@ order. Adapter means downstream consumer integration through the published
|
|
|
10
10
|
on them. Existing producer formats and playback dependencies
|
|
11
11
|
remain authoritative.
|
|
12
12
|
|
|
13
|
-
The CLI also accepts an existing output directory. It reads a root `review.json` when present. Otherwise it constructs this contract in memory: optional root `skeleton.model.json`, otherwise the fixed rigc build path `build/skeleton.model.json`; read-only `skeleton.*`, `motion.json` and `report.json` links; root videos (`mp4`, `webm`, `mov`); image filenames containing strip/contact/sheet/filmstrip/띠; and canonical `*pose*.json` references. The root compiled model takes precedence over the build path. These are the only two automatically recognized model paths; discovery never searches recursively. One fixed layout redirects instead (#149): a folder with neither model path that is a `rig-parts build` output root — regular `parts.json` and `rig/rig.json`, a real (not symlinked) `check/` directory, and an existing `check/build/skeleton.model.json` entry — opens as its `check/` package. The package root is then `check/`, exactly as if `check/` had been opened: the same manifest, source hash, `reviewedSource`, session and open key. A folder missing any of those files is not a build root and is refused or adapted as before; a build root that also holds a model of its own opens as itself. The opened directory remains the package root, so root motion/references accompany the build model and its model-relative pages. An existing selected model with an invalid type, dangling symlink, escaping symlink or invalid model envelope is refused rather than skipped. Each reference is shown separately; no source relationship, FPS or video synchronization is inferred. It never inserts or rewrites a manifest or motion file in the source folder. Raw Spine JSON/skel remains read-only evidence with playback unavailable. The folder revision is `folder-adapter/1`; actual changed file bytes are distinguished by the source hash.
|
|
13
|
+
The CLI also accepts an existing output directory. It reads a root `review.json` when present. Otherwise it constructs this contract in memory: optional root `skeleton.model.json`, otherwise the fixed rigc build path `build/skeleton.model.json`; read-only `skeleton.*`, `motion.json` and `report.json` links; root videos (`mp4`, `webm`, `mov`); image filenames containing strip/contact/sheet/filmstrip/띠; and canonical `*pose*.json` references. The root compiled model takes precedence over the build path. These are the only two automatically recognized model paths; discovery never searches recursively. One fixed layout redirects instead (#149): a folder with neither model path that is a `rig-parts build` output root — regular `parts.json` and `rig/rig.json`, a real (not symlinked) `check/` directory, and an existing `check/build/skeleton.model.json` entry — opens as its `check/` package. The package root is then `check/`, exactly as if `check/` had been opened: the same manifest, source hash, `reviewedSource`, session and open key. A folder missing any of those files is not a build root and is refused or adapted as before; a build root that also holds a model of its own opens as itself. The opened directory remains the package root, so root motion/references accompany the build model and its model-relative pages. An existing selected model with an invalid type, dangling symlink, escaping symlink or invalid model envelope is refused rather than skipped. Each reference is shown separately; no source relationship, FPS or video synchronization is inferred. When the producer handoff knows the source painting (#329: a declared `source`, or `painting.png` beside a discovered config — *Producer handoff*, below), that painting is the first reference, labelled `Original painting · <file name>`, and the first checkpoint, so it is the reference selected on open; the contact sheet and every other adapted reference follow it unchanged. It sits outside the package, so it is never a package asset: it is served at the fixed read-only route `/review-painting` (the managed front passes it through for single reviews) by the SHA-256 pinned at load (a changed file is refused, HTTP 409), and `/api/review` names it as `sourcePainting: {id, path, sha256, url}` with the record's relative path. Its hash enters `sourceHash` and the handoff record, so changed painting bytes start a new session. When the handoff knows no painting, the references, checkpoints and source hash are exactly what they were before. A review.json package keeps its own checkpoints: the painting is listed first and is selected on open only when the first checkpoint names no reference. It never inserts or rewrites a manifest or motion file in the source folder. Raw Spine JSON/skel remains read-only evidence with playback unavailable. The folder revision is `folder-adapter/1`; actual changed file bytes are distinguished by the source hash.
|
|
14
14
|
|
|
15
15
|
`review.json` is UTF-8 JSON. Its directory is the package root. Required keys are `schema: "rig-review/1"`, `id`, `title`, and `revision`. `id` and every entry ID match `[A-Za-z0-9][A-Za-z0-9._-]{0,127}`. Titles and revision strings are nonempty. Optional collections normalize to empty arrays.
|
|
16
16
|
|
|
@@ -152,11 +152,13 @@ An Apply rebuilds through the installed producer from the files the inspected ri
|
|
|
152
152
|
3. **Discovered inside the opened folder**: `config.json`, then `rig/config.json`.
|
|
153
153
|
4. **Discovered beside an opened `out/`**: `../config.json`. It is outside the opened folder, so the record says `"how": "discovered", "outside": true` and the editor bar says *discovered outside the opened folder*, with its path and SHA-256. This step runs only when the opened folder is named `out`, and only for a regular file there (a symlink is refused).
|
|
154
154
|
|
|
155
|
-
5. **The build's own config, for the `check/` package of a `rig-parts build` output root** (#149): `../config.json` (in the build root), then `../../config.json` (beside it). A `rig-parts build` records no config path or hash, so "the producer's own config for that build" is defined by place, bounded by the build's own files: the opened package root is named `check` and its parent is a build root as recognized above, and the config is the regular file named `config.json` directly in that build root or directly in the folder holding it — the two places `rig-parts build --config <dir>/config.json --out <dir>/out` leaves it. No other parent and no other file name is looked at; a symlink there is refused (`HANDOFF_SYMLINK_ESCAPE`), never followed. The root for this step is the config's folder, the parts directory is the build root, and the record says `"how": "discovered", "outside": true` with the path (`../../config.json`) and SHA-256. Place is not proof that the config built the rig: the session baseline below is that check (`reproduced` or `not-reproduced`, by name). Declaring `--config` at exactly one of those two files (as written, its parent chain canonicalized) is taken the same way with `"how": "declared"`; that file's folder is then the root for `--parts`, `--source`, `--full`, `--head` and `--keypoints`. The build records none of those, so they stay declared-only. When nothing is at either place the refusal lists them: `MODELING_INPUT_UNAVAILABLE: config.json — looked at config.json, rig/config.json, ../config.json (in the build root), ../../config.json (beside the build root); declare it with …`.
|
|
155
|
+
5. **The build's own config, for the `check/` package of a `rig-parts build` output root** (#149): `../config.json` (in the build root), then `../../config.json` (beside it). A `rig-parts build` records no config path or hash, so "the producer's own config for that build" is defined by place, bounded by the build's own files: the opened package root is named `check` and its parent is a build root as recognized above, and the config is the regular file named `config.json` directly in that build root or directly in the folder holding it — the two places `rig-parts build --config <dir>/config.json --out <dir>/out` leaves it. No other parent and no other file name is looked at; a symlink there is refused (`HANDOFF_SYMLINK_ESCAPE`), never followed. The root for this step is the config's folder, the parts directory is the build root, and the record says `"how": "discovered", "outside": true` with the path (`../../config.json`) and SHA-256. Place is not proof that the config built the rig: the session baseline below is that check (`reproduced` or `not-reproduced`, by name). Declaring `--config` at exactly one of those two files (as written, its parent chain canonicalized) is taken the same way with `"how": "declared"`; that file's folder is then the root for `--parts`, `--source`, `--full`, `--head` and `--keypoints`. The build records none of those, so they stay declared-only — except the source painting, which is discovered by one fixed name (below). When nothing is at either place the refusal lists them: `MODELING_INPUT_UNAVAILABLE: config.json — looked at config.json, rig/config.json, ../config.json (in the build root), ../../config.json (beside the build root); declare it with …`.
|
|
156
|
+
|
|
157
|
+
**Source painting (#329).** A discovered handoff (steps 3–5) takes as its source painting the file named `painting.png` directly beside the config it found — `painting.png` or `rig/painting.png` inside the opened folder, `../painting.png` beside an opened `out/`, and for a build's `check/` package `../painting.png` (in the build root) or `../../painting.png` (beside it) — and nothing else: no other name, no other folder, no search (a painting in `inputs/` is declared with `--source`). It is held to the config's own rules at that place: it must stay inside the same root, must be a regular file (`HANDOFF_INPUT_INVALID`), and at the places outside the opened folder (steps 4 and 5) any symlink is refused (`HANDOFF_SYMLINK_ESCAPE`), never followed; inside the opened folder a symlink that leaves the root is refused the same way. The field names the place (`../../painting.png`). When present it is the record's `source`, exactly as a declared `--source` is, and is the handoff source the Bones check's `propose --from-config` reads; it declares no `--full`, so a `build` Apply still refuses for the See-through runs. Absent, the record's `source` stays `null` and nothing else changes.
|
|
156
158
|
|
|
157
159
|
Without `--parts` the parts directory is `out/` beside the config (for step 4, the opened `out/` itself; for step 5, the build root). A declared or discovered path that is missing, outside its root (the package root; for step 4 the folder holding `out/`; for step 5 the config's folder), or a symlink that leaves it is refused by name: `HANDOFF_PATH_OUTSIDE_ROOT`, `HANDOFF_SYMLINK_ESCAPE`, `HANDOFF_INPUT_MISSING`, `HANDOFF_INPUT_INVALID`, `HANDOFF_PATH_INVALID` (`open` prefixes `OPEN_HANDOFF_INVALID <flag or path>`). `rig-review open` verifies at start (before spawning or reusing a worker) that every inspected package has a compiled `model` that `@rig-c/play` loads and decodes, and in single mode by default also requires a complete producer handoff (`handoffGap`, `producerInputs`, `resolveProducer`, `contourParts`), exiting non-zero with `OPEN_MODEL_UNAVAILABLE: <reason>` when the model or handoff is missing or broken. Passing `--view-only` explicitly permits opening a compiled model that has no producer handoff at all (`handoff === null`), in which case `/api/rebuild` reports the neutral status `"view only, no producer handoff"` (with `viewOnly: true`) and no panel renders a `MODELING_*` error string; a declared or partially-present handoff with a gap still refuses `OPEN_MODEL_UNAVAILABLE: <reason>` even with `--view-only`. When `startServer` runs directly without `--view-only` and no handoff is found, `/api/rebuild` reports `MODELING_INPUT_UNAVAILABLE: config.json — looked at config.json, rig/config.json, ../config.json (beside an opened out/); declare it with rig-review open <dir> --config <path> [--parts <dir>] or the review.json "producer" block`, and Apply refuses `MODELING_HANDOFF_MISSING`.
|
|
158
160
|
|
|
159
|
-
**Hashed files.** The config; the files the config names that the producer resolves against the config's directory (`motion.animations_from`, `generation.control.skeleton`; each must stay inside the root, a missing one is listed in `missing`); `parts.json` and every regular file directly in `parts/`; every regular file directly in the inspected `rig/` (`rig.json`, `motion.json`, `mesh_report.json`, `sets.json`, …) and `rig/images/`; with `--source`/`--full`/`--head`, that PNG and the regular files directly in those directories; with `--keypoints` (#111; the review.json block's `keypoints`), that file — the same path rules as `--source` (literal, inside the root, no symlink escape).
|
|
161
|
+
**Hashed files.** The config; the files the config names that the producer resolves against the config's directory (`motion.animations_from`, `generation.control.skeleton`; each must stay inside the root, a missing one is listed in `missing`); `parts.json` and every regular file directly in `parts/`; every regular file directly in the inspected `rig/` (`rig.json`, `motion.json`, `mesh_report.json`, `sets.json`, …) and `rig/images/`; with `--source`/`--full`/`--head`, that PNG and the regular files directly in those directories; for a discovered handoff, the `painting.png` beside its config when there is one; with `--keypoints` (#111; the review.json block's `keypoints`), that file — the same path rules as `--source` (literal, inside the root, no symlink escape).
|
|
160
162
|
|
|
161
163
|
**Record and identity.** `reviewedSource.handoff` (absent when there is no handoff, so earlier identities are unchanged):
|
|
162
164
|
|
|
@@ -248,7 +250,7 @@ Play retains the standing patch across new play, seek, skin replay and composed-
|
|
|
248
250
|
|
|
249
251
|
The issue export adds an `Applied:` line for a valid record (`patch <hash>… (rig; replace /constraints/0/damping) with @rig-c/parts 1.42.0 · check PASS · rig.json differs at 1 path(s) · motion.json, sets.json, mesh_report.json unchanged · 31 images unchanged · model <hash>…`; a record without `files` says `rig.json differs at N path(s)` alone); the raw context follows it. The review's `reviewedSource` still names the inspected build.
|
|
250
252
|
|
|
251
|
-
**Bones (#109).** `GET /api/rebuild` also returns `bones`: the handoff config's `bones` list as written (or `null` without a handoff). The Bones block's edits are ordinary config patch ops, `{op:"replace", path, value:[x, y], name}` with `path` one of `/bones/<i>/at`, `/bones/<i>/points/<k>`, `/bones/<i>/tip` (rig px) and `name` the entry's `name` — a chain entry, which has none, is named by its `chain`, and `EDIT_PATCH_NAME_MISMATCH` checks it the same way. Apply sends them as one `rig` patch (no flag), so it needs the reproduced baseline. `POST /api/bones-check` (single review; same-origin, capability, 64 KiB) takes exactly `{ops, configHash}`; every op must be such a `replace` (anything else is HTTP 400 `BONES_OP_OUT_OF_SCOPE`), and the patch refusals apply (`EDIT_PATCH_STALE`, `EDIT_PATCH_NAME_MISMATCH`, `EDIT_PATCH_PATH_MISSING`, `EDIT_PATCH_PATH_HELD`; producer resolution refusals verbatim; `BONES_CHECK_BUSY`), as HTTP 200 `{status:"refused", error}`. It writes the patched config (`scratchConfigText`) to `<state>/bones-check/<package hash>/<ops hash>/config.json`, runs `rig-parts propose --parts <handoff parts> --source <handoff source> --out propose --from-config config.json` and `rig-parts compare --left <handoff config> --right config.json` there, removes the directory, and returns `{schema:"rig-review-bones-check/1", status:"checked", request:{configHash, opsSha256, ops}, producer, propose:{status:"ran"|"unavailable", exitCode, wallMs, lint[], summary, coverage[], line}, compare:{exitCode, wallMs, origins:[{bone, distance|null, tip|null, text}], summary[], line}}`. `propose.line` is the LINT count line, propose's named refusal when it exits non-zero without a LINT line, or — when the handoff
|
|
253
|
+
**Bones (#109).** `GET /api/rebuild` also returns `bones`: the handoff config's `bones` list as written (or `null` without a handoff). The Bones block's edits are ordinary config patch ops, `{op:"replace", path, value:[x, y], name}` with `path` one of `/bones/<i>/at`, `/bones/<i>/points/<k>`, `/bones/<i>/tip` (rig px) and `name` the entry's `name` — a chain entry, which has none, is named by its `chain`, and `EDIT_PATCH_NAME_MISMATCH` checks it the same way. Apply sends them as one `rig` patch (no flag), so it needs the reproduced baseline. `POST /api/bones-check` (single review; same-origin, capability, 64 KiB) takes exactly `{ops, configHash}`; every op must be such a `replace` (anything else is HTTP 400 `BONES_OP_OUT_OF_SCOPE`), and the patch refusals apply (`EDIT_PATCH_STALE`, `EDIT_PATCH_NAME_MISMATCH`, `EDIT_PATCH_PATH_MISSING`, `EDIT_PATCH_PATH_HELD`; producer resolution refusals verbatim; `BONES_CHECK_BUSY`), as HTTP 200 `{status:"refused", error}`. It writes the patched config (`scratchConfigText`) to `<state>/bones-check/<package hash>/<ops hash>/config.json`, runs `rig-parts propose --parts <handoff parts> --source <handoff source> --out propose --from-config config.json` and `rig-parts compare --left <handoff config> --right config.json` there, removes the directory, and returns `{schema:"rig-review-bones-check/1", status:"checked", request:{configHash, opsSha256, ops}, producer, propose:{status:"ran"|"unavailable", exitCode, wallMs, lint[], summary, coverage[], line}, compare:{exitCode, wallMs, origins:[{bone, distance|null, tip|null, text}], summary[], line}}`. `propose.line` is the LINT count line, propose's named refusal when it exits non-zero without a LINT line, or — when the handoff has no source painting, declared or discovered (#329) — `MODELING_INPUT_UNAVAILABLE: source painting — propose --from-config reads the painting (--source) and the handoff declares none; declare it with rig-review open <dir> --config <path> --source <png> --full <dir> or the review.json "producer" block`. Nothing is written into the package.
|
|
252
254
|
|
|
253
255
|
**Rig fields (#110).** `GET /api/rebuild` also returns `fields`: the handoff config's `regions`, `motion.blink` (as `{motion:{blink}}`), `stops`, `bones` and `turn` as written, an absent section left out (or `null` without a handoff). The Rig fields block's edits are ordinary config patch ops, each at its field's pointer (rig-parts AUTHORING §3): `{op:"replace", path:"/regions/<part>", value:<bone>}`; `{op:"add", path:"/motion/blink/still/<part>", value:{row, bone}}` (preceded by `{op:"add", path:"/motion/blink/still", value:{}}` when the config states no `still`) or `{op:"remove", path:"/motion/blink/still/<part>"}`; `{op:"replace", path:"/stops/<i>", value:<the entry with inward / outward changed>, name:<its chain>}`; `{op:"add"|"remove", path:"/bones/<i>/inherit", value:<mode>, name}` or `path:"/bones/<i>/link_inherit", value:{<link>: mode}`; `{op:"replace", path:"/turn/pivot"|"/turn/depths/<part>", value:<number>}`. A `stops` entry is named by its `chain` and `EDIT_PATCH_NAME_MISMATCH` checks it as it checks a `bones` entry. The page refuses anything else before sending (`RIG_FIELDS_OP_OUT_OF_SCOPE`; `turn.deform` is out of scope) and sends the ops as one `rig` patch (no flag), so it needs the reproduced baseline: none of its pointers is in retune's scope (*Routing*). The producer judges every value and its refusal comes back verbatim as the job's `producerLine`. The turn dial is play's `adjust` on the drawn build's `turn` bone; it is not a patch op and nothing records it. Nothing is written into the package.
|
|
254
256
|
|
package/package.json
CHANGED
package/src/environment.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Inspection-only environment for Animate: a pure wind model (base, breeze, gust),
|
|
3
|
-
* the jolt packet, the drag
|
|
3
|
+
* the jolt packet, the drag impulse and the read-only physics constraint
|
|
4
4
|
* list. Nothing here writes the model or motion; the player stays the only solver.
|
|
5
5
|
*
|
|
6
6
|
* The wind model ports the semantics of the public parts-examples viewer's
|
|
@@ -134,10 +134,18 @@ export function dueJolts(queue:readonly JoltStep[],now:number):{due:JoltStep[];p
|
|
|
134
134
|
due.sort((a,b)=>a.at-b.at);return {due,pending};
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
|
|
137
|
+
/**
|
|
138
|
+
* The drag impulse (#331), the Family viewer's tuning as written (rig-c/examples `family/viewer/index.html`, the stage's
|
|
139
|
+
* `pointermove`): the camera follows the pointer, and on the same move every player gets
|
|
140
|
+
* `{x: clamp(dx/scale*.25, 8), y: clamp(-dy/scale*.25, 6)}`. The factor and the two limits are that demo's choice, taken
|
|
141
|
+
* as they stand rather than derived; the clamp is symmetric (±limit) and applies per move.
|
|
142
|
+
*/
|
|
143
|
+
export const DRAG_IMPULSE=Object.freeze({factor:.25,limitX:8,limitY:6});
|
|
144
|
+
/** One pointer move (page px, y down) as `player.moved` wants it: ÷ the root's scale, y negated (world y up), the demo's factor and clamps. */
|
|
145
|
+
export function dragImpulse(dx:number,dy:number,scale:number):{x:number;y:number}|null {
|
|
139
146
|
if(!Number.isFinite(dx)||!Number.isFinite(dy)||!Number.isFinite(scale)||scale<=0)return null;
|
|
140
|
-
|
|
147
|
+
const clamp=(v:number,limit:number)=>Math.max(-limit,Math.min(limit,v))||0;
|
|
148
|
+
return {x:clamp(dx/scale*DRAG_IMPULSE.factor,DRAG_IMPULSE.limitX),y:clamp(-dy/scale*DRAG_IMPULSE.factor,DRAG_IMPULSE.limitY)};
|
|
141
149
|
}
|
|
142
150
|
|
|
143
151
|
/** Columns read as the compiled model declares them; an absent field stays absent. */
|
package/src/front.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function frontRoute(mode:'single'|'compare',method:string,path:string):Ro
|
|
|
55
55
|
const session=mode==='single'?'/api/session':'/api/compare/session',strip=mode==='single'?'/api/strip':'/api/compare/strip';
|
|
56
56
|
if(path===session)return read?get:method==='PUT'?{mutation:true,limit:1024*1024,timeoutMs:30000,control:false}:null;
|
|
57
57
|
if(path===strip)return method==='POST'?{mutation:true,limit:1024*1024,timeoutMs:120000,control:false}:null;
|
|
58
|
-
const reads=mode==='single'?['/api/review','/review-reference']:['/api/compare','/api/compare/reference-frames','/compare-reference'];
|
|
58
|
+
const reads=mode==='single'?['/api/review','/review-reference','/review-painting']:['/api/compare','/api/compare/reference-frames','/compare-reference'];
|
|
59
59
|
if(reads.includes(path))return read?get:null;
|
|
60
60
|
if((mode==='single'?/^\/assets\/[^/]/:/^\/compare-assets\/(a|b)\/[^/]/).test(path))return read?get:null;
|
|
61
61
|
// Apply · Rebuild and producer checks: un-prefixed in single mode, side-scoped (/api/compare/(a|b)/*, /compare-rebuild/(a|b)/*) in compare mode (#234).
|
package/src/handoff.ts
CHANGED
|
@@ -16,6 +16,11 @@
|
|
|
16
16
|
* config, so this is a location rule bounded by the build's own files, not a proof: the session baseline (the producer
|
|
17
17
|
* rebuilding the inspected rig from that config) is the check. Discovered there, or declared with `--config` at exactly
|
|
18
18
|
* one of those two files, the handoff's root is that file's folder and the parts directory is the build root.
|
|
19
|
+
*
|
|
20
|
+
* #329: a discovered handoff knows its source painting by one fixed name beside the config it found, `painting.png`
|
|
21
|
+
* (so `../painting.png` beside an opened `out/`, `../../painting.png` beside a build root), never by a search. It is
|
|
22
|
+
* held to the config's own refusals at that place — inside the same root, and at the two places outside the opened
|
|
23
|
+
* folder no symlink at all — and when present it is the record's `source` like a declared one.
|
|
19
24
|
*/
|
|
20
25
|
import { createHash } from 'node:crypto';
|
|
21
26
|
import { lstat, readdir, readFile, realpath, stat } from 'node:fs/promises';
|
|
@@ -34,6 +39,8 @@ export const CONFIG_NAMED_FILES = [['motion', 'animations_from'], ['generation',
|
|
|
34
39
|
/** What `rig-parts rig` writes into its --out and remesh reads from --rig: the rig spec, its motion, the mesh report and the part images. */
|
|
35
40
|
export const RIG_FILES = ['rig.json', 'motion.json', 'mesh_report.json'] as const;
|
|
36
41
|
const MAX_LISTED = 4096;
|
|
42
|
+
/** #329: the fixed name a discovered handoff's source painting has beside its config. */
|
|
43
|
+
export const DISCOVERED_PAINTING = 'painting.png';
|
|
37
44
|
|
|
38
45
|
export interface HandoffDeclaration { config: string; parts?: string; source?: string; full?: string; head?: string; keypoints?: string }
|
|
39
46
|
export type HandoffFlags = HandoffDeclaration;
|
|
@@ -127,6 +134,18 @@ async function blockPath(root: string, value: unknown, field: string, kind: 'fil
|
|
|
127
134
|
return contained(root, join(root, value), field, kind, true);
|
|
128
135
|
}
|
|
129
136
|
|
|
137
|
+
/**
|
|
138
|
+
* #329: the painting beside a discovered config — `field` is the config's own place with its file name swapped — or
|
|
139
|
+
* undefined when nothing is there. `strict` (a place outside the opened folder) refuses any symlink, as for the config.
|
|
140
|
+
*/
|
|
141
|
+
async function discoveredPainting(base: string, config: string, configField: string, strict: boolean): Promise<string | undefined> {
|
|
142
|
+
const path = join(dirname(config), DISCOVERED_PAINTING), field = posix.join(posix.dirname(configField), DISCOVERED_PAINTING);
|
|
143
|
+
if (!(await exists(path))) return undefined;
|
|
144
|
+
const real = await contained(base, path, field, 'file', true);
|
|
145
|
+
if (strict && real !== path) throw new HandoffError('HANDOFF_SYMLINK_ESCAPE', field, `${path} is a symlink; only the file beside the config is discovered`);
|
|
146
|
+
return real;
|
|
147
|
+
}
|
|
148
|
+
|
|
130
149
|
/** `producer: {config, parts?, source?, full?, head?, keypoints?}` — strings only, no other key. Paths are checked at load. */
|
|
131
150
|
export function parseHandoffDeclaration(value: unknown): HandoffDeclaration | undefined {
|
|
132
151
|
if (value === undefined) return undefined;
|
|
@@ -241,7 +260,8 @@ export async function resolveHandoff(root: string, declared: HandoffDeclaration
|
|
|
241
260
|
const path = join(root, name);
|
|
242
261
|
if (!(await exists(path))) continue;
|
|
243
262
|
const config = await contained(root, path, name, 'file', true);
|
|
244
|
-
|
|
263
|
+
const source = await discoveredPainting(root, path, name, false);
|
|
264
|
+
return { handoff: await record(root, root, 'discovered', 'discovery', config, join(dirname(path), 'out'), { source }, false), reason: null };
|
|
245
265
|
}
|
|
246
266
|
// #149: the check package of a rig-parts build root — the build's own config, in the build root, else beside it.
|
|
247
267
|
const build = await buildPlaces(root);
|
|
@@ -250,7 +270,8 @@ export async function resolveHandoff(root: string, declared: HandoffDeclaration
|
|
|
250
270
|
if (!(await exists(place.config))) continue;
|
|
251
271
|
const config = await contained(place.base, place.config, place.field, 'file', true);
|
|
252
272
|
if (config !== place.config) throw new HandoffError('HANDOFF_SYMLINK_ESCAPE', place.field, `${place.config} is a symlink; only the build's own config file is discovered`);
|
|
253
|
-
|
|
273
|
+
const source = await discoveredPainting(place.base, config, place.field, true);
|
|
274
|
+
return { handoff: await record(root, place.base, 'discovered', 'discovery', config, build.build, { source }, false), reason: null };
|
|
254
275
|
}
|
|
255
276
|
return { handoff: null, reason: BUILD_MODELING_INPUT_UNAVAILABLE };
|
|
256
277
|
}
|
|
@@ -260,7 +281,8 @@ export async function resolveHandoff(root: string, declared: HandoffDeclaration
|
|
|
260
281
|
if (await exists(path)) {
|
|
261
282
|
const config = await contained(parent, path, '../config.json', 'file', true);
|
|
262
283
|
if (config !== path) throw new HandoffError('HANDOFF_SYMLINK_ESCAPE', '../config.json', `${path} is a symlink; only the file beside out/ is discovered`);
|
|
263
|
-
|
|
284
|
+
const source = await discoveredPainting(parent, config, '../config.json', true);
|
|
285
|
+
return { handoff: await record(root, parent, 'discovered', 'discovery', config, root, { source }, false), reason: null };
|
|
264
286
|
}
|
|
265
287
|
}
|
|
266
288
|
return { handoff: null, reason: MODELING_INPUT_UNAVAILABLE };
|
package/src/manifest.ts
CHANGED
|
@@ -28,7 +28,9 @@ export interface ReviewPackage { referenceHashes?:Record<string,string>; root: s
|
|
|
28
28
|
/** #187: the rig-parts build root ({@link isBuildRoot}) whose `check/` this package is, however it was opened; review state stays outside it. */
|
|
29
29
|
buildRoot?: string;
|
|
30
30
|
/** #305: viewer-only open (`--view-only`). */
|
|
31
|
-
viewOnly?: boolean
|
|
31
|
+
viewOnly?: boolean;
|
|
32
|
+
/** #329: the handoff's source painting, served at a fixed route by its pinned hash; absent when the handoff knows none. */
|
|
33
|
+
sourcePainting?: SourcePainting }
|
|
32
34
|
function fail(field: string, expected: string): never { throw new Error(`${field}: expected ${expected}`); }
|
|
33
35
|
export function object(value: unknown, field: string): Record<string, unknown> { if (!value || typeof value !== 'object' || Array.isArray(value)) fail(field, 'object'); return value as Record<string, unknown>; }
|
|
34
36
|
export function string(value: unknown, field: string): string { if (typeof value !== 'string' || !value.trim() || value.length > 10000) fail(field, 'nonempty string (at most 10000 characters)'); return value; }
|
|
@@ -106,21 +108,42 @@ export async function loadReview(input: string, options: { handoff?: HandoffFlag
|
|
|
106
108
|
for(const j of joints) if(j.parent&&!joints.some(v=>v.id===j.parent&&v.id!==j.id)) fail(`pose ${r.id} joint ${j.id}.parent`,'another declared joint id');
|
|
107
109
|
}
|
|
108
110
|
const reportPath=files.has('report.json')?'report.json':authoringPath('report.json');let report:ReportSeeds|null=null;let modelMetadata:Record<string,unknown>|null=null;
|
|
111
|
+
// The handoff files are hashed beside the package: their record joins the reviewed identity (and so the session file).
|
|
112
|
+
const {handoff,reason:handoffReason}=await resolveHandoff(root,manifest.producer,options.handoff);
|
|
113
|
+
// #329: the source painting the handoff knows is the first reference, outside the package's own files.
|
|
114
|
+
const painting=sourcePainting(manifest,handoff,directory);
|
|
109
115
|
const hash = createHash('sha256');hash.update(JSON.stringify(manifest));hash.update('\0');const fileHashes=new Map<string,string>();
|
|
110
116
|
for(const p of [...files].sort()) { const full=await safeFile(root,p); const before=await stat(full); hash.update(p);hash.update('\0');hash.update(String(before.size));hash.update('\0'); const fileHash=createHash('sha256');const metadataChunks:Buffer[]=[];for await(const chunk of createReadStream(full)){hash.update(chunk);fileHash.update(chunk);if(p===reportPath||p===manifest.model)metadataChunks.push(chunk);}fileHashes.set(p,fileHash.digest('hex')); const after=await stat(full); if(before.size!==after.size||before.mtimeMs!==after.mtimeMs) throw new Error(`Asset ${p} changed while hashing; retry with stable package inputs`);
|
|
111
117
|
// The parser and package hash consume the same bytes, never two file reads.
|
|
112
118
|
if(p===manifest.model){if(fileHashes.get(p)!==modelBytesHash)throw new Error(`Model ${p} changed while hashing; retry with stable package inputs`);modelMetadata=object(JSON.parse(Buffer.concat(metadataChunks).toString('utf8')),'model');}
|
|
113
119
|
if(p===reportPath){let value:unknown;try{value=JSON.parse(Buffer.concat(metadataChunks).toString('utf8'));}catch(e){throw new Error(`${p}: ${e instanceof Error?e.message:String(e)}`);}report=parseReport(value,p);}
|
|
114
120
|
}
|
|
115
|
-
|
|
116
|
-
const {handoff,reason:handoffReason}=await resolveHandoff(root,manifest.producer,options.handoff);
|
|
121
|
+
if(painting){hash.update(SOURCE_PAINTING_ID);hash.update('\0');hash.update(painting.sha256);hash.update('\0');}
|
|
117
122
|
// #192: the root is `check/` whether the folder or its review.json was opened, so the build root is kept either way.
|
|
118
123
|
const buildRoot=basename(root)==='check'&&await isBuildRoot(dirname(root))?dirname(root):undefined;
|
|
119
124
|
const reviewedSource:ReviewedSource={packageRevision:manifest.revision,...await toolVersions(),rig:rigPath?{path:rigPath,sha256:fileHashes.get(rigPath)!}:null,motion:motionPath?{path:motionPath,sha256:fileHashes.get(motionPath)!}:null,...(handoff?{handoff:handoff.record}:{})};
|
|
120
125
|
const feedbackCatalog:FeedbackCatalog={rig:manifest.id,bones:modelNames(modelMetadata,'bones'),slots:modelNames(modelMetadata,'slots'),animations:modelAnimations(modelMetadata),clock:report?.clock??null,clockAnimation:report?.animation??null,...(discoverTurnDials(modelMetadata).length?{turnDials:discoverTurnDials(modelMetadata)}:{})};
|
|
121
|
-
return {referenceHashes:Object.fromEntries(manifest.references.map(r=>[r.id,fileHashes.get(r.path)!])),root,manifestPath,manifest,sourceHash:hash.digest('hex'),reviewedSource,files,report,feedbackCatalog,handoff,handoffReason,...(handoff?.flags?{handoffInputs:handoff.flags}:{}),...(buildRoot?{buildRoot}:{})};
|
|
126
|
+
return {referenceHashes:Object.fromEntries(manifest.references.map(r=>[r.id,r.id===painting?.id?painting.sha256:fileHashes.get(r.path)!])),root,manifestPath,manifest,sourceHash:hash.digest('hex'),reviewedSource,files,report,feedbackCatalog,handoff,handoffReason,...(handoff?.flags?{handoffInputs:handoff.flags}:{}),...(buildRoot?{buildRoot}:{}),...(painting?{sourcePainting:painting}:{})};
|
|
122
127
|
}
|
|
123
128
|
|
|
129
|
+
/** #329: the reference id and served path of the handoff's source painting; the path is a name, never a package file. */
|
|
130
|
+
export const SOURCE_PAINTING_ID='source-painting';
|
|
131
|
+
export const SOURCE_PAINTING_PATH='__review_source_painting__.png';
|
|
132
|
+
export interface SourcePainting {id:string;path:string;sha256:string}
|
|
133
|
+
/**
|
|
134
|
+
* #329: when the handoff knows the source painting (declared `source`, or `painting.png` beside a discovered config),
|
|
135
|
+
* it becomes the first reference, labelled as the original, and — for the folder adapter, whose checkpoints are one per
|
|
136
|
+
* reference — the first checkpoint, so it is the reference selected on open. The manifest is changed in place before it
|
|
137
|
+
* is hashed; with no painting nothing is added. `path` is the handoff record's own display path.
|
|
138
|
+
*/
|
|
139
|
+
function sourcePainting(manifest:ReviewManifest,handoff:Handoff|null,folder:boolean):SourcePainting|null{
|
|
140
|
+
const record=handoff?.record.source;if(!record)return null;
|
|
141
|
+
if(manifest.references.some(r=>r.id===SOURCE_PAINTING_ID)||manifest.checkpoints.some(c=>c.id===SOURCE_PAINTING_ID))fail(`references ${SOURCE_PAINTING_ID}`,'an id the handoff source painting does not take');
|
|
142
|
+
const reference:Reference={id:SOURCE_PAINTING_ID,label:'Original painting · '+posix.basename(record.path),type:'image',path:SOURCE_PAINTING_PATH};
|
|
143
|
+
manifest.references.unshift(reference);
|
|
144
|
+
if(folder)manifest.checkpoints.unshift({id:reference.id,title:'Inspect '+reference.label,reference:reference.id,workspace:'motion'});
|
|
145
|
+
return {id:reference.id,path:record.path,sha256:record.sha256};
|
|
146
|
+
}
|
|
124
147
|
/**
|
|
125
148
|
* #149: the `check/` package of a rig-parts build root ({@link isBuildRoot}), when the folder has neither of the two
|
|
126
149
|
* adapter model paths itself (a folder that does keeps opening as before). Fixed names, no search.
|
package/src/server.ts
CHANGED
|
@@ -122,7 +122,7 @@ export async function startServer(p:ReviewPackage,options:{port?:number;stateDir
|
|
|
122
122
|
return new Response(result.png?new Uint8Array(result.png):stripJson(result),{headers:{...headers,'Content-Type':result.png?'image/png':'application/json; charset=utf-8','Content-Disposition':`attachment; filename="review-strip.${result.png?'png':'json'}"`}});
|
|
123
123
|
}
|
|
124
124
|
if(req.method!=='GET'&&req.method!=='HEAD')return json({error:'Method not allowed'},405);
|
|
125
|
-
if(url.pathname==='/api/review'){await unchanged();return json({manifest:p.manifest,initialAnimation:options.initialAnimation??null,sourceHash:p.sourceHash,reviewedSource:p.reviewedSource,...(referenceBinding(p)?{referenceBinding:referenceBinding(p),explicitReference:{...referenceBinding(p)!.reference,url:'/review-reference'}}:{}),referenceHashes:{...p.referenceHashes,...(referenceBinding(p)?{[referenceBinding(p)!.reference.id]:referenceBinding(p)!.reference.sha256}:{})},report:p.report,feedbackCatalog:p.feedbackCatalog,assetsBase:'/assets/',capabilities:{playback:!!p.manifest.model,modeling:false,motion:false,feedback:true,audio:true}});}
|
|
125
|
+
if(url.pathname==='/api/review'){await unchanged();return json({manifest:p.manifest,initialAnimation:options.initialAnimation??null,sourceHash:p.sourceHash,reviewedSource:p.reviewedSource,...(referenceBinding(p)?{referenceBinding:referenceBinding(p),explicitReference:{...referenceBinding(p)!.reference,url:'/review-reference'}}:{}),...(p.sourcePainting?{sourcePainting:{...p.sourcePainting,url:'/review-painting'}}:{}),referenceHashes:{...p.referenceHashes,...(referenceBinding(p)?{[referenceBinding(p)!.reference.id]:referenceBinding(p)!.reference.sha256}:{})},report:p.report,feedbackCatalog:p.feedbackCatalog,assetsBase:'/assets/',capabilities:{playback:!!p.manifest.model,modeling:false,motion:false,feedback:true,audio:true}});}
|
|
126
126
|
if(url.pathname==='/api/session'){await unchanged();return json(await readSession(p,options.stateDir));}
|
|
127
127
|
if(url.pathname==='/api/rebuild')return json(await rebuilds.describe());
|
|
128
128
|
if(url.pathname==='/api/rebuild/history')return json(await rebuilds.history());
|
|
@@ -149,6 +149,8 @@ export async function startServer(p:ReviewPackage,options:{port?:number;stateDir
|
|
|
149
149
|
const file=Bun.file(full);return new Response(req.method==='HEAD'?null:file,{headers:{...headers,'Content-Security-Policy':"default-src 'none'; script-src 'none'; sandbox",'Content-Type':file.type||'application/octet-stream','Content-Length':String(file.size)}});
|
|
150
150
|
}
|
|
151
151
|
if(url.pathname==='/review-reference')return await serveReference(req,await safeSelectedReference(p),referenceBinding(p)!.reference.sha256,headers);
|
|
152
|
+
// #329: the handoff's source painting sits outside the package, so it is served by its pinned hash at one fixed route.
|
|
153
|
+
if(url.pathname==='/review-painting'&&p.sourcePainting&&p.handoff?.source)return await serveReference(req,p.handoff.source,p.sourcePainting.sha256,headers);
|
|
152
154
|
if(url.pathname.startsWith('/assets/')){
|
|
153
155
|
const path=packagePath(decodeURIComponent(url.pathname.slice('/assets/'.length)));if(!p.files.has(path))return json({error:'Asset not declared by package'},404);
|
|
154
156
|
const file=Bun.file(await safeFile(p.root,path));const size=file.size;
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
import type {AppliedAnimation} from '../src/applied-context.ts';
|
|
29
29
|
import {sourceTextContent} from './i18n.ts';
|
|
30
30
|
import type {AnimationSourceView} from './rebuild-client.ts';
|
|
31
|
+
import {bindStagePick,domHoverPainter,type StagePick} from './stage-pick.ts';
|
|
31
32
|
import {InspectionSelection} from './inspection-selection.ts';
|
|
32
33
|
import {animationPreviewAdjust} from './preview.ts';
|
|
33
34
|
|
|
@@ -96,16 +97,6 @@ export interface AnimationSideState {
|
|
|
96
97
|
zoom:number;
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
/** All picking reads the last drawn primitives, including their resolved clip; never a setup bounding box. */
|
|
100
|
-
export function pickedSlot(frame:PosedFrame,x:number,y:number):string|null {
|
|
101
|
-
const inside=(p:readonly number[])=>{let hit=false;for(let i=0,j=p.length-2;i<p.length;j=i,i+=2){const ax=p[i]!,ay=p[i+1]!,bx=p[j]!,by=p[j+1]!;if((ay>y)!==(by>y)&&x<(bx-ax)*(y-ay)/(by-ay)+ax)hit=!hit;}return hit;};
|
|
102
|
-
for(const row of [...frame.order].reverse()){
|
|
103
|
-
if(row.clip&&inside(row.clip.polygon)===row.clip.inverse)continue;
|
|
104
|
-
if(row.kind==='region'&&inside(row.corners))return row.slot;
|
|
105
|
-
if(row.kind==='mesh')for(let i=0;i<row.triangles.length;i+=3){const p=row.triangles.slice(i,i+3).flatMap(v=>[row.vertices[v*2]!,row.vertices[v*2+1]!]);if(inside(p))return row.slot;}
|
|
106
|
-
}return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
100
|
export const ANIMATION_APPLY_ISOLATION_NOTE =
|
|
110
101
|
'An animation Apply builds from the handoff config.json and animations_from file into scratch (rig-parts rig → rigc build → rig-parts check), so it does not carry another kind\'s Apply on the stage.';
|
|
111
102
|
|
|
@@ -151,8 +142,8 @@ export class AnimationInspectionPanel {
|
|
|
151
142
|
private picks:HTMLElement;
|
|
152
143
|
private bones=new Map<string,{x:number;y:number;a:number;b:number;c:number;d:number;hasMatrix:boolean}>();
|
|
153
144
|
private frame:PosedFrame|null=null;
|
|
154
|
-
private down:{x:number;y:number}|null=null;
|
|
155
145
|
private space=false;
|
|
146
|
+
private stagePick:StagePick|null=null;
|
|
156
147
|
private disposers:(()=>void)[]=[];
|
|
157
148
|
private boneButtons=new Map<string,HTMLButtonElement>();
|
|
158
149
|
private bonePoints=false;
|
|
@@ -331,12 +322,11 @@ export class AnimationInspectionPanel {
|
|
|
331
322
|
this.easeSelect.onchange=()=>{this.applyCurveModeChange(this.easeSelect.value);};
|
|
332
323
|
this.bindCurveHandleDrag();
|
|
333
324
|
this.picks=document.createElement('div');this.picks.className='animation-stage-picks';stage.append(this.picks);
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
};
|
|
325
|
+
// #330: the click and the hover preview are one hit test (web/stage-pick.ts `pickAt`); the panel only supplies its state.
|
|
326
|
+
this.stagePick=bindStagePick({stage,project:(x,y)=>options.project(x,y),frame:()=>this.frame,enabled:()=>options.enabled(),held:()=>this.space,
|
|
327
|
+
selectable:slot=>this.has({kind:'slot',name:slot}),select:slot=>this.select({kind:'slot',name:slot}),paint:domHoverPainter(this.picks)});
|
|
338
328
|
const key=(e:KeyboardEvent)=>{
|
|
339
|
-
if(e.code==='Space')this.space=e.type==='keydown';
|
|
329
|
+
if(e.code==='Space'){this.space=e.type==='keydown';this.stagePick?.refresh();}
|
|
340
330
|
if(e.type==='keydown'&&(e.key==='Delete'||e.key==='Backspace')&&!this.isBusy){
|
|
341
331
|
const active=document.activeElement as Element|null;
|
|
342
332
|
const inField=active&&typeof active.closest==='function'&&active.closest('input,textarea,select');
|
|
@@ -352,9 +342,9 @@ export class AnimationInspectionPanel {
|
|
|
352
342
|
}
|
|
353
343
|
}
|
|
354
344
|
};
|
|
355
|
-
const blur=()=>{this.space=false;this.
|
|
356
|
-
|
|
357
|
-
this.disposers.push(()=>{
|
|
345
|
+
const blur=()=>{this.space=false;this.stagePick?.reset();};
|
|
346
|
+
window.addEventListener('keydown',key);window.addEventListener('keyup',key);window.addEventListener('blur',blur);
|
|
347
|
+
this.disposers.push(()=>{this.stagePick?.dispose();window.removeEventListener('keydown',key);window.removeEventListener('keyup',key);window.removeEventListener('blur',blur);});
|
|
358
348
|
|
|
359
349
|
if(typeof ResizeObserver!=='undefined'&&typeof host.closest==='function'){
|
|
360
350
|
const playbackPanel=host.closest<HTMLElement>('[data-inspector-panel]');
|
|
@@ -2839,6 +2829,7 @@ export class AnimationInspectionPanel {
|
|
|
2839
2829
|
stage.dataset.selectedName=selected?.name??'';
|
|
2840
2830
|
const enabled=this.options.enabled();
|
|
2841
2831
|
this.picks.hidden=!enabled;
|
|
2832
|
+
this.stagePick?.refresh();
|
|
2842
2833
|
const otherMode:'rotate'|'translate'=this.poseMode==='rotate'?'translate':'rotate';
|
|
2843
2834
|
let order=0;
|
|
2844
2835
|
for(const [name,p]of this.bones){
|
package/web/catalog-en.ts
CHANGED
|
@@ -634,9 +634,7 @@ export const enCatalog: Readonly<Record<string, string>> = {
|
|
|
634
634
|
"Drag bone handles on stage to translate (hold Alt during drag to rotate)": "Drag bone handles on stage to translate (hold Alt during drag to rotate)",
|
|
635
635
|
"Drag on stage": "Drag on stage",
|
|
636
636
|
"Drag to pan · scroll to zoom · cameras synchronized": "Drag to pan · scroll to zoom · cameras synchronized",
|
|
637
|
-
"
|
|
638
|
-
"Drag to trail: dragging the rig pane tells the physics the rig moved; the camera stays. Hold Space to pan. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.": "Drag to trail: dragging the rig pane tells the physics the rig moved; the camera stays. Hold Space to pan. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.",
|
|
639
|
-
"Dragging the rig pane moves the rig's physics instead of the camera. Hold Space to pan.": "Dragging the rig pane moves the rig's physics instead of the camera. Hold Space to pan.",
|
|
637
|
+
"Dragging the rig pane pans the camera and tells the physics the rig moved, so hair and cloth trail; a click that does not move still selects a part. Hold Space to pan only. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.": "Dragging the rig pane pans the camera and tells the physics the rig moved, so hair and cloth trail; a click that does not move still selects a part. Hold Space to pan only. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.",
|
|
640
638
|
"Draw polygon": "Draw polygon",
|
|
641
639
|
"Drawn": "Drawn",
|
|
642
640
|
"Drawn late": "Drawn late",
|
|
@@ -1035,6 +1033,7 @@ export const enCatalog: Readonly<Record<string, string>> = {
|
|
|
1035
1033
|
"Ordered compare provenance:": "Ordered compare provenance:",
|
|
1036
1034
|
"Original identifiers: {0}": "Original identifiers: {0}",
|
|
1037
1035
|
"Original input pose sequence · joint states and confidence preserved": "Original input pose sequence · joint states and confidence preserved",
|
|
1036
|
+
"Original painting": "Original painting",
|
|
1038
1037
|
"Original set": "Original set",
|
|
1039
1038
|
"Other bones": "Other bones",
|
|
1040
1039
|
"Output folder: no recognized skeleton.*, build/skeleton.model.json, rig-parts build root (check/build/skeleton.model.json), motion.json, report.json, source video, pose sequence or contact strip": "Output folder: no recognized skeleton.*, build/skeleton.model.json, rig-parts build root (check/build/skeleton.model.json), motion.json, report.json, source video, pose sequence or contact strip",
|
package/web/catalog-ko.ts
CHANGED
|
@@ -634,9 +634,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
634
634
|
"Drag bone handles on stage to translate (hold Alt during drag to rotate)": "스테이지에서 본 핸들을 드래그하여 이동 (드래그 중 Alt를 누르면 회전)",
|
|
635
635
|
"Drag on stage": "스테이지에서 드래그",
|
|
636
636
|
"Drag to pan · scroll to zoom · cameras synchronized": "드래그하여 이동 · 스크롤하여 확대/축소 · 카메라 동기화됨",
|
|
637
|
-
"
|
|
638
|
-
"Drag to trail: dragging the rig pane tells the physics the rig moved; the camera stays. Hold Space to pan. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.": "드래그 트레일: 리그 창을 드래그하면 카메라는 고정된 채 리그가 이동한 것으로 물리에 전달됩니다. Space를 누른 채 드래그하면 화면을 이동합니다. 초기화는 런타임 시작 값으로 되돌리고 물리 히스토리를 지운 뒤 현재 시간부터 다시 포즈를 잡습니다.",
|
|
639
|
-
"Dragging the rig pane moves the rig's physics instead of the camera. Hold Space to pan.": "리그 창을 드래그하면 카메라 대신 리그의 물리가 움직입니다. Space를 누른 채 드래그하면 화면을 이동합니다.",
|
|
637
|
+
"Dragging the rig pane pans the camera and tells the physics the rig moved, so hair and cloth trail; a click that does not move still selects a part. Hold Space to pan only. Reset returns the runtime start values and re-poses from the current time, clearing the physics history.": "리그 창을 드래그하면 화면이 이동하면서 리그가 움직인 것으로 물리에 전달되어 머리카락과 옷이 뒤따라 흔들립니다. 움직이지 않은 클릭은 그대로 파트를 선택합니다. Space를 누른 채 드래그하면 화면만 이동합니다. 초기화는 런타임 시작 값으로 되돌리고 물리 히스토리를 지운 뒤 현재 시간부터 다시 포즈를 잡습니다.",
|
|
640
638
|
"Draw polygon": "다각형 그리기",
|
|
641
639
|
"Drawn": "그려짐",
|
|
642
640
|
"Drawn late": "지연 그려짐",
|
|
@@ -1035,6 +1033,7 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
1035
1033
|
"Ordered compare provenance:": "순서가 지정된 비교 출처:",
|
|
1036
1034
|
"Original identifiers: {0}": "원본 식별자: {0}",
|
|
1037
1035
|
"Original input pose sequence · joint states and confidence preserved": "원본 입력 포즈 시퀀스 · 관절 상태 및 신뢰도 보존됨",
|
|
1036
|
+
"Original painting": "원본 그림",
|
|
1038
1037
|
"Original set": "원본 세트",
|
|
1039
1038
|
"Other bones": "기타 본",
|
|
1040
1039
|
"Output folder: no recognized skeleton.*, build/skeleton.model.json, rig-parts build root (check/build/skeleton.model.json), motion.json, report.json, source video, pose sequence or contact strip": "출력 폴더: 인식된 skeleton.*, build/skeleton.model.json, rig-parts 빌드 루트(check/build/skeleton.model.json), motion.json, report.json, 소스 비디오, 포즈 시퀀스 또는 컨택트 스트립이 없습니다",
|
|
@@ -57,7 +57,7 @@ import { appliedBuildOwner, appliedPanelOps, dropNoticeForPanel, reconcilePanelS
|
|
|
57
57
|
import { compareSeekStep } from '../src/compare-playhead.ts';
|
|
58
58
|
import { composeAdjust, PhysicsPreview } from './preview.ts';
|
|
59
59
|
import {
|
|
60
|
-
createWindModel, environmentFor, windReadout, RUNTIME_START_READOUT, joltPacket, dueJolts,
|
|
60
|
+
createWindModel, environmentFor, windReadout, RUNTIME_START_READOUT, joltPacket, dueJolts,
|
|
61
61
|
loadModelDocument, environmentContext, environmentJson, type JoltStep, type WindSnapshot, type WindState,
|
|
62
62
|
} from '../src/environment.ts';
|
|
63
63
|
import { environmentCheckRows, restartsWindClock, scheduleContext, worldExport, type ClipMove, type EnvironmentCheckView, type WorldExport } from './environment-world.ts';
|
|
@@ -2116,7 +2116,7 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
|
|
|
2116
2116
|
}
|
|
2117
2117
|
|
|
2118
2118
|
function bindEnvironmentControls(): void {
|
|
2119
|
-
const environmentInputs = ['wind-base', 'wind-breeze', 'wind-gust', 'wind-repeat', 'wind-gust-peak', 'wind-gust-duration', 'gravity', 'jolt', '
|
|
2119
|
+
const environmentInputs = ['wind-base', 'wind-breeze', 'wind-gust', 'wind-repeat', 'wind-gust-peak', 'wind-gust-duration', 'gravity', 'jolt', 'physics-reset', 'environment-use', 'environment-export', 'environment-check'];
|
|
2120
2120
|
for (const id of environmentInputs) {
|
|
2121
2121
|
const node = document.getElementById(id) as HTMLInputElement | HTMLButtonElement | null;
|
|
2122
2122
|
if (node) node.disabled = false;
|
|
@@ -2174,9 +2174,6 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
|
|
|
2174
2174
|
host.message(`Exported ${w.summary}. The download is the bytes readings, Apply and feedback carry; the package is unchanged.`);
|
|
2175
2175
|
};
|
|
2176
2176
|
button('environment-check').onclick = () => { void runEnvironmentCheck(); };
|
|
2177
|
-
input('drag-trail').onchange = () => {
|
|
2178
|
-
for (const s of ['a', 'b'] as const) el(`${s}-viewport`).dataset.trail = String(s === pickedSide && input('drag-trail').checked);
|
|
2179
|
-
};
|
|
2180
2177
|
}
|
|
2181
2178
|
|
|
2182
2179
|
function onInspectorTabChanged(): void {
|
package/web/compare.css
CHANGED
|
@@ -146,8 +146,8 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
|
|
|
146
146
|
.pane[data-picked=true]{border-color:var(--rv-pressed-border)}
|
|
147
147
|
.inspector-body>[data-inspector-panel]{height:100%;overflow:auto;padding:12px 15px;min-height:0}
|
|
148
148
|
.view-tools{display:flex;gap:4px;flex:none}.view-tool{padding:5px 9px;font-size:11px;white-space:nowrap}
|
|
149
|
-
:root{--rv-region-a:#ff9f43;--rv-region-a-fill:rgba(255,159,67,.18);--rv-region-b:#4dd6ff;--rv-region-b-fill:rgba(77,214,255,.18);--rv-tick-inspected:#7cc8ff;--rv-tick-scratch:#ff9f43;--rv-mesh-region:#ff7ae0;--rv-mesh-region-fill:rgba(255,122,224,.12);--rv-mesh-handle:#ffffff;--rv-bust-r:#00e5ff;--rv-bust-r-fill:rgba(0,229,255,.13);--rv-bust-l:#52ff88;--rv-bust-l-fill:rgba(82,255,136,.13);--rv-bust-overlap:#ff5252;--rv-bust-overlap-fill:rgba(255,82,82,.13);--rv-bust-handle:#ffffff;--rv-bust-ink:#111318;--rv-bust-label-bg:rgba(12,14,18,.82);--rv-bust-flash:#ffcc00;--rv-landmark:#ffd34d;--rv-landmark-fill:#ffd34d;--rv-landmark-ink:#111318;--rv-mesh-veil:rgba(8,10,14,.55);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12);--rv-weight-0:#3d1a78;--rv-weight-half:#e0573a;--rv-weight-1:#fcef6c;--rv-weight-bone-1:#00e5ff;--rv-weight-bone-2:#ff7ae0;--rv-weight-bone-3:#52ff88;--rv-weight-bone-4:#ffb020;--rv-weight-bone-5:#a98bff;--rv-weight-bone-6:#ff5252;--rv-bone-line:#ffe26b;--rv-field-still:#69f1ff;--rv-field-inward:rgba(255,122,224,.28);--rv-field-inward-line:#ff7ae0;--rv-field-outward:rgba(105,241,255,.24);--rv-field-outward-line:#69f1ff;--rv-field-rest:#ffe26b;--rv-field-handle-bg:rgba(12,14,18,.82);--rv-field-ink:#f4f6fa;--rv-bone-origin:#ffe26b;--rv-bone-point:#69f1ff;--rv-bone-tip:#ff7ae0;--rv-bone-pending:#ffb020;--rv-bone-selected:#ffffff;--rv-bone-ink:#111318;--rv-bone-label-bg:rgba(12,14,18,.82)}
|
|
150
|
-
:root[data-theme=light]{--rv-region-a:#ff9f43;--rv-region-a-fill:rgba(255,159,67,.18);--rv-region-b:#4dd6ff;--rv-region-b-fill:rgba(77,214,255,.18);--rv-tick-inspected:#1a6fc0;--rv-tick-scratch:#c25e00;--rv-mesh-region:#c2189b;--rv-mesh-region-fill:rgba(194,24,155,.12);--rv-mesh-handle:#ffffff;--rv-bust-r:#00e5ff;--rv-bust-r-fill:rgba(0,229,255,.13);--rv-bust-l:#52ff88;--rv-bust-l-fill:rgba(82,255,136,.13);--rv-bust-overlap:#ff5252;--rv-bust-overlap-fill:rgba(255,82,82,.13);--rv-bust-handle:#ffffff;--rv-bust-ink:#111318;--rv-bust-label-bg:rgba(12,14,18,.82);--rv-bust-flash:#ffcc00;--rv-landmark:#ffd34d;--rv-landmark-fill:#ffd34d;--rv-landmark-ink:#111318;--rv-mesh-veil:rgba(245,247,251,.6);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12);--rv-weight-0:#3d1a78;--rv-weight-half:#e0573a;--rv-weight-1:#fcef6c;--rv-weight-bone-1:#00e5ff;--rv-weight-bone-2:#ff7ae0;--rv-weight-bone-3:#52ff88;--rv-weight-bone-4:#ffb020;--rv-weight-bone-5:#a98bff;--rv-weight-bone-6:#ff5252;--rv-bone-line:#ffe26b;--rv-field-still:#69f1ff;--rv-field-inward:rgba(255,122,224,.28);--rv-field-inward-line:#ff7ae0;--rv-field-outward:rgba(105,241,255,.24);--rv-field-outward-line:#69f1ff;--rv-field-rest:#ffe26b;--rv-field-handle-bg:rgba(12,14,18,.82);--rv-field-ink:#f4f6fa;--rv-bone-origin:#ffe26b;--rv-bone-point:#69f1ff;--rv-bone-tip:#ff7ae0;--rv-bone-pending:#ffb020;--rv-bone-selected:#ffffff;--rv-bone-ink:#111318;--rv-bone-label-bg:rgba(12,14,18,.82)}
|
|
149
|
+
:root{--rv-hover-pick-line:#ffffff;--rv-hover-pick-halo:rgba(12,14,18,.72);--rv-hover-pick-fill:rgba(255,255,255,.2);--rv-hover-pick-label-bg:rgba(12,14,18,.82);--rv-hover-pick-ink:#f4f6fa;--rv-region-a:#ff9f43;--rv-region-a-fill:rgba(255,159,67,.18);--rv-region-b:#4dd6ff;--rv-region-b-fill:rgba(77,214,255,.18);--rv-tick-inspected:#7cc8ff;--rv-tick-scratch:#ff9f43;--rv-mesh-region:#ff7ae0;--rv-mesh-region-fill:rgba(255,122,224,.12);--rv-mesh-handle:#ffffff;--rv-bust-r:#00e5ff;--rv-bust-r-fill:rgba(0,229,255,.13);--rv-bust-l:#52ff88;--rv-bust-l-fill:rgba(82,255,136,.13);--rv-bust-overlap:#ff5252;--rv-bust-overlap-fill:rgba(255,82,82,.13);--rv-bust-handle:#ffffff;--rv-bust-ink:#111318;--rv-bust-label-bg:rgba(12,14,18,.82);--rv-bust-flash:#ffcc00;--rv-landmark:#ffd34d;--rv-landmark-fill:#ffd34d;--rv-landmark-ink:#111318;--rv-mesh-veil:rgba(8,10,14,.55);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12);--rv-weight-0:#3d1a78;--rv-weight-half:#e0573a;--rv-weight-1:#fcef6c;--rv-weight-bone-1:#00e5ff;--rv-weight-bone-2:#ff7ae0;--rv-weight-bone-3:#52ff88;--rv-weight-bone-4:#ffb020;--rv-weight-bone-5:#a98bff;--rv-weight-bone-6:#ff5252;--rv-bone-line:#ffe26b;--rv-field-still:#69f1ff;--rv-field-inward:rgba(255,122,224,.28);--rv-field-inward-line:#ff7ae0;--rv-field-outward:rgba(105,241,255,.24);--rv-field-outward-line:#69f1ff;--rv-field-rest:#ffe26b;--rv-field-handle-bg:rgba(12,14,18,.82);--rv-field-ink:#f4f6fa;--rv-bone-origin:#ffe26b;--rv-bone-point:#69f1ff;--rv-bone-tip:#ff7ae0;--rv-bone-pending:#ffb020;--rv-bone-selected:#ffffff;--rv-bone-ink:#111318;--rv-bone-label-bg:rgba(12,14,18,.82)}
|
|
150
|
+
:root[data-theme=light]{--rv-hover-pick-line:#ffffff;--rv-hover-pick-halo:rgba(12,14,18,.72);--rv-hover-pick-fill:rgba(255,255,255,.2);--rv-hover-pick-label-bg:rgba(12,14,18,.82);--rv-hover-pick-ink:#f4f6fa;--rv-region-a:#ff9f43;--rv-region-a-fill:rgba(255,159,67,.18);--rv-region-b:#4dd6ff;--rv-region-b-fill:rgba(77,214,255,.18);--rv-tick-inspected:#1a6fc0;--rv-tick-scratch:#c25e00;--rv-mesh-region:#c2189b;--rv-mesh-region-fill:rgba(194,24,155,.12);--rv-mesh-handle:#ffffff;--rv-bust-r:#00e5ff;--rv-bust-r-fill:rgba(0,229,255,.13);--rv-bust-l:#52ff88;--rv-bust-l-fill:rgba(82,255,136,.13);--rv-bust-overlap:#ff5252;--rv-bust-overlap-fill:rgba(255,82,82,.13);--rv-bust-handle:#ffffff;--rv-bust-ink:#111318;--rv-bust-label-bg:rgba(12,14,18,.82);--rv-bust-flash:#ffcc00;--rv-landmark:#ffd34d;--rv-landmark-fill:#ffd34d;--rv-landmark-ink:#111318;--rv-mesh-veil:rgba(245,247,251,.6);--rv-mesh-edge:#69f1ff;--rv-mesh-hull:#ffb020;--rv-mesh-constraint:#ff4fd8;--rv-mesh-removed:#ff5252;--rv-mesh-vertex:#ffffff;--rv-mesh-ink:#111318;--rv-mesh-selected:#ffe14d;--rv-mesh-added:#52ff88;--rv-mesh-hover:#ffffff;--rv-mesh-box:#ffe14d;--rv-mesh-box-fill:rgba(255,225,77,.12);--rv-weight-0:#3d1a78;--rv-weight-half:#e0573a;--rv-weight-1:#fcef6c;--rv-weight-bone-1:#00e5ff;--rv-weight-bone-2:#ff7ae0;--rv-weight-bone-3:#52ff88;--rv-weight-bone-4:#ffb020;--rv-weight-bone-5:#a98bff;--rv-weight-bone-6:#ff5252;--rv-bone-line:#ffe26b;--rv-field-still:#69f1ff;--rv-field-inward:rgba(255,122,224,.28);--rv-field-inward-line:#ff7ae0;--rv-field-outward:rgba(105,241,255,.24);--rv-field-outward-line:#69f1ff;--rv-field-rest:#ffe26b;--rv-field-handle-bg:rgba(12,14,18,.82);--rv-field-ink:#f4f6fa;--rv-bone-origin:#ffe26b;--rv-bone-point:#69f1ff;--rv-bone-tip:#ff7ae0;--rv-bone-pending:#ffb020;--rv-bone-selected:#ffffff;--rv-bone-ink:#111318;--rv-bone-label-bg:rgba(12,14,18,.82)}
|
|
151
151
|
.chest-regions{margin-top:22px;padding-top:15px;border-top:1px solid var(--border)}.chest-regions code{font:11px var(--font-mono)}.chest-grid,.chest-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px}.chest-row{border:1px solid var(--border);border-radius:6px;padding:9px 10px;margin:10px 0 0;min-width:0}.chest-row legend{font-size:11px;color:var(--fg-muted);padding:0 4px}.chest-grid label,.chest-row label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--fg-muted);min-width:0}.chest-row input,.chest-row select,.chest-grid input{width:100%;padding:5px 6px;font-size:11px}.chest-row .chest-check{flex-direction:row;align-items:center;gap:6px}.chest-row .chest-check input{width:auto}.chest-more{margin-top:10px;font-size:11px;color:var(--fg-muted)}.chest-more summary{cursor:pointer}#chest-status.error{color:var(--fail)}
|
|
152
152
|
.chest-editor-bar{position:relative;display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;padding:6px 10px;border-bottom:1px solid var(--border);background:var(--rv-bar);font-size:11px}.chest-editor-bar[hidden]{display:none}.chest-editor-bar input[type=range]{width:84px}.chest-editor-bar input[type=text]{width:104px;padding:3px 5px;font-size:11px}.chest-editor-bar output{min-width:2.6em;font:10px/1 var(--font-mono);color:var(--fg)}.chest-editor-bar [data-landmark][aria-pressed=true]{outline:2px solid var(--rv-landmark);outline-offset:1px}#lm-derived{flex:1 1 100%;order:9;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:10px/1.4 var(--font-mono)}#lm-derived.error{color:var(--fail)}.chest-editor-bar .bust-group{display:flex;align-items:center;gap:6px;padding-left:10px;border-left:1px solid var(--border)}.chest-editor-bar .bust-group:first-child{padding-left:0;border-left:0}.chest-editor-bar label{display:flex;align-items:center;gap:4px;color:var(--fg-muted)}.chest-editor-bar input[type=number]{width:58px;padding:3px 5px;font-size:11px}.chest-editor-bar button{padding:4px 8px;font-size:11px}.chest-editor-bar button[aria-disabled=true]{opacity:.6}.bust-tag{font-weight:700}.bust-tag-r{color:var(--rv-bust-r)}.bust-tag-l{color:var(--rv-bust-l)}#handoff-line{flex:1 1 100%;order:10;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font:10px/1.4 var(--font-mono)}#chest-editor-status{flex:1 1 220px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rebuild-log{position:absolute;top:100%;left:10px;right:10px;z-index:6;margin:4px 0 0;max-height:7.5em;overflow:auto;padding:5px 8px;font:10px/1.5 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;background:var(--code-bg);color:var(--code-fg);border:1px solid var(--border);border-radius:5px}
|
|
153
153
|
.mesh-editor-bar kbd{margin-left:5px;font-size:10px;opacity:.75}#mesh-editor-status{flex:1 1 260px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -263,6 +263,8 @@ main{position:relative}.viewbar,.toolbar{anchor-name:--stage-comment-bar}#stage-
|
|
|
263
263
|
.animation-tree button{margin:2px;padding:3px 7px;font-size:12px}
|
|
264
264
|
[data-part-list] button[data-bone-selected=true]{outline:1px solid var(--pass);outline-offset:-2px}
|
|
265
265
|
.animation-stage-picks{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
|
|
266
|
+
/* #330 hover pick preview: a solid two-tone outline and a faint tint, beside the selection's dashed amber box. */
|
|
267
|
+
.stage-hover-pick{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}.stage-hover-tint{fill:var(--rv-hover-pick-fill);stroke:none}.stage-hover-halo{fill:none;stroke:var(--rv-hover-pick-halo);stroke-width:3.5;stroke-linejoin:round;stroke-linecap:round}.stage-hover-line{fill:none;stroke:var(--rv-hover-pick-line);stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round}.stage-hover-label{position:absolute;z-index:600;max-width:240px;padding:2px 6px;border-radius:4px;background:var(--rv-hover-pick-label-bg);color:var(--rv-hover-pick-ink);font:600 11px var(--font-mono);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
|
|
266
268
|
.animation-bone-pick{position:absolute;width:10px;height:10px;min-width:0;padding:0;transform:translate(-50%,-50%);border-radius:50%;border:1px solid var(--rv-bone-line);background:var(--rv-bone-point);pointer-events:auto;cursor:grab;touch-action:none}
|
|
267
269
|
.animation-bone-pick[data-pose-editable=true]{border-color:var(--pass);background:var(--pass)}
|
|
268
270
|
.animation-bone-pick[aria-pressed=true]{outline:3px solid var(--rv-bone-selected);outline-offset:2px}
|
package/web/compare.ts
CHANGED
|
@@ -14,6 +14,8 @@ import { feedbackLastFrame, feedbackTargetNames, validateFeedbackSelection } fro
|
|
|
14
14
|
import type { StripInterval, StripRequest } from '../src/strip.ts';
|
|
15
15
|
|
|
16
16
|
import {bindAppearance,bindPan,bindStageLayout,bindInspectorTabs,syncStageLayout,idleAvailable} from './view-controls.ts';
|
|
17
|
+
import {CLICK_SLOP_PX} from './stage-pick.ts';
|
|
18
|
+
import {dragImpulse} from '../src/environment.ts';
|
|
17
19
|
import {RigOverlays} from './rig-overlays.ts';
|
|
18
20
|
import {bindWorkspaceUI,type WorkspaceUI} from './workspace-ui.ts';
|
|
19
21
|
import {connectControl} from './control.ts';
|
|
@@ -421,7 +423,10 @@ function bind(): void {
|
|
|
421
423
|
cameraSync=workspace.defaults().defaultCameraSync;input('camera-sync').checked=cameraSync;input('idle-repeat').checked=workspace.defaults().defaultIdleRepeat;
|
|
422
424
|
appearance=bindAppearance(select('appearance'),workspace.defaults().theme);
|
|
423
425
|
for(const side of ['a','b'] as const)overlays[side]=new RigOverlays({canvas:el<HTMLCanvasElement>(side+'-overlay'),rigRoot:el(side+'-root')});
|
|
424
|
-
|
|
426
|
+
// #331: a plain drag on either rig pans and carries both rigs, each by its own root scale, so A and B take the same
|
|
427
|
+
// stimulus; the reference pane only pans, as the Family viewer's does.
|
|
428
|
+
const carryBoth={threshold:CLICK_SLOP_PX,move:(dx:number,dy:number)=>{for(const side of ['a','b'] as const){const impulse=dragImpulse(dx,dy,rigScales[side]);if(impulse)players[side]?.moved(impulse);}}};
|
|
429
|
+
for(const target of ['a','b','reference'] as const)viewDisposers.push(bindPan(el(target+'-viewport'),(dx,dy)=>cameraAction(()=>panCamera(target,dx,dy)),()=>!comments?.active(),target==='reference'?undefined:carryBoth));
|
|
425
430
|
viewDisposers.push(bindStageLayout(el('stage-layout'),fit));
|
|
426
431
|
for(const [id,key] of [['layer-images','images'],['layer-mesh','mesh'],['layer-bones','bones']] as const)input(id).onchange=()=>{layers[key]=input(id).checked;redrawOverlays(false);};
|
|
427
432
|
input('idle-repeat').onchange=()=>{renderIdle();if(canRepeatIdle())void playComparison().catch(error=>message(describe(error),true));};
|
package/web/i18n.ts
CHANGED
|
@@ -573,7 +573,8 @@ function isExemptElement(el: Element | null): boolean {
|
|
|
573
573
|
cls.includes('part-slot-name') ||
|
|
574
574
|
cls.includes('animation-lane-label') ||
|
|
575
575
|
cls.includes('animation-tree-bone-name') ||
|
|
576
|
-
cls.includes('stage-comment-pin')
|
|
576
|
+
cls.includes('stage-comment-pin') ||
|
|
577
|
+
cls.includes('stage-hover-label')
|
|
577
578
|
) {
|
|
578
579
|
return true;
|
|
579
580
|
}
|