cozyclay 2.1.1 → 3.0.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/CHANGELOG.md +60 -0
- package/README.md +12 -30
- package/bin/agent/agent-routes.mjs +40 -113
- package/bin/agent/agent-runner.mjs +9 -10
- package/bin/agent/cliproxy-provider.mjs +135 -0
- package/bin/agent/credential-store.mjs +30 -7
- package/bin/agent/pi-tools.mjs +4 -1
- package/bin/agent/provider-keys.mjs +32 -0
- package/bin/agent/provider-login.mjs +110 -0
- package/bin/agent/provider-routes.mjs +99 -0
- package/bin/agent/providers.mjs +19 -97
- package/bin/agent/script-tool.mjs +17 -4
- package/bin/agent/studio-motion-reference.mjs +23 -0
- package/bin/agent/studio-prompt.mjs +1 -1
- package/bin/agent/studio-rebase-text.mjs +32 -0
- package/bin/agent/studio-rebase.mjs +26 -39
- package/bin/agent/studio-tools.mjs +9 -28
- package/bin/agent/tool-arguments.mjs +49 -0
- package/bin/agent/turn-frames.mjs +66 -0
- package/bin/codex-auth.mjs +9 -2
- package/bin/cozyclay.mjs +10 -116
- package/bin/live/cli.mjs +3 -3
- package/bin/mcp-runtime.mjs +2 -12
- package/bin/package-signature.mjs +0 -4
- package/dist/app/index.html +7 -6
- package/dist/assets/EXRLoader-CvVIvGVE.js +1 -0
- package/dist/assets/analytics-C9sUnndd.js +1 -0
- package/dist/assets/app-CCh--1Hc.js +5087 -0
- package/dist/assets/app-f-fkV5uP.css +1 -0
- package/dist/assets/compile-worker-CkxiD6lH.js +5 -0
- package/dist/assets/fflate.module-KbGj5-H6.js +5 -0
- package/dist/assets/{first-shot-handoff-msLI71g1.js → first-shot-handoff-CC4xe4HM.js} +1 -1
- package/dist/assets/{landing-ChUvB_zL.js → landing-DjHD8u7k.js} +1 -1
- package/dist/assets/scene-asset-sync-Hx_FzdOH.js +20 -0
- package/dist/assets/scene-asset-sync-_S8NQl5B.css +1 -0
- package/dist/assets/workflow-C4yKH1p4.js +179 -0
- package/dist/cozyclay-package.json +1 -1
- package/dist/index.html +3 -3
- package/dist/sw.js +3 -6
- package/dist/workflow/index.html +5 -4
- package/mcp/LIVE-PROTOCOL.md +7 -47
- package/mcp/README.md +16 -26
- package/mcp/live-hub.mjs +6 -10
- package/mcp/package.json +1 -3
- package/mcp/tool-handlers.mjs +4 -168
- package/package.json +3 -22
- package/src/App.jsx +150 -2624
- package/src/agent-progress.js +79 -0
- package/src/agent-turn-mark.js +30 -0
- package/src/analytics.js +1 -19
- package/src/app-context.js +5 -0
- package/src/app-stage.jsx +2 -34
- package/src/asset-pane.jsx +6 -5
- package/src/camera-block.js +21 -0
- package/src/camera-direction.js +120 -0
- package/src/character-kind.js +3 -9
- package/src/command-bus.js +8 -6
- package/src/commands/cast.js +5 -34
- package/src/commands/elements/character.js +1 -1
- package/src/commands/elements/motion.js +1 -6
- package/src/commands/elements/object.js +6 -2
- package/src/commands/elements/shot.js +4 -1
- package/src/commands/elements.js +38 -14
- package/src/commands/index.js +3 -1
- package/src/commands/kits.js +37 -0
- package/src/commands/motion-timing.js +57 -0
- package/src/commands/motion.js +9 -152
- package/src/commands/motion3-compile.js +65 -0
- package/src/commands/motion3.js +207 -0
- package/src/commands/objects.js +6 -4
- package/src/commands/shot.js +49 -11
- package/src/commands/stage.js +14 -1
- package/src/commands/view.js +4 -1
- package/src/document-mirrors.js +42 -0
- package/src/document-store.js +4 -0
- package/src/domains/cast.js +19 -194
- package/src/domains/motion/motion-range-pin-rules.js +1 -1
- package/src/domains/motion/take-source.js +51 -0
- package/src/domains/motion.js +60 -1838
- package/src/domains/scenes.js +12 -55
- package/src/domains/shots.js +2 -2
- package/src/domains/stage.js +4 -2
- package/src/draft-ghost.js +46 -0
- package/src/draft-ghost.jsx +129 -0
- package/src/dualview.jsx +4 -3
- package/src/effects/EffectsLayer.jsx +112 -0
- package/src/effects/effect-meshes.js +232 -0
- package/src/effects/effect-record.js +103 -0
- package/src/effects/emitter.js +59 -0
- package/src/effects/simulate.js +261 -0
- package/src/effects/state.js +59 -0
- package/src/execution-telemetry.js +2 -3
- package/src/first-success-guide.jsx +5 -5
- package/src/ghost-set.js +257 -0
- package/src/held-object-edit.jsx +113 -0
- package/src/held-object-pose.js +175 -0
- package/src/hierarchy-model.js +1 -1
- package/src/hierarchy-panel.jsx +1 -1
- package/src/imported-mesh.jsx +103 -0
- package/src/kits/held.js +84 -0
- package/src/kits/index.js +70 -0
- package/src/kits/smoking.js +57 -0
- package/src/light-blockers.js +93 -0
- package/src/motion/beat-board-model.js +84 -0
- package/src/motion/beat-board.css +124 -0
- package/src/motion/beat-board.jsx +59 -0
- package/src/motion/center-of-mass.js +66 -0
- package/src/motion/fix-collisions.js +850 -0
- package/src/motion/physics-review.js +118 -0
- package/src/{ardy → motion}/physics-support.js +1 -76
- package/src/motion/rig-snapshot.js +22 -0
- package/src/motion/take-segments.jsx +140 -0
- package/src/{ardy → motion}/timeline-coordinates.js +0 -21
- package/src/{ardy → motion}/timeline.css +1 -2
- package/src/{ardy → motion}/timeline.jsx +42 -413
- package/src/motion/waypoints.js +76 -0
- package/src/motion3/beats.js +83 -0
- package/src/motion3/body.js +158 -0
- package/src/motion3/bones.js +47 -0
- package/src/motion3/carried.js +47 -0
- package/src/motion3/compile-job.js +75 -0
- package/src/motion3/compile-worker.js +10 -0
- package/src/motion3/compiler/anchors.js +105 -0
- package/src/motion3/compiler/arm-orient.js +128 -0
- package/src/motion3/compiler/channels.js +125 -0
- package/src/motion3/compiler/compile.js +205 -0
- package/src/motion3/compiler/gait-rhythm.js +97 -0
- package/src/motion3/compiler/grip.js +171 -0
- package/src/motion3/compiler/head-steady.js +48 -0
- package/src/motion3/compiler/hold.js +134 -0
- package/src/motion3/compiler/idle.js +113 -0
- package/src/motion3/compiler/limbs.js +170 -0
- package/src/motion3/compiler/math.js +72 -0
- package/src/motion3/compiler/pose.js +162 -0
- package/src/motion3/compiler/quat.js +49 -0
- package/src/motion3/compiler/skeleton.js +74 -0
- package/src/motion3/compiler/validate-common.js +32 -0
- package/src/motion3/compiler/validate-goals.js +118 -0
- package/src/motion3/compiler/validate-objects.js +143 -0
- package/src/motion3/compiler/validate-parts.js +116 -0
- package/src/motion3/compiler/validate.js +122 -0
- package/src/motion3/compiler/vocab.js +73 -0
- package/src/motion3/compiler/walk-pelvis.js +275 -0
- package/src/motion3/compiler/walk.js +207 -0
- package/src/motion3/compiler/wrist-clamp.js +32 -0
- package/src/motion3/delta.js +47 -0
- package/src/motion3/describe.js +174 -0
- package/src/motion3/docs.js +27 -0
- package/src/motion3/edit-carry.js +21 -0
- package/src/motion3/fix/ease.js +16 -0
- package/src/motion3/fix/ground.js +37 -0
- package/src/motion3/fix/index.js +52 -0
- package/src/motion3/fix/push.js +71 -0
- package/src/motion3/fix/reach.js +46 -0
- package/src/motion3/fix/retime.js +79 -0
- package/src/motion3/fix/self.js +211 -0
- package/src/motion3/fix/slide.js +70 -0
- package/src/motion3/fix/turn.js +51 -0
- package/src/motion3/follow.js +39 -0
- package/src/motion3/free-motion.js +173 -0
- package/src/motion3/grip-choice.js +130 -0
- package/src/motion3/hold-plan.js +157 -0
- package/src/motion3/json-patch.js +77 -0
- package/src/motion3/key-aim.js +105 -0
- package/src/motion3/key-edit.js +82 -0
- package/src/motion3/lenient.js +127 -0
- package/src/motion3/object-keys.js +236 -0
- package/src/motion3/object-pose.js +182 -0
- package/src/motion3/object-tracks.js +12 -0
- package/src/motion3/pipeline.js +102 -0
- package/src/motion3/playback.js +51 -0
- package/src/motion3/probes.js +91 -0
- package/src/motion3/qa/body-checks.js +34 -0
- package/src/motion3/qa/check-names.js +14 -0
- package/src/motion3/qa/checks.js +121 -0
- package/src/motion3/qa/contact-checks.js +51 -0
- package/src/motion3/qa/explain.js +80 -0
- package/src/motion3/qa/fmt.js +5 -0
- package/src/motion3/qa/foot-checks.js +72 -0
- package/src/motion3/qa/geometry.js +77 -0
- package/src/motion3/qa/goals.js +191 -0
- package/src/motion3/qa/ground.js +60 -0
- package/src/motion3/qa/hints-contact.js +179 -0
- package/src/motion3/qa/hints-goal.js +160 -0
- package/src/motion3/qa/hints-knee.js +24 -0
- package/src/motion3/qa/hints-motion.js +209 -0
- package/src/motion3/qa/hints-object.js +91 -0
- package/src/motion3/qa/index.js +42 -0
- package/src/motion3/qa/key-checks.js +82 -0
- package/src/motion3/qa/near.js +96 -0
- package/src/motion3/qa/object-checks.js +135 -0
- package/src/motion3/qa/patch.js +161 -0
- package/src/motion3/qa/severity.js +38 -0
- package/src/motion3/qa/spec-checks.js +65 -0
- package/src/motion3/qa/style.js +218 -0
- package/src/motion3/qa/wrist-checks.js +69 -0
- package/src/motion3/qa/wrist-obs.js +60 -0
- package/src/motion3/refs.js +120 -0
- package/src/motion3/repair-tune.js +121 -0
- package/src/motion3/repair.js +83 -0
- package/src/motion3/report.js +67 -0
- package/src/motion3/rigs/index.js +14 -0
- package/src/motion3/rigs/x-bot-tpose-body.json +1 -0
- package/src/motion3/rigs/x-bot-tpose.json +1 -0
- package/src/motion3/rigs/y-bot-tpose-body.json +1 -0
- package/src/motion3/rigs/y-bot-tpose.json +1 -0
- package/src/motion3/scene.js +60 -0
- package/src/motion3/schema/brief.js +89 -0
- package/src/motion3/schema/fields.js +44 -0
- package/src/motion3/schema/spec-examples.js +46 -0
- package/src/motion3/schema/topics.js +111 -0
- package/src/motion3/schema/types.js +147 -0
- package/src/motion3/search.js +117 -0
- package/src/motion3/second-hand.js +112 -0
- package/src/motion3/skills/basic.js +82 -0
- package/src/motion3/skills/book.js +76 -0
- package/src/motion3/skills/car.js +145 -0
- package/src/motion3/skills/frames-auto.js +29 -0
- package/src/motion3/skills/index.js +83 -0
- package/src/motion3/skills/info.js +65 -0
- package/src/motion3/skills/smoke-kit.js +109 -0
- package/src/motion3/skills/smoke.js +160 -0
- package/src/motion3/spec-store.js +59 -0
- package/src/motion3/take-edit.js +155 -0
- package/src/motion3/take.js +63 -0
- package/src/motion3/timeline.js +127 -0
- package/src/motion3/views.js +121 -0
- package/src/motion3/walk-plan.js +119 -0
- package/src/object-catalog.jsx +7 -1
- package/src/object-colors.js +98 -0
- package/src/object-gizmo-parts.js +115 -0
- package/src/object-gizmo.jsx +37 -122
- package/src/object-glow.js +139 -0
- package/src/object-hidden.js +33 -0
- package/src/object-look.js +196 -0
- package/src/object-size.js +10 -0
- package/src/object-travel.js +71 -6
- package/src/panels/CameraPanel.jsx +7 -7
- package/src/panels/HdrEnvironmentControls.jsx +59 -0
- package/src/panels/LightPanel.jsx +25 -4
- package/src/panels/ObjectLookPanel.jsx +88 -0
- package/src/panels/PosePanel.jsx +2 -17
- package/src/panels/RigControlPanel.jsx +5 -53
- package/src/panels/SubjectBox.jsx +4 -1
- package/src/panels/details.css +14 -0
- package/src/posestudio.jsx +4 -27
- package/src/project-browser.jsx +3 -4
- package/src/project-resources.js +18 -31
- package/src/project.js +13 -104
- package/src/props.jsx +25 -280
- package/src/rail-dot-drag.js +23 -0
- package/src/render-passes.js +10 -0
- package/src/resource-status.jsx +1 -0
- package/src/result-modal.jsx +4 -19
- package/src/room.jsx +20 -12
- package/src/scene-assets.js +8 -6
- package/src/scene-light-place.js +72 -0
- package/src/scene-lights.jsx +148 -0
- package/src/scene-objects.js +31 -139
- package/src/scenes.js +15 -105
- package/src/semantic-edit.js +2 -5
- package/src/set-pieces.jsx +183 -0
- package/src/settings-menu.jsx +3 -11
- package/src/shell/BottomDock.jsx +9 -51
- package/src/shell/DetailsSlot.jsx +16 -200
- package/src/shell/GhostsMenuGroup.jsx +74 -0
- package/src/shell/LibrarySlot.jsx +1 -3
- package/src/shell/MenuBar.jsx +3 -3
- package/src/shell/PreferencesDialog.jsx +15 -264
- package/src/shell/PreferencesSlot.jsx +2 -8
- package/src/shell/TopBar.jsx +5 -84
- package/src/shell/ViewportToolbar.jsx +10 -70
- package/src/shell/agent-glass.css +19 -6
- package/src/shell/details-selection.js +42 -0
- package/src/shell/ghosts-menu.css +22 -0
- package/src/shell/glass-regions.css +29 -3
- package/src/shell/preferences.css +6 -1
- package/src/shot-authoring.js +4 -7
- package/src/soft-shadows.js +37 -0
- package/src/stage-attach-frames.js +12 -12
- package/src/stage-canvas-rigs.jsx +3 -3
- package/src/stage-capture.jsx +42 -8
- package/src/stage-characters.jsx +22 -216
- package/src/stage-editor-gizmos.jsx +6 -6
- package/src/stage-environment.js +93 -0
- package/src/stage-hdr-builtins.js +107 -0
- package/src/stage-hdr-image.js +116 -0
- package/src/stage-hdr-library.js +70 -0
- package/src/stage-hdr-map.js +94 -0
- package/src/stage-hdr.js +130 -0
- package/src/stage-lighting.js +149 -0
- package/src/stage-occlusion.js +210 -0
- package/src/stage-sky.jsx +159 -0
- package/src/stage-startup-defaults.js +5 -9
- package/src/studio-actions.js +12 -14
- package/src/studio-agent-commands.js +19 -16
- package/src/studio-agent-motion.js +9 -9
- package/src/studio-agent-protocol.js +41 -71
- package/src/studio-app-binding.js +25 -45
- package/src/studio-asset-list.js +17 -0
- package/src/studio-contact-sheet.js +37 -5
- package/src/studio-elements.js +27 -7
- package/src/studio-entity-bounds.js +18 -0
- package/src/studio-error-codes.js +8 -0
- package/src/studio-export-framing.js +152 -0
- package/src/studio-lighting-check.js +103 -0
- package/src/studio-motion-visual.js +150 -0
- package/src/studio-schema-errors.js +80 -0
- package/src/studio-support-gap.js +74 -0
- package/src/styles.css +1 -19
- package/src/timeline-defaults.js +5 -0
- package/src/timeline-extent.js +8 -20
- package/src/tutorial-walk.js +17 -0
- package/src/ui-scrub.js +1 -1
- package/src/use-shot-camera-tracks.js +12 -0
- package/src/view-ghosts.js +97 -0
- package/src/view-ghosts.jsx +49 -0
- package/src/workflow/AgentPanel.jsx +47 -166
- package/src/workflow/AgentProgressCard.jsx +107 -0
- package/src/workflow/AgentReplyText.jsx +37 -0
- package/src/workflow/AgentTurnSteps.jsx +84 -0
- package/src/workflow/LoginPanel.jsx +140 -0
- package/src/workflow/WorkflowBuilder.jsx +7 -23
- package/src/workflow/agent-client.js +54 -51
- package/src/workflow/agent-panel.css +71 -1
- package/src/workflow/agent-progress-card.css +167 -0
- package/src/workflow/agent-progress-view.js +47 -0
- package/src/workflow/agent-turn-steps.css +113 -0
- package/src/workflow/agent-turn.js +191 -0
- package/src/workflow/login-client.js +34 -0
- package/src/workflow/motion-input.js +18 -31
- package/src/workflow/node-schema.js +1 -1
- package/src/workflow/reply-markdown.js +69 -0
- package/src/workflow/scene-asset-sync.js +8 -8
- package/tools/agent-session-stats.mjs +61 -0
- package/tools/dev-full.mjs +5 -56
- package/tools/eslint-baseline.json +12 -13
- package/tools/knip-baseline.json +0 -179
- package/tools/loc-baseline.json +31 -81
- package/tools/motion3/extract-body.mjs +103 -0
- package/tools/motion3/extract-rig.mjs +85 -0
- package/tools/process-supervisor.mjs +0 -88
- package/tools/run-tests.mjs +8 -124
- package/bin/agent/motion-runtime.mjs +0 -76
- package/dist/ardy/cskel27-rest.json +0 -557
- package/dist/assets/analytics-C9pMpW7s.js +0 -1
- package/dist/assets/app-B_2XB9rw.css +0 -1
- package/dist/assets/app-DAuvKPP8.js +0 -4920
- package/dist/assets/config-Bx7pYsD9.js +0 -1
- package/dist/assets/config-DeoFTYzb.css +0 -1
- package/dist/assets/demo-CvKuBgy5.js +0 -1
- package/dist/assets/scene-asset-sync-DKkpjKBV.js +0 -19
- package/dist/assets/scene-asset-sync-DjJ_cJ2R.css +0 -1
- package/dist/assets/ticket-BPk2Ni95.js +0 -1
- package/dist/assets/workflow-jJRBR94Z.js +0 -179
- package/dist/demo/walk-then-stop.npz +0 -0
- package/mcp/ardy-prompts.mjs +0 -218
- package/src/ardy/auto-fix-panel.css +0 -108
- package/src/ardy/auto-physics.js +0 -1194
- package/src/ardy/client.js +0 -153
- package/src/ardy/convert.js +0 -313
- package/src/ardy/cskel27-neutral.js +0 -39
- package/src/ardy/cskel27.js +0 -77
- package/src/ardy/export.js +0 -165
- package/src/ardy/fix-collisions.js +0 -2257
- package/src/ardy/foot-lock.js +0 -230
- package/src/ardy/motion-calibration.js +0 -118
- package/src/ardy/motion-edit.js +0 -213
- package/src/ardy/motion-url.js +0 -55
- package/src/ardy/mp4-duration.js +0 -102
- package/src/ardy/npz.js +0 -595
- package/src/ardy/physics-panel.css +0 -21
- package/src/ardy/physics-panel.jsx +0 -89
- package/src/ardy/physics-refine.js +0 -111
- package/src/ardy/physics-review.js +0 -567
- package/src/ardy/physics-temporal.js +0 -54
- package/src/ardy/platform-fit-panel.css +0 -64
- package/src/ardy/platform-fit-panel.jsx +0 -41
- package/src/ardy/platform-fit.js +0 -326
- package/src/ardy/playback.js +0 -711
- package/src/ardy/pose-pin.js +0 -97
- package/src/ardy/prompt-clips.js +0 -30
- package/src/ardy/retime.js +0 -211
- package/src/ardy/root-drop.js +0 -369
- package/src/ardy/timeline-resize.js +0 -13
- package/src/ardy/to-cskel27.js +0 -225
- package/src/ardy/trim.js +0 -33
- package/src/ardy/waypoints.js +0 -369
- package/src/ardy-bridge-contract.js +0 -281
- package/src/domains/motion/motion-video-capture.js +0 -664
- package/src/i2v-motion-client.js +0 -77
- package/src/i2v-motion-studio.jsx +0 -180
- package/src/line-edit.js +0 -1348
- package/src/motion/generation.js +0 -105
- package/src/motion-readiness-ui.jsx +0 -67
- package/src/motion-readiness.js +0 -40
- package/src/motion-resources.js +0 -177
- package/src/motion-store.js +0 -65
- package/src/motion-trail.js +0 -601
- package/src/multimodel-ingest.js +0 -394
- package/src/panels/PromptBlocksPanel.jsx +0 -444
- package/src/panels/VideoCapturePanel.jsx +0 -181
- package/src/pose-extract/browser.js +0 -42
- package/src/pose-extract/detector.js +0 -100
- package/src/pose-extract/fit.js +0 -227
- package/src/pose-extract/image-frame.js +0 -51
- package/src/pose-extract/index.js +0 -58
- package/src/pose-extract/keyframes.js +0 -74
- package/src/pose-extract/landmarks.js +0 -162
- package/src/pose-extract/mirror.js +0 -153
- package/src/pose-extract/take.js +0 -131
- package/src/pose-extract/video-frames.js +0 -91
- package/src/take-recipe.js +0 -165
- package/src/trail-key-conflicts.js +0 -39
- package/src/trail-pick.js +0 -59
- package/src/use-i2v-capture-modal.js +0 -15
- package/tools/ardy/BRIDGE.md +0 -37
- package/tools/ardy/GVHMR-NPZ.md +0 -68
- package/tools/ardy/README.md +0 -124
- package/tools/ardy/__pycache__/cclay_gvhmr_worker.cpython-313.pyc +0 -0
- package/tools/ardy/artifacts.mjs +0 -34
- package/tools/ardy/bridge.mjs +0 -1732
- package/tools/ardy/bvh-cskel27.mjs +0 -1265
- package/tools/ardy/cclay_constrained_generate.py +0 -561
- package/tools/ardy/cclay_gvhmr_worker.py +0 -264
- package/tools/ardy/cclay_motion_edit.py +0 -510
- package/tools/ardy/cclay_sequence_generate.py +0 -705
- package/tools/ardy/cclay_worker.py +0 -304
- package/tools/ardy/dump-npz.py +0 -205
- package/tools/ardy/extract-rest.mjs +0 -299
- package/tools/ardy/extract.mjs +0 -507
- package/tools/ardy/footage.mjs +0 -467
- package/tools/ardy/gvhmr-floor.mjs +0 -102
- package/tools/ardy/gvhmr-to-cskel27.mjs +0 -21
- package/tools/ardy/gvhmr_fastpath.py +0 -168
- package/tools/ardy/gvhmr_trajectory.py +0 -240
- package/tools/ardy/merge-text-encoder.py +0 -160
- package/tools/ardy/mocap-metrics.mjs +0 -200
- package/tools/ardy/mocap-quality-gate.mjs +0 -110
- package/tools/ardy/motion-stabilize.mjs +0 -348
- package/tools/ardy/npz.mjs +0 -414
- package/tools/ardy/pose-to-npz.mjs +0 -106
- package/tools/ardy/prompt-limits.mjs +0 -5
- package/tools/ardy/run-edit-on-box.sh +0 -73
- package/tools/ardy/run-local.mjs +0 -233
- package/tools/ardy/run-on-box.sh +0 -593
- package/tools/ardy/run-sequence-on-box.sh +0 -177
- package/tools/ardy/runners/gvhmr-worker.mjs +0 -206
- package/tools/ardy/runners/index.mjs +0 -18
- package/tools/ardy/runners/local.mjs +0 -455
- package/tools/ardy/runners/proc.mjs +0 -125
- package/tools/ardy/runners/remote.mjs +0 -252
- package/tools/ardy/setup-local.mjs +0 -189
- package/tools/ardy/setup-text-encoder-on-box.sh +0 -93
- package/tools/ardy/setup-text-encoder.py +0 -306
- package/tools/ardy/smpl-cskel27.mjs +0 -178
- package/tools/ardy/visual-qa.mjs +0 -196
- package/tools/ardy/vq-car.mjs +0 -52
- package/tools/bench/EXP3.md +0 -61
- package/tools/bench/cclay_bench_extract_incam.py +0 -125
- package/tools/bench/cclay_bench_extract_obs.py +0 -204
- package/tools/bench/cclay_bench_runner.py +0 -42
- package/tools/bench/cube-contact.mjs +0 -162
- package/tools/bench/exp3.mjs +0 -152
- package/tools/bench/extract-bench-lib.mjs +0 -216
- package/tools/bench/extract-bench.mjs +0 -302
- package/tools/bench/fal-generate.mjs +0 -88
- package/tools/bench/fit/README.md +0 -189
- package/tools/bench/fit/camera.mjs +0 -59
- package/tools/bench/fit/contact.mjs +0 -419
- package/tools/bench/fit/footlock.mjs +0 -234
- package/tools/bench/fit/motion.mjs +0 -85
- package/tools/bench/fit/pin.mjs +0 -27
- package/tools/bench/fit/remote.mjs +0 -105
- package/tools/bench/fit-bench.mjs +0 -126
- package/tools/bench/fit-sanity.mjs +0 -45
- package/tools/bench/metrics.mjs +0 -313
- package/tools/bench/obs/depth.mjs +0 -258
- package/tools/bench/obs/extrinsics.mjs +0 -175
- package/tools/bench/obs/fit_mannequin_betas.py +0 -340
- package/tools/bench/obs/ground.mjs +0 -294
- package/tools/bench/obs/heading.mjs +0 -151
- package/tools/bench/obs/ladder.mjs +0 -555
- package/tools/bench/obs/mannequin-betas.json +0 -124
- package/tools/bench/obs/remote.mjs +0 -83
- package/tools/bench/obs/rest_joints.py +0 -52
- package/tools/bench/obs/ybot-targets.mjs +0 -49
- package/tools/bench/obs-bench.mjs +0 -520
- package/tools/bench/score.mjs +0 -343
- package/tools/bench/summarize.mjs +0 -86
- package/tools/demo-worker/README.md +0 -137
- package/tools/demo-worker/api-client.mjs +0 -233
- package/tools/demo-worker/generate.mjs +0 -301
- package/tools/demo-worker/index.mjs +0 -466
- package/tools/demo-worker/sign-core.mjs +0 -112
- package/tools/demo-worker/sign.mjs +0 -161
- package/tools/gt-render/browser.mjs +0 -182
- package/tools/gt-render/camera-math.mjs +0 -276
- package/tools/gt-render/page.mjs +0 -267
- package/tools/gt-render/render.mjs +0 -514
- package/tools/gt-render/scene-box.mjs +0 -31
- package/tools/gt-render/take-transform.mjs +0 -87
- package/tools/kimodo/compare-seam.mjs +0 -108
- package/tools/kimodo/constraints.mjs +0 -244
- package/tools/kimodo/edit.mjs +0 -259
- package/tools/kimodo/effector-constraints.mjs +0 -200
- package/tools/kimodo/generate.mjs +0 -646
- package/tools/kimodo/local-output.mjs +0 -265
- package/tools/kimodo/measure-pose.mjs +0 -65
- package/tools/kimodo/measure-preserve.mjs +0 -899
- package/tools/kimodo/measure-waypoints.mjs +0 -55
- package/tools/kimodo/mlx-generate.py +0 -111
- package/tools/kimodo/pose-constraints.mjs +0 -248
- package/tools/kimodo/preserve-mask.mjs +0 -543
- package/tools/kimodo/read-npz.mjs +0 -189
- package/tools/kimodo/run-edit-on-box.mjs +0 -155
- package/tools/kimodo/run-sequence-on-box.mjs +0 -178
- package/tools/kimodo/runner.mjs +0 -284
- package/tools/kimodo/seam-batch.mjs +0 -77
- package/tools/kimodo/setup-local.mjs +0 -30
- package/tools/kimodo/setup-on-box.sh +0 -339
- package/tools/kimodo/soma77-to-cskel27.mjs +0 -305
- package/tools/morphgs/assets/gen_truth.py +0 -39
- package/tools/morphgs/assets/mesh_ori_rig.txt +0 -27
- package/tools/morphgs/assets/playback-check.mjs +0 -30
- package/tools/morphgs/demo-gate.sh +0 -26
- package/tools/morphgs/fbx2morphgs.mjs +0 -68
- package/tools/morphgs/morphgs-to-cskel27.mjs +0 -105
- package/tools/morphgs/patches/preprocess_src-none-mode.patch +0 -76
- package/tools/morphgs/setup-on-cluster.sh +0 -126
- package/tools/projflow/driver.py +0 -1069
- package/tools/projflow/generate.mjs +0 -805
- package/tools/projflow/hml22-to-cskel27.mjs +0 -735
- package/tools/projflow/line-edit-job.mjs +0 -547
- package/tools/projflow/replay.mjs +0 -452
- package/tools/projflow/runner.mjs +0 -269
- package/tools/projflow/service.mjs +0 -742
- package/tools/track/DESIGN.md +0 -513
- package/tools/track/backfill-provenance.mjs +0 -116
- package/tools/track/budget.mjs +0 -8
- package/tools/track/check-rig.mjs +0 -209
- package/tools/track/diagnostics.schema.json +0 -60
- package/tools/track/export-rig.mjs +0 -256
- package/tools/track/fallback.mjs +0 -7
- package/tools/track/fk-parity-fixture.mjs +0 -161
- package/tools/track/gate.mjs +0 -349
- package/tools/track/masks.mjs +0 -318
- package/tools/track/metrics.mjs +0 -201
- package/tools/track/publish-obs.mjs +0 -108
- package/tools/track/py/check_env.py +0 -61
- package/tools/track/py/eval_lr.py +0 -229
- package/tools/track/py/lr_viterbi.py +0 -294
- package/tools/track/py/masks.py +0 -405
- package/tools/track/py/objective.py +0 -382
- package/tools/track/py/rig.py +0 -508
- package/tools/track/py/scene.py +0 -326
- package/tools/track/py/test_joint_indices.py +0 -123
- package/tools/track/py/test_lr_viterbi.py +0 -195
- package/tools/track/py/test_masks.py +0 -229
- package/tools/track/py/test_rig.py +0 -288
- package/tools/track/py/test_scene.py +0 -354
- package/tools/track/py/test_track.py +0 -328
- package/tools/track/py/track.py +0 -411
- package/tools/track/remote.mjs +0 -140
- package/tools/track/rig-dump.mjs +0 -227
- package/tools/track/run-box-tests.mjs +0 -14
- package/tools/track/run-box.mjs +0 -168
- package/tools/track/setup-box.sh +0 -59
- package/tools/track/study-2d.mjs +0 -728
- /package/src/{ardy → motion}/collision-blockers.js +0 -0
- /package/src/{ardy → motion}/ground.js +0 -0
- /package/src/{ardy → motion}/ik-drag.js +0 -0
- /package/src/{ardy → motion}/ik-key-json.js +0 -0
- /package/src/{ardy → motion}/ik.js +0 -0
- /package/src/{ardy → motion}/physics-surface.js +0 -0
- /package/src/{ardy → motion}/playback-clock.js +0 -0
- /package/src/{ardy → motion}/range-pin.js +0 -0
package/src/domains/scenes.js
CHANGED
|
@@ -44,8 +44,7 @@ import {
|
|
|
44
44
|
import { playgroundSceneUrl, fetchSceneProject } from "../playground.js";
|
|
45
45
|
import { openAssetDb, referencedAssetIds, getAsset, putAsset } from "../scene-assets.js";
|
|
46
46
|
import { internWorkflowOutputs, workflowOutputRefs, resolveWorkflowOutputs } from "../workflow/workflow-resources.js";
|
|
47
|
-
|
|
48
|
-
import { openMotionDb, putMotion, sweepMotions } from "../motion-store.js";
|
|
47
|
+
|
|
49
48
|
import { resourceManifest } from "../project-resources.js";
|
|
50
49
|
import { isKo, ko } from "../locale.js";
|
|
51
50
|
import { track, bucketCount, bucketProjectAge, startExportAttempt } from "../analytics.js";
|
|
@@ -54,7 +53,7 @@ import { DEFAULT_WORKSPACE_LAYOUT, DEFAULT_DURATION_S, TIMELINE_FPS } from "../a
|
|
|
54
53
|
import { saveCustomPoses } from "../poses.js";
|
|
55
54
|
import { readShotAuthoringDocument } from "../shot-authoring.js";
|
|
56
55
|
import { initialShots } from "../cuts.js";
|
|
57
|
-
import { createIkState } from "../
|
|
56
|
+
import { createIkState } from "../motion/ik.js";
|
|
58
57
|
|
|
59
58
|
// The scene list and project identity share one history. Dirty is derived from
|
|
60
59
|
// the saved checkpoint, not an authored edit, and has its own non-history slice.
|
|
@@ -238,56 +237,17 @@ export function useScenes(appContext) {
|
|
|
238
237
|
return JSON.stringify(createProjectDocument(projectDocumentInput(name)));
|
|
239
238
|
}
|
|
240
239
|
|
|
241
|
-
|
|
240
|
+
async function collectProjectSerialized(name) {
|
|
242
241
|
const input = projectDocumentInput(name);
|
|
243
|
-
const scenesDocument =
|
|
244
|
-
...input.scenesDocument,
|
|
245
|
-
scenes: input.scenesDocument.scenes.map((scene) => ({
|
|
246
|
-
...scene,
|
|
247
|
-
stage: scene.stage
|
|
248
|
-
? {
|
|
249
|
-
...scene.stage,
|
|
250
|
-
characters: (scene.stage.characters ?? []).map((character) => ({
|
|
251
|
-
...character,
|
|
252
|
-
motionRef: character.motionRef ? { ...character.motionRef } : character.motionRef,
|
|
253
|
-
})),
|
|
254
|
-
}
|
|
255
|
-
: scene.stage,
|
|
256
|
-
})),
|
|
257
|
-
};
|
|
242
|
+
const scenesDocument = input.scenesDocument;
|
|
258
243
|
const db = await openAssetDb();
|
|
259
244
|
try {
|
|
260
245
|
const ids = [...referencedAssetIds(scenesDocument.scenes)];
|
|
261
246
|
const assets = await Promise.all(ids.map((id) => getAsset(db, id)));
|
|
262
247
|
const workflowResult = await internWorkflowOutputs(input.workflow);
|
|
263
|
-
const referencedMotionIds = new Set(
|
|
264
|
-
scenesDocument.scenes.flatMap((scene) => (scene.stage?.characters ?? [])
|
|
265
|
-
.map((character) => character.motionRef?.motionId?.toLowerCase())
|
|
266
|
-
.filter(Boolean)),
|
|
267
|
-
);
|
|
268
|
-
const motions = [...appContext.shared.projectMotionsRef.current.entries()]
|
|
269
|
-
.filter(([id]) => referencedMotionIds.has(id))
|
|
270
|
-
.map(([, record]) => record);
|
|
271
|
-
const motionCache = new Map();
|
|
272
|
-
for (const record of motions) motionCache.set(record.motionId.toLowerCase(), record);
|
|
273
|
-
for (const scene of scenesDocument.scenes) for (const character of scene.stage?.characters ?? []) {
|
|
274
|
-
const clip = appContext.shared.motionFullRef.current.get(character.id);
|
|
275
|
-
if (!clip?.sourceBytes) continue;
|
|
276
|
-
let record = appContext.shared.motionEncodingCacheRef.current.get(clip.sourceBytes);
|
|
277
|
-
if (!record) {
|
|
278
|
-
record = await encodeMotionResource(clip.sourceBytes, { prompt: character.motionRef?.prompt, sourceUrl: character.motionRef?.url });
|
|
279
|
-
appContext.shared.motionEncodingCacheRef.current.set(clip.sourceBytes, record);
|
|
280
|
-
}
|
|
281
|
-
const cached = motionCache.get(record.motionId) ?? record;
|
|
282
|
-
motionCache.set(record.motionId, cached);
|
|
283
|
-
if (!motions.includes(cached)) motions.push(cached);
|
|
284
|
-
appContext.shared.projectMotionsRef.current.set(record.motionId.toLowerCase(), cached);
|
|
285
|
-
character.motionRef = { ...(character.motionRef || {}), motionId: cached.motionId };
|
|
286
|
-
}
|
|
287
|
-
try { const motionDb = await openMotionDb(); await Promise.all(motions.map((record) => putMotion(motionDb, record))); motionDb.close(); } catch (error) { console.warn("[cozyclay] could not cache motions", error); }
|
|
288
248
|
const allAssets = [...assets.filter(Boolean), ...workflowResult.assets];
|
|
289
|
-
const nextInput = { ...input, scenesDocument, workflow: workflowResult.graph, assets: allAssets
|
|
290
|
-
const manifest = resourceManifest({ scenesDocument: nextInput.scenesDocument, workflow: nextInput.workflow, poseLibrary: nextInput.customPoses, assets: allAssets,
|
|
249
|
+
const nextInput = { ...input, scenesDocument, workflow: workflowResult.graph, assets: allAssets };
|
|
250
|
+
const manifest = resourceManifest({ scenesDocument: nextInput.scenesDocument, workflow: nextInput.workflow, poseLibrary: nextInput.customPoses, assets: allAssets, workflowOutputRefs });
|
|
291
251
|
setProjectManifest(manifest);
|
|
292
252
|
if (manifest.missing.length) {
|
|
293
253
|
const error = new Error("Project has missing resources");
|
|
@@ -445,10 +405,8 @@ export function useScenes(appContext) {
|
|
|
445
405
|
appContext.shared.setTutorialSeedPending(false);
|
|
446
406
|
appContext.shared.setCameraTutorialHandoff(null);
|
|
447
407
|
appContext.shared.exportShotIdRef.current = null;
|
|
448
|
-
appContext.shared.projectMotionsRef.current = new Map((project.motions ?? []).map((record) => [record.motionId?.toLowerCase(), record]).filter(([id]) => id));
|
|
449
408
|
const source = project.scenesDocument;
|
|
450
|
-
|
|
451
|
-
// A project FILE carries its own scene document and never passes the
|
|
409
|
+
// A project FILE carries its own scene document and never passes the
|
|
452
410
|
// storage reader, so the 20 fps → 24 fps clock migration is applied here
|
|
453
411
|
// too — otherwise an older .cozyclay would open a sixth too fast.
|
|
454
412
|
const doc = migrateToCurrentScenes(source);
|
|
@@ -470,7 +428,7 @@ export function useScenes(appContext) {
|
|
|
470
428
|
// Whatever document this is, it is no longer the scene the tutorial opened
|
|
471
429
|
// for itself; startCameraTutorial re-arms the flag after its own open.
|
|
472
430
|
appContext.shared.tutorialStarterRef.current = false;
|
|
473
|
-
setProjectManifest(resourceManifest({ scenesDocument: doc, workflow: resolvedWorkflow, poseLibrary: mergedCustomPoses, assets: project.assets ?? [],
|
|
431
|
+
setProjectManifest(resourceManifest({ scenesDocument: doc, workflow: resolvedWorkflow, poseLibrary: mergedCustomPoses, assets: project.assets ?? [], workflowOutputRefs }));
|
|
474
432
|
track("project:opened", { age_bucket: bucketProjectAge(Date.now() - (project.savedAt ?? Date.now())) });
|
|
475
433
|
}
|
|
476
434
|
|
|
@@ -586,7 +544,6 @@ export function useScenes(appContext) {
|
|
|
586
544
|
setProjectNameDialog(null);
|
|
587
545
|
const fresh = createSceneDocument(ko("SCENE 01", "씬 01"));
|
|
588
546
|
storeWorkflowGraph(createWorkflowGraph());
|
|
589
|
-
appContext.shared.projectMotionsRef.current = new Map();
|
|
590
547
|
appContext.shared.motionFullRef.current.clear();
|
|
591
548
|
domain.replaceDocument(fresh.scenes, fresh.activeSceneId, name, previsMode);
|
|
592
549
|
persistScenes(fresh.scenes, fresh.activeSceneId);
|
|
@@ -660,16 +617,16 @@ export function useScenes(appContext) {
|
|
|
660
617
|
// The motion-layer buffer reloads from the scene's first character.
|
|
661
618
|
const firstLayer = stage.characters[0]?.layer;
|
|
662
619
|
appContext.shared.setWaypoints(firstLayer?.waypoints ?? shotState.waypoints ?? []);
|
|
663
|
-
|
|
664
|
-
// Takes belong to the room being left;
|
|
620
|
+
|
|
621
|
+
// Takes belong to the room being left; the motion layers load the
|
|
665
622
|
// incoming scene's, and a stale full take must never survive the switch.
|
|
666
623
|
appContext.shared.motionFullRef.current.clear();
|
|
667
|
-
|
|
624
|
+
|
|
668
625
|
appContext.shared.ikStatesRef.current.clear();
|
|
669
626
|
appContext.shared.ikStateRef.current = createIkState();
|
|
670
627
|
appContext.shared.loadedLayerCharRef.current = stage.characters[0]?.id ?? null;
|
|
671
628
|
appContext.shared.setActiveCharacterId(stage.characters[0]?.id ?? null);
|
|
672
|
-
|
|
629
|
+
|
|
673
630
|
appContext.shared.setTlFrame(0);
|
|
674
631
|
appContext.shared.setMovePlaying(false);
|
|
675
632
|
appContext.shared.manualCameraOverrideRef.current = false;
|
package/src/domains/shots.js
CHANGED
|
@@ -381,7 +381,7 @@ export function useShots(appContext) {
|
|
|
381
381
|
function clampShotRailRanges() {}
|
|
382
382
|
const extentInputs = useRef(null);
|
|
383
383
|
function syncTimelineExtent() {
|
|
384
|
-
const inputs = [appContext.shared.characters, appContext.shared.activeChar.id, appContext.shared.motion
|
|
384
|
+
const inputs = [appContext.shared.characters, appContext.shared.activeChar.id, appContext.shared.motion];
|
|
385
385
|
// App also re-runs this effect when shot history publishes. Only new
|
|
386
386
|
// content can request a new extent; replaying it after Undo would replace
|
|
387
387
|
// the restored entry and destroy Redo. Shot writes already clamp ranges.
|
|
@@ -402,7 +402,7 @@ export function useShots(appContext) {
|
|
|
402
402
|
const target = shotId ? shots.find(entry => entry.id === shotId) : shots[atPlayhead >= 0 ? atPlayhead : 0] ?? null;
|
|
403
403
|
if (shotId && !target) return null;
|
|
404
404
|
let exportShots = shots;
|
|
405
|
-
if (target && target.cameraKeys.length === 0 && !shotId && scope !== 'timeline') {
|
|
405
|
+
if (target && target.cameraKeys.length === 0 && (target.camera?.mode ?? 'keys') === 'keys' && !shotId && scope !== 'timeline') {
|
|
406
406
|
appContext.bus.run('shot.addKey', { shotId: target.id, frame: target.startFrame });
|
|
407
407
|
exportShots = appContext.storeDomain('shot').read();
|
|
408
408
|
}
|
package/src/domains/stage.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useContext, useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
import { AppContext } from '../app-context.js';
|
|
3
3
|
import { createSceneStageStore } from '../store/scene-stage.js';
|
|
4
4
|
import { useDocumentDomain } from '../store/use-document-store.js';
|
|
5
|
-
import { createKeyLight } from '../
|
|
5
|
+
import { createKeyLight } from '../stage-lighting.js';
|
|
6
6
|
import { shotAspectRatio } from '../shot.js';
|
|
7
7
|
import { normalizeStage } from '../commands/stage.js';
|
|
8
8
|
|
|
@@ -70,7 +70,9 @@ export function useStageTransaction() {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
export function useStage(appContext) {
|
|
73
|
-
|
|
73
|
+
// One stage owner: StrictMode runs this initializer twice, and a second domain would leave App
|
|
74
|
+
// rendering (and mirroring into the saved scene) a stage no command writes.
|
|
75
|
+
const [domain] = useState(() => appContext.storeDomain('stage') ?? createStageDomain(appContext));
|
|
74
76
|
const stage = useDocumentDomain(domain.documentStore, 'stage');
|
|
75
77
|
const [preset, setPreset] = useState('medium');
|
|
76
78
|
const gesture = useRef(null);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// The agent's latest motion draft as one translucent figure in the working views, so the user sees the motion
|
|
2
|
+
// take shape while the agent works (agent-progress.js publishes every motion.compile, installed or not). This
|
|
3
|
+
// module holds the pure choices: whether the ghost shows, at what opacity and frame (its own loop at the take's
|
|
4
|
+
// rate from the moment the draft arrived, whatever the timeline does), what its label says, and the viewer's
|
|
5
|
+
// on/off setting (transient like the View menu: never saved, never undone). draft-ghost.jsx draws it on
|
|
6
|
+
// GIZMO_LAYER, so captures, contact sheets and exports never see it.
|
|
7
|
+
import { useSyncExternalStore } from "react";
|
|
8
|
+
import { ko } from "./locale.js";
|
|
9
|
+
|
|
10
|
+
/** Teal: apart from the onion skin's blue (before) and orange (after). */
|
|
11
|
+
export const DRAFT_GHOST_COLOR = "#2fc79a";
|
|
12
|
+
export const DRAFT_GHOST_OPACITY = 0.42;
|
|
13
|
+
/** An installed draft fades out over this long from its arrival: the real take plays now. */
|
|
14
|
+
export const DRAFT_GHOST_FADE_MS = 1200;
|
|
15
|
+
const HIDDEN = Object.freeze({ shown: false, opacity: 0, frame: 0 });
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* draftGhostState(draft, now) -> { shown, opacity, frame }: a draft whose take is a take v3 shows at
|
|
19
|
+
* DRAFT_GHOST_OPACITY while it is not installed; an installed one fades out over DRAFT_GHOST_FADE_MS.
|
|
20
|
+
* frame loops over the take at its fps from draft.at (ms, as now).
|
|
21
|
+
*/
|
|
22
|
+
export function draftGhostState(draft, now) {
|
|
23
|
+
const take = draft?.take;
|
|
24
|
+
if (take?.schema !== "cozyclay.take.v3" || !(take.frameCount > 0)) return HIDDEN;
|
|
25
|
+
const age = Math.max(0, now - (draft.at ?? now)), fps = take.fps > 0 ? take.fps : 24;
|
|
26
|
+
const opacity = draft.installed ? DRAFT_GHOST_OPACITY * (1 - age / DRAFT_GHOST_FADE_MS) : DRAFT_GHOST_OPACITY;
|
|
27
|
+
if (!(opacity > 0.01)) return HIDDEN;
|
|
28
|
+
return { shown: true, opacity: +opacity.toFixed(3), frame: Math.floor((age / 1000) * fps) % take.frameCount };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** "Draft 3 · QA 31" ("초안 3 · QA 31"). */
|
|
32
|
+
export const draftLabel = draft => `${ko("Draft", "초안")} ${draft?.n ?? 0} · QA ${draft?.qa?.total ?? 0}`;
|
|
33
|
+
|
|
34
|
+
let shown = true;
|
|
35
|
+
const listeners = new Set();
|
|
36
|
+
/** Whether the viewer wants the draft ghost (default on). */
|
|
37
|
+
export const draftGhostShown = () => shown;
|
|
38
|
+
export function setDraftGhostShown(value) {
|
|
39
|
+
const next = !!value;
|
|
40
|
+
if (next === shown) return shown;
|
|
41
|
+
shown = next;
|
|
42
|
+
for (const listener of [...listeners]) listener();
|
|
43
|
+
return shown;
|
|
44
|
+
}
|
|
45
|
+
const subscribe = listener => { listeners.add(listener); return () => listeners.delete(listener); };
|
|
46
|
+
export const useDraftGhostShown = () => useSyncExternalStore(subscribe, draftGhostShown, draftGhostShown);
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// The agent's latest motion draft in the working views (draft-ghost.js decides what shows): one GhostSet slot
|
|
2
|
+
// of the drafting character's rig, posed from the draft take on its own loop, the records that take moves
|
|
3
|
+
// riding along, and a label over its head ("Draft 3 · QA 31"). Everything sits on GIZMO_LAYER: the shot
|
|
4
|
+
// preview card, PlayView, captures, contact sheets and exports never draw it, and it takes no ray. The canvas
|
|
5
|
+
// may render on demand, so a shown ghost asks for frames at the take's rate.
|
|
6
|
+
import { useEffect, useMemo, useSyncExternalStore } from "react";
|
|
7
|
+
import * as THREE from "three";
|
|
8
|
+
import { useFrame, useThree } from "@react-three/fiber";
|
|
9
|
+
import { GIZMO_LAYER } from "./dualview.jsx";
|
|
10
|
+
import { GhostSet, takeTracks } from "./ghost-set.js";
|
|
11
|
+
import { latestDraft, progressVersion, subscribeProgress } from "./agent-progress.js";
|
|
12
|
+
import { DRAFT_GHOST_COLOR, DRAFT_GHOST_OPACITY, draftGhostState, draftLabel, useDraftGhostShown } from "./draft-ghost.js";
|
|
13
|
+
|
|
14
|
+
// Kit parts can mount a frame after the take changes (view-ghosts.jsx does the same).
|
|
15
|
+
const SOURCE_PASSES = 3;
|
|
16
|
+
// Metres above the head joint; the label's height as a share of the view (sizeAttenuation off).
|
|
17
|
+
const LABEL_LIFT = 0.3, LABEL_VIEW_HEIGHT = 0.042, LABEL_PX = { w: 512, h: 96 };
|
|
18
|
+
const noRay = () => {};
|
|
19
|
+
const headBones = new WeakMap();
|
|
20
|
+
|
|
21
|
+
/** The ghost rig's head bone, found once per rig. */
|
|
22
|
+
function headOf(rig) {
|
|
23
|
+
if (!headBones.has(rig)) {
|
|
24
|
+
let head = null;
|
|
25
|
+
// "mixamorigHead" or "mixamorig:Head": the first depth-first one is the control bone playback.js poses
|
|
26
|
+
rig.traverse(node => { if (!head && node.isBone && /Head$/.test(node.name)) head = node; });
|
|
27
|
+
headBones.set(rig, head);
|
|
28
|
+
}
|
|
29
|
+
return headBones.get(rig);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** A screen-sized label sprite on GIZMO_LAYER, drawn over everything, never picked. */
|
|
33
|
+
function makeLabel() {
|
|
34
|
+
const canvas = document.createElement("canvas");
|
|
35
|
+
Object.assign(canvas, { width: LABEL_PX.w, height: LABEL_PX.h });
|
|
36
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
37
|
+
texture.colorSpace = THREE.SRGBColorSpace;
|
|
38
|
+
const sprite = new THREE.Sprite(new THREE.SpriteMaterial({ map: texture, transparent: true, depthTest: false, depthWrite: false, sizeAttenuation: false, toneMapped: false }));
|
|
39
|
+
sprite.center.set(0.5, 0);
|
|
40
|
+
sprite.renderOrder = 1000;
|
|
41
|
+
sprite.layers.set(GIZMO_LAYER);
|
|
42
|
+
sprite.raycast = noRay;
|
|
43
|
+
sprite.userData = { canvas, texture, text: null };
|
|
44
|
+
return sprite;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Paint `text` as a rounded tag (teal edge; green dot once QA is clean) and size the sprite to it. */
|
|
48
|
+
function paintLabel(sprite, text, clean) {
|
|
49
|
+
const { canvas, texture } = sprite.userData;
|
|
50
|
+
if (sprite.userData.text === `${text}|${clean}`) return;
|
|
51
|
+
sprite.userData.text = `${text}|${clean}`;
|
|
52
|
+
const g = canvas.getContext("2d"), font = "600 44px system-ui, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif";
|
|
53
|
+
g.font = font;
|
|
54
|
+
const pad = 26, dot = 34, width = Math.min(LABEL_PX.w - 4, Math.ceil(g.measureText(text).width) + pad * 2 + dot);
|
|
55
|
+
g.clearRect(0, 0, canvas.width, canvas.height);
|
|
56
|
+
g.fillStyle = "rgba(16, 24, 28, 0.82)";
|
|
57
|
+
g.strokeStyle = DRAFT_GHOST_COLOR;
|
|
58
|
+
g.lineWidth = 4;
|
|
59
|
+
g.beginPath();
|
|
60
|
+
g.roundRect((LABEL_PX.w - width) / 2, 8, width, LABEL_PX.h - 16, 30);
|
|
61
|
+
g.fill();
|
|
62
|
+
g.stroke();
|
|
63
|
+
g.fillStyle = clean ? "#46d36f" : DRAFT_GHOST_COLOR;
|
|
64
|
+
g.beginPath();
|
|
65
|
+
g.arc((LABEL_PX.w - width) / 2 + pad + 8, LABEL_PX.h / 2, 9, 0, Math.PI * 2);
|
|
66
|
+
g.fill();
|
|
67
|
+
g.fillStyle = "#eef6f3";
|
|
68
|
+
g.font = font;
|
|
69
|
+
g.textBaseline = "middle";
|
|
70
|
+
g.fillText(text, (LABEL_PX.w - width) / 2 + pad + dot, LABEL_PX.h / 2 + 2);
|
|
71
|
+
texture.needsUpdate = true;
|
|
72
|
+
sprite.scale.set(LABEL_VIEW_HEIGHT * (LABEL_PX.w / LABEL_PX.h), LABEL_VIEW_HEIGHT, 1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** One viewport frame of the draft ghost: pose the slot at the draft's own clock, tint it, and set the label over its head. */
|
|
76
|
+
function frameDraft({ set, label, draft, rig, scene, objects, propTake }) {
|
|
77
|
+
const state = draft ? draftGhostState(draft, Date.now()) : null;
|
|
78
|
+
const on = !!state?.shown && !!rig?.parent;
|
|
79
|
+
label.visible = on;
|
|
80
|
+
if (typeof window !== "undefined") window.__cozyclayDraftGhost = { set, label, draft, state, on };
|
|
81
|
+
if (!set.show(on)) return;
|
|
82
|
+
set.setRig(rig);
|
|
83
|
+
set.syncSources(scene, objects, draft.take, SOURCE_PASSES);
|
|
84
|
+
rig.parent.updateWorldMatrix(true, false);
|
|
85
|
+
set.update({ entries: [{ f: state.frame, side: "after", rank: 1 }], take: draft.take, placement: rig.parent.matrixWorld, propTake, objects, count: 1 });
|
|
86
|
+
const slot = set.slots[0];
|
|
87
|
+
slot.material.color.set(DRAFT_GHOST_COLOR).multiplyScalar(1.15);
|
|
88
|
+
slot.material.opacity = state.opacity;
|
|
89
|
+
const head = headOf(slot.rig);
|
|
90
|
+
if (!head) return;
|
|
91
|
+
set.object.updateMatrixWorld(true);
|
|
92
|
+
head.getWorldPosition(label.position);
|
|
93
|
+
label.position.y += LABEL_LIFT;
|
|
94
|
+
label.material.opacity = Math.min(1, state.opacity / DRAFT_GHOST_OPACITY);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** rigs: live rigs by character id; objects: the authored records (carried ones ride along). */
|
|
98
|
+
export function DraftGhost({ rigs, objects }) {
|
|
99
|
+
const version = useSyncExternalStore(subscribeProgress, progressVersion, progressVersion);
|
|
100
|
+
const draft = useMemo(() => latestDraft(), [version]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
101
|
+
const wanted = useDraftGhostShown();
|
|
102
|
+
const scene = useThree(state => state.scene), invalidate = useThree(state => state.invalidate);
|
|
103
|
+
const set = useMemo(() => new GhostSet({ layer: GIZMO_LAYER }), []);
|
|
104
|
+
const label = useMemo(() => makeLabel(), []);
|
|
105
|
+
const rig = draft ? rigs?.[draft.characterId] ?? null : null;
|
|
106
|
+
const active = wanted && !!rig && !!draft?.take;
|
|
107
|
+
const propTake = useMemo(() => (draft?.take ? { frameCount: draft.take.frameCount, fps: draft.take.fps, objectTracks: takeTracks(draft.take) } : null), [draft]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (!active) return undefined;
|
|
110
|
+
scene.add(set.object);
|
|
111
|
+
set.object.add(label);
|
|
112
|
+
return () => { set.object.remove(label); scene.remove(set.object); };
|
|
113
|
+
}, [active, scene, set, label]);
|
|
114
|
+
useEffect(() => () => {
|
|
115
|
+
set.dispose();
|
|
116
|
+
label.material.dispose();
|
|
117
|
+
label.userData.texture.dispose();
|
|
118
|
+
}, [set, label]);
|
|
119
|
+
useEffect(() => { if (draft) paintLabel(label, draftLabel(draft), draft.qa?.total === 0); }, [draft, label]);
|
|
120
|
+
// A shown ghost moves on its own clock: ask for frames at the take's rate, and one more once it is gone.
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
invalidate();
|
|
123
|
+
if (!active) return undefined;
|
|
124
|
+
const timer = setInterval(() => { if (draftGhostState(draft, Date.now()).shown || set.object.visible) invalidate(); }, 1000 / (draft.take.fps || 24));
|
|
125
|
+
return () => clearInterval(timer);
|
|
126
|
+
}, [active, draft, set, invalidate]);
|
|
127
|
+
useFrame(() => frameDraft({ set, label, draft: active ? draft : null, rig, scene, objects, propTake }));
|
|
128
|
+
return null;
|
|
129
|
+
}
|
package/src/dualview.jsx
CHANGED
|
@@ -100,7 +100,7 @@ const EDGE_FRAGMENT = `
|
|
|
100
100
|
float depthLine = smoothstep(0.055, 0.16, depthEdge);
|
|
101
101
|
float normalLine = smoothstep(0.7, 1.7, normalEdge);
|
|
102
102
|
float edge = max(depthLine * foregroundOwner, normalLine * 0.68);
|
|
103
|
-
gl_FragColor = vec4(edgeColor, edge * 0.
|
|
103
|
+
gl_FragColor = vec4(edgeColor, edge * 0.38 * distanceFade);
|
|
104
104
|
}
|
|
105
105
|
`;
|
|
106
106
|
|
|
@@ -349,10 +349,11 @@ export function DualRender({ stageRef, mainRef, insetRef, shotPreviewRef, shotCa
|
|
|
349
349
|
// grazing angle its depth runs away fast enough that the depth
|
|
350
350
|
// kernel inked the whole far floor as a dark band under the
|
|
351
351
|
// horizon. Without it in the prepass, figures still outline
|
|
352
|
-
// against the cleared depth behind them.
|
|
352
|
+
// against the cleared depth behind them. A glow halo (beautyOnly)
|
|
353
|
+
// is light, not a surface: it takes no ink either.
|
|
353
354
|
const cutouts = [];
|
|
354
355
|
scene.traverse((node) => {
|
|
355
|
-
if ((node.userData?.cutoutTexture !== undefined || node.userData?.noInk) && node.visible) {
|
|
356
|
+
if ((node.userData?.cutoutTexture !== undefined || node.userData?.noInk || node.userData?.beautyOnly) && node.visible) {
|
|
356
357
|
cutouts.push(node);
|
|
357
358
|
node.visible = false;
|
|
358
359
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Effects in the set: the particles and trails of every effect record, plus
|
|
3
|
+
* the editor-only marker that lets an emitter be picked and moved.
|
|
4
|
+
*
|
|
5
|
+
* Particles live in WORLD space under SetProps, not under the emitter's own
|
|
6
|
+
* group: a puff already in the air keeps drifting when its emitter moves on
|
|
7
|
+
* or is hidden (an exhale ends, a cigarette goes back in the pocket). They
|
|
8
|
+
* are placed imperatively from the frame ref, like a prop, and registered in
|
|
9
|
+
* the props registry, so the recorder's "place every prop now" pass redraws
|
|
10
|
+
* them for the frame it is about to capture.
|
|
11
|
+
*/
|
|
12
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
13
|
+
import { useFrame } from "@react-three/fiber";
|
|
14
|
+
import * as THREE from "three";
|
|
15
|
+
import { GIZMO_LAYER } from "../dualview.jsx";
|
|
16
|
+
import { createEffectMeshes } from "./effect-meshes.js";
|
|
17
|
+
import { effectSceneOf, publishEffectScene } from "./state.js";
|
|
18
|
+
|
|
19
|
+
/** The props-registry key the effects pass is filed under (never an object id). */
|
|
20
|
+
const EFFECTS_ENTRY = Symbol("effects");
|
|
21
|
+
const MARKER_COLOR = "#7fd4f0";
|
|
22
|
+
const onGizmoLayer = (node) => {
|
|
23
|
+
if (node) node.layers.set(GIZMO_LAYER);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* An emitter's viewport presence, editor furniture like an Empty's cross:
|
|
28
|
+
* a small diamond with an arrow up its local +Y (where particles are thrown)
|
|
29
|
+
* or, for a trail, a bar along local Y as wide as the ribbon. On GIZMO_LAYER,
|
|
30
|
+
* so no shot, capture or export ever draws it, with an invisible pick volume.
|
|
31
|
+
*/
|
|
32
|
+
export function EffectMarker({ object }) {
|
|
33
|
+
const trail = object.effect?.preset === "trail";
|
|
34
|
+
const half = trail ? Math.max(0.05, (object.effect?.width ?? 0.5) / 2) : 0.06;
|
|
35
|
+
const lines = useMemo(() => {
|
|
36
|
+
const d = 0.05;
|
|
37
|
+
const diamond = [[d, 0, 0], [0, d, 0], [0, d, 0], [-d, 0, 0], [-d, 0, 0], [0, -d, 0], [0, -d, 0], [d, 0, 0],
|
|
38
|
+
[0, 0, d], [0, d, 0], [0, d, 0], [0, 0, -d], [0, 0, -d], [0, -d, 0], [0, -d, 0], [0, 0, d]];
|
|
39
|
+
const marks = trail
|
|
40
|
+
? [[0, -half, 0], [0, half, 0], [-0.03, -half, 0], [0.03, -half, 0], [-0.03, half, 0], [0.03, half, 0]]
|
|
41
|
+
: [[0, d, 0], [0, 0.16, 0], [0, 0.16, 0], [0.025, 0.12, 0], [0, 0.16, 0], [-0.025, 0.12, 0]];
|
|
42
|
+
const geometry = new THREE.BufferGeometry();
|
|
43
|
+
geometry.setAttribute("position", new THREE.Float32BufferAttribute([...diamond, ...marks].flat(), 3));
|
|
44
|
+
return geometry;
|
|
45
|
+
}, [trail, half]);
|
|
46
|
+
useEffect(() => () => lines.dispose(), [lines]);
|
|
47
|
+
return (
|
|
48
|
+
<group userData={{ effectMarker: true }}>
|
|
49
|
+
<lineSegments ref={onGizmoLayer} geometry={lines} renderOrder={997} frustumCulled={false}>
|
|
50
|
+
<lineBasicMaterial color={MARKER_COLOR} depthTest={false} depthWrite={false} transparent opacity={0.95} />
|
|
51
|
+
</lineSegments>
|
|
52
|
+
<mesh ref={onGizmoLayer} visible={false} userData={{ emptyPick: true }}>
|
|
53
|
+
<sphereGeometry args={[0.08, 12, 8]} />
|
|
54
|
+
<meshBasicMaterial />
|
|
55
|
+
</mesh>
|
|
56
|
+
</group>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** A record pinned to a bone emits from where the bone is now: its prop is
|
|
61
|
+
* placed first, then its world matrix read back from the props registry. */
|
|
62
|
+
const liveWorld = (registryRef) => (id, out) => {
|
|
63
|
+
const entry = registryRef?.current?.get(id);
|
|
64
|
+
if (!entry) return null;
|
|
65
|
+
entry.place();
|
|
66
|
+
return entry.world(out);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Every effect record's particles at the frame in `frameRef`. `objects` are
|
|
71
|
+
* the AUTHORED records (a take can hide an emitter at the current frame while
|
|
72
|
+
* its smoke is still in the air); `registryRef` is SetProps' placement
|
|
73
|
+
* registry, which the recorder's sync pass walks.
|
|
74
|
+
*/
|
|
75
|
+
export function EffectsLayer({ objects, frameRef = null, take = null, registryRef = null, fadeOpacity = null }) {
|
|
76
|
+
const base = useMemo(() => effectSceneOf(objects), [objects]);
|
|
77
|
+
const any = base.records.length > 0;
|
|
78
|
+
const meshes = useMemo(() => (any ? createEffectMeshes() : null), [any]);
|
|
79
|
+
useEffect(() => () => meshes?.dispose(), [meshes]);
|
|
80
|
+
const live = useMemo(() => liveWorld(registryRef), [registryRef]);
|
|
81
|
+
const scene = useMemo(() => ({ ...base, take: take ?? {}, live }), [base, take, live]);
|
|
82
|
+
const drawnRef = useRef(null);
|
|
83
|
+
const place = () => {
|
|
84
|
+
if (!meshes) return;
|
|
85
|
+
const frame = frameRef?.current ?? 0, opacity = fadeOpacity ?? 1;
|
|
86
|
+
const key = [frame, scene, opacity];
|
|
87
|
+
const attached = scene.records.some((record) => record.attach);
|
|
88
|
+
if (!attached && drawnRef.current?.every((value, i) => value === key[i])) return;
|
|
89
|
+
drawnRef.current = key;
|
|
90
|
+
meshes.update(scene, frame, opacity);
|
|
91
|
+
};
|
|
92
|
+
useFrame(place);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
publishEffectScene(() => scene);
|
|
95
|
+
return () => publishEffectScene(null);
|
|
96
|
+
}, [scene]);
|
|
97
|
+
// Re-filed every render, so the recorder's pass runs this render's
|
|
98
|
+
// placement and runs it after every prop (an attached emitter reads one).
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
const registry = registryRef?.current;
|
|
101
|
+
if (!registry || !meshes) return undefined;
|
|
102
|
+
registry.set(EFFECTS_ENTRY, { place, world: () => null });
|
|
103
|
+
return () => { registry.delete(EFFECTS_ENTRY); };
|
|
104
|
+
});
|
|
105
|
+
if (!meshes) return null;
|
|
106
|
+
return (
|
|
107
|
+
<>
|
|
108
|
+
<primitive object={meshes.particles} />
|
|
109
|
+
<primitive object={meshes.ribbons} />
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
112
|
+
}
|