@clockgrove/assetgrove 0.0.0-stage → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +277 -2
- package/dist/animation/commands.d.ts +180 -0
- package/dist/animation/commands.js +515 -0
- package/dist/animation/facing.d.ts +44 -0
- package/dist/animation/facing.js +100 -0
- package/dist/animation/fix.d.ts +136 -0
- package/dist/animation/fix.js +529 -0
- package/dist/animation/flicker.d.ts +44 -0
- package/dist/animation/flicker.js +117 -0
- package/dist/animation/halo.d.ts +72 -0
- package/dist/animation/halo.js +253 -0
- package/dist/animation/holes.d.ts +122 -0
- package/dist/animation/holes.js +262 -0
- package/dist/animation/preview.d.ts +38 -0
- package/dist/animation/preview.js +161 -0
- package/dist/animation/qa.d.ts +57 -0
- package/dist/animation/qa.js +418 -0
- package/dist/animation/run.d.ts +109 -0
- package/dist/animation/run.js +182 -0
- package/dist/animation/strip.d.ts +13 -0
- package/dist/animation/strip.js +41 -0
- package/dist/animation/template-choice.d.ts +75 -0
- package/dist/animation/template-choice.js +153 -0
- package/dist/animation/templates.d.ts +39 -0
- package/dist/animation/templates.js +333 -0
- package/dist/animation/types.d.ts +257 -0
- package/dist/animation/types.js +1 -0
- package/dist/approvals.d.ts +156 -0
- package/dist/approvals.js +369 -0
- package/dist/audio/aac.d.ts +61 -0
- package/dist/audio/aac.js +152 -0
- package/dist/audio/checks.d.ts +38 -0
- package/dist/audio/checks.js +254 -0
- package/dist/audio/delivery.d.ts +52 -0
- package/dist/audio/delivery.js +105 -0
- package/dist/audio/engine.d.ts +65 -0
- package/dist/audio/engine.js +164 -0
- package/dist/audio/handoff.d.ts +75 -0
- package/dist/audio/handoff.js +185 -0
- package/dist/audio/kinds.d.ts +6 -0
- package/dist/audio/kinds.js +315 -0
- package/dist/audio/loudness.d.ts +22 -0
- package/dist/audio/loudness.js +72 -0
- package/dist/audio/ogg.d.ts +27 -0
- package/dist/audio/ogg.js +65 -0
- package/dist/audio/operations.d.ts +20 -0
- package/dist/audio/operations.js +335 -0
- package/dist/audio/opus.d.ts +40 -0
- package/dist/audio/opus.js +108 -0
- package/dist/audio/profile.d.ts +200 -0
- package/dist/audio/profile.js +126 -0
- package/dist/audio/run.d.ts +83 -0
- package/dist/audio/run.js +192 -0
- package/dist/audio/vorbis-comments.d.ts +25 -0
- package/dist/audio/vorbis-comments.js +243 -0
- package/dist/audio/waveform.d.ts +13 -0
- package/dist/audio/waveform.js +52 -0
- package/dist/audio-parameters.d.ts +17 -0
- package/dist/audio-parameters.js +45 -0
- package/dist/audit/bar.d.ts +65 -0
- package/dist/audit/bar.js +97 -0
- package/dist/audit/members.d.ts +40 -0
- package/dist/audit/members.js +119 -0
- package/dist/bible-view.d.ts +10 -0
- package/dist/bible-view.js +122 -0
- package/dist/bible.d.ts +272 -0
- package/dist/bible.js +641 -0
- package/dist/budget.d.ts +119 -0
- package/dist/budget.js +227 -0
- package/dist/call-parameters.d.ts +71 -0
- package/dist/call-parameters.js +90 -0
- package/dist/calls.d.ts +145 -0
- package/dist/calls.js +788 -0
- package/dist/cli/main.d.ts +22 -0
- package/dist/cli/main.js +137 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/commands/animation-qa.d.ts +1 -0
- package/dist/commands/animation-qa.js +240 -0
- package/dist/commands/apply.d.ts +12 -0
- package/dist/commands/apply.js +181 -0
- package/dist/commands/audit.d.ts +92 -0
- package/dist/commands/audit.js +555 -0
- package/dist/commands/bible.d.ts +1 -0
- package/dist/commands/bible.js +39 -0
- package/dist/commands/browse.d.ts +12 -0
- package/dist/commands/browse.js +113 -0
- package/dist/commands/card.d.ts +3 -0
- package/dist/commands/card.js +445 -0
- package/dist/commands/compare.d.ts +1 -0
- package/dist/commands/compare.js +90 -0
- package/dist/commands/confirm.d.ts +1 -0
- package/dist/commands/confirm.js +267 -0
- package/dist/commands/context.d.ts +43 -0
- package/dist/commands/context.js +115 -0
- package/dist/commands/deliver.d.ts +1 -0
- package/dist/commands/deliver.js +99 -0
- package/dist/commands/disclosure.d.ts +1 -0
- package/dist/commands/disclosure.js +80 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +112 -0
- package/dist/commands/estimate.d.ts +2 -0
- package/dist/commands/estimate.js +80 -0
- package/dist/commands/extensions.d.ts +2 -0
- package/dist/commands/extensions.js +70 -0
- package/dist/commands/fix-frame.d.ts +1 -0
- package/dist/commands/fix-frame.js +206 -0
- package/dist/commands/generate-sheet.d.ts +1 -0
- package/dist/commands/generate-sheet.js +245 -0
- package/dist/commands/identity-check.d.ts +1 -0
- package/dist/commands/identity-check.js +110 -0
- package/dist/commands/identity-eval.d.ts +1 -0
- package/dist/commands/identity-eval.js +197 -0
- package/dist/commands/import.d.ts +7 -0
- package/dist/commands/import.js +472 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +117 -0
- package/dist/commands/intake.d.ts +1 -0
- package/dist/commands/intake.js +56 -0
- package/dist/commands/labels.d.ts +1 -0
- package/dist/commands/labels.js +101 -0
- package/dist/commands/library.d.ts +9 -0
- package/dist/commands/library.js +711 -0
- package/dist/commands/lod.d.ts +1 -0
- package/dist/commands/lod.js +93 -0
- package/dist/commands/look-dev.d.ts +1 -0
- package/dist/commands/look-dev.js +148 -0
- package/dist/commands/materials.d.ts +1 -0
- package/dist/commands/materials.js +223 -0
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.js +53 -0
- package/dist/commands/migrate.d.ts +1 -0
- package/dist/commands/migrate.js +123 -0
- package/dist/commands/op.d.ts +5 -0
- package/dist/commands/op.js +114 -0
- package/dist/commands/ops.d.ts +1 -0
- package/dist/commands/ops.js +17 -0
- package/dist/commands/pick-batch.d.ts +24 -0
- package/dist/commands/pick-batch.js +343 -0
- package/dist/commands/pick.d.ts +48 -0
- package/dist/commands/pick.js +469 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.js +156 -0
- package/dist/commands/recipe.d.ts +1 -0
- package/dist/commands/recipe.js +52 -0
- package/dist/commands/registry.d.ts +5 -0
- package/dist/commands/registry.js +121 -0
- package/dist/commands/render-sprite.d.ts +1 -0
- package/dist/commands/render-sprite.js +67 -0
- package/dist/commands/rendition.d.ts +1 -0
- package/dist/commands/rendition.js +56 -0
- package/dist/commands/request-change.d.ts +2 -0
- package/dist/commands/request-change.js +950 -0
- package/dist/commands/result.d.ts +34 -0
- package/dist/commands/result.js +237 -0
- package/dist/commands/review.d.ts +28 -0
- package/dist/commands/review.js +444 -0
- package/dist/commands/rig.d.ts +1 -0
- package/dist/commands/rig.js +74 -0
- package/dist/commands/runner.d.ts +45 -0
- package/dist/commands/runner.js +297 -0
- package/dist/commands/runs.d.ts +22 -0
- package/dist/commands/runs.js +159 -0
- package/dist/commands/search.d.ts +69 -0
- package/dist/commands/search.js +638 -0
- package/dist/commands/settings.d.ts +2 -0
- package/dist/commands/settings.js +284 -0
- package/dist/commands/spend.d.ts +2 -0
- package/dist/commands/spend.js +159 -0
- package/dist/commands/stage-source.d.ts +1 -0
- package/dist/commands/stage-source.js +58 -0
- package/dist/commands/stage.d.ts +9 -0
- package/dist/commands/stage.js +229 -0
- package/dist/commands/storage.d.ts +3 -0
- package/dist/commands/storage.js +200 -0
- package/dist/commands/turnaround.d.ts +1 -0
- package/dist/commands/turnaround.js +171 -0
- package/dist/commands/types.d.ts +195 -0
- package/dist/commands/types.js +7 -0
- package/dist/commands/vary.d.ts +2 -0
- package/dist/commands/vary.js +222 -0
- package/dist/commands/write-families.d.ts +14 -0
- package/dist/commands/write-families.js +158 -0
- package/dist/compare.d.ts +87 -0
- package/dist/compare.js +306 -0
- package/dist/confirm/delegation.d.ts +30 -0
- package/dist/confirm/delegation.js +31 -0
- package/dist/confirm/index.d.ts +84 -0
- package/dist/confirm/index.js +176 -0
- package/dist/confirm/mcp.d.ts +60 -0
- package/dist/confirm/mcp.js +253 -0
- package/dist/confirm/pending.d.ts +11 -0
- package/dist/confirm/pending.js +40 -0
- package/dist/confirm/prompt.d.ts +65 -0
- package/dist/confirm/prompt.js +68 -0
- package/dist/confirm/records.d.ts +17 -0
- package/dist/confirm/records.js +63 -0
- package/dist/contact.d.ts +80 -0
- package/dist/contact.js +224 -0
- package/dist/credentials.d.ts +170 -0
- package/dist/credentials.js +598 -0
- package/dist/dataflows.d.ts +32 -0
- package/dist/dataflows.js +42 -0
- package/dist/delivery.d.ts +89 -0
- package/dist/delivery.js +355 -0
- package/dist/disclosure.d.ts +84 -0
- package/dist/disclosure.js +397 -0
- package/dist/env.d.ts +90 -0
- package/dist/env.js +236 -0
- package/dist/errors.d.ts +90 -0
- package/dist/errors.js +105 -0
- package/dist/extension/api.d.ts +389 -0
- package/dist/extension/api.js +20 -0
- package/dist/extension/context.d.ts +9 -0
- package/dist/extension/context.js +60 -0
- package/dist/extension/helpers.d.ts +75 -0
- package/dist/extension/helpers.js +107 -0
- package/dist/extension/http.d.ts +32 -0
- package/dist/extension/http.js +104 -0
- package/dist/extension/setup.d.ts +53 -0
- package/dist/extension/setup.js +162 -0
- package/dist/extension/tools.d.ts +97 -0
- package/dist/extension/tools.js +235 -0
- package/dist/extensions/core.d.ts +7 -0
- package/dist/extensions/core.js +18 -0
- package/dist/extensions/errors.d.ts +22 -0
- package/dist/extensions/errors.js +34 -0
- package/dist/extensions/registry.d.ts +119 -0
- package/dist/extensions/registry.js +535 -0
- package/dist/extensions/version.d.ts +9 -0
- package/dist/extensions/version.js +57 -0
- package/dist/formats.d.ts +46 -0
- package/dist/formats.js +81 -0
- package/dist/frames.d.ts +58 -0
- package/dist/frames.js +80 -0
- package/dist/gateway/anthropic.d.ts +22 -0
- package/dist/gateway/anthropic.js +65 -0
- package/dist/gateway/elevenlabs.d.ts +36 -0
- package/dist/gateway/elevenlabs.js +192 -0
- package/dist/gateway/failure.d.ts +29 -0
- package/dist/gateway/failure.js +70 -0
- package/dist/gateway/openai-compatible.d.ts +20 -0
- package/dist/gateway/openai-compatible.js +76 -0
- package/dist/gateway/openai.d.ts +28 -0
- package/dist/gateway/openai.js +101 -0
- package/dist/gateway/provider.d.ts +380 -0
- package/dist/gateway/provider.js +5 -0
- package/dist/gateway/scripted.d.ts +252 -0
- package/dist/gateway/scripted.js +244 -0
- package/dist/gateway/stability.d.ts +38 -0
- package/dist/gateway/stability.js +232 -0
- package/dist/gateway/structured.d.ts +31 -0
- package/dist/gateway/structured.js +83 -0
- package/dist/gateway/tripo.d.ts +48 -0
- package/dist/gateway/tripo.js +374 -0
- package/dist/gateway/vercel.d.ts +52 -0
- package/dist/gateway/vercel.js +298 -0
- package/dist/generators/generator.d.ts +236 -0
- package/dist/generators/generator.js +12 -0
- package/dist/generators/image.d.ts +21 -0
- package/dist/generators/image.js +286 -0
- package/dist/generators/spec-schema.d.ts +29 -0
- package/dist/generators/spec-schema.js +21 -0
- package/dist/git-marker.d.ts +3 -0
- package/dist/git-marker.js +13 -0
- package/dist/gitlfs.d.ts +38 -0
- package/dist/gitlfs.js +171 -0
- package/dist/guard.d.ts +55 -0
- package/dist/guard.js +323 -0
- package/dist/handoff/current-profile.d.ts +48 -0
- package/dist/handoff/current-profile.js +127 -0
- package/dist/handoff/doctor.d.ts +26 -0
- package/dist/handoff/doctor.js +249 -0
- package/dist/handoff/mark-check.d.ts +17 -0
- package/dist/handoff/mark-check.js +66 -0
- package/dist/handoff/presets/aseprite-json.d.ts +5 -0
- package/dist/handoff/presets/aseprite-json.js +45 -0
- package/dist/handoff/presets/atlas-json.d.ts +44 -0
- package/dist/handoff/presets/atlas-json.js +195 -0
- package/dist/handoff/presets/atlas-pack.d.ts +14 -0
- package/dist/handoff/presets/atlas-pack.js +431 -0
- package/dist/handoff/presets/index.d.ts +273 -0
- package/dist/handoff/presets/index.js +58 -0
- package/dist/handoff/presets/manifest.d.ts +2 -0
- package/dist/handoff/presets/manifest.js +49 -0
- package/dist/handoff/usage.d.ts +27 -0
- package/dist/handoff/usage.js +159 -0
- package/dist/handoff.d.ts +345 -0
- package/dist/handoff.js +1221 -0
- package/dist/identity-eval.d.ts +156 -0
- package/dist/identity-eval.js +321 -0
- package/dist/identity.d.ts +293 -0
- package/dist/identity.js +675 -0
- package/dist/image/apply-style.d.ts +4 -0
- package/dist/image/apply-style.js +37 -0
- package/dist/image/digits.d.ts +5 -0
- package/dist/image/digits.js +40 -0
- package/dist/image/ktx2.d.ts +83 -0
- package/dist/image/ktx2.js +196 -0
- package/dist/image/raster.d.ts +23 -0
- package/dist/image/raster.js +77 -0
- package/dist/image/resample.d.ts +10 -0
- package/dist/image/resample.js +82 -0
- package/dist/image/webp.d.ts +17 -0
- package/dist/image/webp.js +323 -0
- package/dist/init.d.ts +132 -0
- package/dist/init.js +425 -0
- package/dist/inputs.d.ts +67 -0
- package/dist/inputs.js +151 -0
- package/dist/json.d.ts +7 -0
- package/dist/json.js +27 -0
- package/dist/keys.d.ts +34 -0
- package/dist/keys.js +198 -0
- package/dist/kind-schemas.d.ts +17 -0
- package/dist/kind-schemas.js +205 -0
- package/dist/library/actions.d.ts +76 -0
- package/dist/library/actions.js +212 -0
- package/dist/library/adopt.d.ts +177 -0
- package/dist/library/adopt.js +624 -0
- package/dist/library/canonical.d.ts +7 -0
- package/dist/library/canonical.js +29 -0
- package/dist/library/card.d.ts +138 -0
- package/dist/library/card.js +532 -0
- package/dist/library/credits.d.ts +70 -0
- package/dist/library/credits.js +222 -0
- package/dist/library/describe.d.ts +48 -0
- package/dist/library/describe.js +199 -0
- package/dist/library/diff.d.ts +26 -0
- package/dist/library/diff.js +208 -0
- package/dist/library/exact.d.ts +15 -0
- package/dist/library/exact.js +47 -0
- package/dist/library/extent.d.ts +56 -0
- package/dist/library/extent.js +205 -0
- package/dist/library/folder.d.ts +85 -0
- package/dist/library/folder.js +291 -0
- package/dist/library/labels.d.ts +29 -0
- package/dist/library/labels.js +112 -0
- package/dist/library/lfs.d.ts +42 -0
- package/dist/library/lfs.js +140 -0
- package/dist/library/maintain.d.ts +100 -0
- package/dist/library/maintain.js +750 -0
- package/dist/library/media-metadata.d.ts +19 -0
- package/dist/library/media-metadata.js +92 -0
- package/dist/library/paths.d.ts +7 -0
- package/dist/library/paths.js +65 -0
- package/dist/library/relations.d.ts +59 -0
- package/dist/library/relations.js +176 -0
- package/dist/library/review.d.ts +204 -0
- package/dist/library/review.js +545 -0
- package/dist/library/stale.d.ts +88 -0
- package/dist/library/stale.js +229 -0
- package/dist/library/suggestions.d.ts +37 -0
- package/dist/library/suggestions.js +146 -0
- package/dist/library/summary.d.ts +65 -0
- package/dist/library/summary.js +138 -0
- package/dist/library/undo.d.ts +18 -0
- package/dist/library/undo.js +141 -0
- package/dist/library/worklist.d.ts +42 -0
- package/dist/library/worklist.js +91 -0
- package/dist/library/write.d.ts +282 -0
- package/dist/library/write.js +790 -0
- package/dist/license.d.ts +67 -0
- package/dist/license.js +205 -0
- package/dist/limits.d.ts +51 -0
- package/dist/limits.js +100 -0
- package/dist/loop.d.ts +244 -0
- package/dist/loop.js +377 -0
- package/dist/material/core.d.ts +70 -0
- package/dist/material/core.js +238 -0
- package/dist/material/engine.d.ts +15 -0
- package/dist/material/engine.js +141 -0
- package/dist/material/flicker.d.ts +26 -0
- package/dist/material/flicker.js +71 -0
- package/dist/material/operations.d.ts +2 -0
- package/dist/material/operations.js +48 -0
- package/dist/material/pipeline.d.ts +51 -0
- package/dist/material/pipeline.js +431 -0
- package/dist/material/profile.d.ts +29 -0
- package/dist/material/profile.js +97 -0
- package/dist/material/rendition.d.ts +5 -0
- package/dist/material/rendition.js +76 -0
- package/dist/mcp.d.ts +72 -0
- package/dist/mcp.js +514 -0
- package/dist/media.d.ts +36 -0
- package/dist/media.js +46 -0
- package/dist/metadata.d.ts +61 -0
- package/dist/metadata.js +748 -0
- package/dist/model-declarations.d.ts +28 -0
- package/dist/model-declarations.js +14 -0
- package/dist/model3d/clip-map.d.ts +49 -0
- package/dist/model3d/clip-map.js +129 -0
- package/dist/model3d/core-checks.d.ts +61 -0
- package/dist/model3d/core-checks.js +278 -0
- package/dist/model3d/facing.d.ts +49 -0
- package/dist/model3d/facing.js +125 -0
- package/dist/model3d/generator.d.ts +19 -0
- package/dist/model3d/generator.js +482 -0
- package/dist/model3d/glb.d.ts +120 -0
- package/dist/model3d/glb.js +155 -0
- package/dist/model3d/handoff.d.ts +37 -0
- package/dist/model3d/handoff.js +131 -0
- package/dist/model3d/lod/chain.d.ts +50 -0
- package/dist/model3d/lod/chain.js +447 -0
- package/dist/model3d/lod/command.d.ts +38 -0
- package/dist/model3d/lod/command.js +377 -0
- package/dist/model3d/lod/qa.d.ts +36 -0
- package/dist/model3d/lod/qa.js +189 -0
- package/dist/model3d/lod/settings.d.ts +36 -0
- package/dist/model3d/lod/settings.js +137 -0
- package/dist/model3d/lod/simplify.d.ts +35 -0
- package/dist/model3d/lod/simplify.js +337 -0
- package/dist/model3d/lod/textures.d.ts +46 -0
- package/dist/model3d/lod/textures.js +190 -0
- package/dist/model3d/lookdev/command.d.ts +219 -0
- package/dist/model3d/lookdev/command.js +1795 -0
- package/dist/model3d/lookdev/edit.d.ts +44 -0
- package/dist/model3d/lookdev/edit.js +241 -0
- package/dist/model3d/lookdev/groom.d.ts +86 -0
- package/dist/model3d/lookdev/groom.js +462 -0
- package/dist/model3d/lookdev/markings.d.ts +98 -0
- package/dist/model3d/lookdev/markings.js +319 -0
- package/dist/model3d/lookdev/project.d.ts +100 -0
- package/dist/model3d/lookdev/project.js +721 -0
- package/dist/model3d/lookdev/settings.d.ts +65 -0
- package/dist/model3d/lookdev/settings.js +103 -0
- package/dist/model3d/lookdev/texels.d.ts +32 -0
- package/dist/model3d/lookdev/texels.js +192 -0
- package/dist/model3d/profile.d.ts +101 -0
- package/dist/model3d/profile.js +132 -0
- package/dist/model3d/prop.d.ts +29 -0
- package/dist/model3d/prop.js +317 -0
- package/dist/model3d/qa.d.ts +27 -0
- package/dist/model3d/qa.js +105 -0
- package/dist/model3d/render.d.ts +172 -0
- package/dist/model3d/render.js +791 -0
- package/dist/model3d/rig/build.d.ts +14 -0
- package/dist/model3d/rig/build.js +210 -0
- package/dist/model3d/rig/candidate.d.ts +50 -0
- package/dist/model3d/rig/candidate.js +132 -0
- package/dist/model3d/rig/command.d.ts +50 -0
- package/dist/model3d/rig/command.js +229 -0
- package/dist/model3d/rig/fit.d.ts +88 -0
- package/dist/model3d/rig/fit.js +568 -0
- package/dist/model3d/rig/gait.d.ts +105 -0
- package/dist/model3d/rig/gait.js +334 -0
- package/dist/model3d/rig/math.d.ts +27 -0
- package/dist/model3d/rig/math.js +92 -0
- package/dist/model3d/rig/motion.d.ts +26 -0
- package/dist/model3d/rig/motion.js +223 -0
- package/dist/model3d/rig/qa.d.ts +76 -0
- package/dist/model3d/rig/qa.js +357 -0
- package/dist/model3d/rig/rig.d.ts +55 -0
- package/dist/model3d/rig/rig.js +213 -0
- package/dist/model3d/rig/template.d.ts +195 -0
- package/dist/model3d/rig/template.js +456 -0
- package/dist/model3d/scene.d.ts +115 -0
- package/dist/model3d/scene.js +684 -0
- package/dist/model3d/views.d.ts +77 -0
- package/dist/model3d/views.js +190 -0
- package/dist/origin.d.ts +162 -0
- package/dist/origin.js +134 -0
- package/dist/paths.d.ts +53 -0
- package/dist/paths.js +240 -0
- package/dist/planning.d.ts +261 -0
- package/dist/planning.js +1470 -0
- package/dist/policy/blocklist.d.ts +28 -0
- package/dist/policy/blocklist.js +58 -0
- package/dist/policy/brief.d.ts +67 -0
- package/dist/policy/brief.js +110 -0
- package/dist/policy/cuts.d.ts +26 -0
- package/dist/policy/cuts.js +80 -0
- package/dist/policy/model.d.ts +69 -0
- package/dist/policy/model.js +202 -0
- package/dist/policy/text.d.ts +183 -0
- package/dist/policy/text.js +285 -0
- package/dist/postprocess.d.ts +68 -0
- package/dist/postprocess.js +302 -0
- package/dist/profile.d.ts +5 -0
- package/dist/profile.js +98 -0
- package/dist/project-rules.d.ts +54 -0
- package/dist/project-rules.js +105 -0
- package/dist/provenance-binding.d.ts +55 -0
- package/dist/provenance-binding.js +352 -0
- package/dist/providers/adapter.d.ts +176 -0
- package/dist/providers/adapter.js +418 -0
- package/dist/providers/index.d.ts +33 -0
- package/dist/providers/index.js +49 -0
- package/dist/providers/script.d.ts +13 -0
- package/dist/providers/script.js +65 -0
- package/dist/providers/set.d.ts +76 -0
- package/dist/providers/set.js +134 -0
- package/dist/pure-cbor.d.ts +1 -0
- package/dist/pure-cbor.js +8 -0
- package/dist/qa/stability.d.ts +215 -0
- package/dist/qa/stability.js +393 -0
- package/dist/qa/stability.json +32 -0
- package/dist/qa.d.ts +36 -0
- package/dist/qa.js +148 -0
- package/dist/reconcile.d.ts +111 -0
- package/dist/reconcile.js +416 -0
- package/dist/redact.d.ts +29 -0
- package/dist/redact.js +74 -0
- package/dist/regions.d.ts +49 -0
- package/dist/regions.js +113 -0
- package/dist/release-policy.d.ts +99 -0
- package/dist/release-policy.js +266 -0
- package/dist/request.d.ts +74 -0
- package/dist/request.js +249 -0
- package/dist/routes.d.ts +327 -0
- package/dist/routes.js +1166 -0
- package/dist/runs/dir.d.ts +33 -0
- package/dist/runs/dir.js +30 -0
- package/dist/runs/execute.d.ts +86 -0
- package/dist/runs/execute.js +422 -0
- package/dist/runs/journal.d.ts +150 -0
- package/dist/runs/journal.js +216 -0
- package/dist/runs/lock.d.ts +57 -0
- package/dist/runs/lock.js +322 -0
- package/dist/runs/plan.d.ts +261 -0
- package/dist/runs/plan.js +404 -0
- package/dist/search/near-match.d.ts +32 -0
- package/dist/search/near-match.js +86 -0
- package/dist/search/reader.d.ts +17 -0
- package/dist/search/reader.js +334 -0
- package/dist/search/sheet.d.ts +4 -0
- package/dist/search/sheet.js +28 -0
- package/dist/search/style-outliers.d.ts +77 -0
- package/dist/search/style-outliers.js +166 -0
- package/dist/settings-write.d.ts +78 -0
- package/dist/settings-write.js +374 -0
- package/dist/settings.d.ts +436 -0
- package/dist/settings.js +622 -0
- package/dist/shared-settings.d.ts +4 -0
- package/dist/shared-settings.js +24 -0
- package/dist/sheet/blobs.d.ts +33 -0
- package/dist/sheet/blobs.js +145 -0
- package/dist/sheet/generate.d.ts +71 -0
- package/dist/sheet/generate.js +278 -0
- package/dist/sheet/group.d.ts +20 -0
- package/dist/sheet/group.js +191 -0
- package/dist/sheet/import.d.ts +315 -0
- package/dist/sheet/import.js +832 -0
- package/dist/sheet/matte.d.ts +25 -0
- package/dist/sheet/matte.js +508 -0
- package/dist/sheet/media-import.d.ts +41 -0
- package/dist/sheet/media-import.js +118 -0
- package/dist/sheet/register.d.ts +17 -0
- package/dist/sheet/register.js +176 -0
- package/dist/sheet/slice.d.ts +73 -0
- package/dist/sheet/slice.js +912 -0
- package/dist/sheet/types.d.ts +225 -0
- package/dist/sheet/types.js +1 -0
- package/dist/source/aseprite.d.ts +14 -0
- package/dist/source/aseprite.js +124 -0
- package/dist/source/stage.d.ts +24 -0
- package/dist/source/stage.js +172 -0
- package/dist/spend.d.ts +220 -0
- package/dist/spend.js +436 -0
- package/dist/sprite/render.d.ts +22 -0
- package/dist/sprite/render.js +272 -0
- package/dist/storage.d.ts +135 -0
- package/dist/storage.js +405 -0
- package/dist/style.d.ts +19 -0
- package/dist/style.js +26 -0
- package/dist/template.d.ts +29 -0
- package/dist/template.js +98 -0
- package/dist/testing/aseprite.d.ts +54 -0
- package/dist/testing/aseprite.js +191 -0
- package/dist/testing/cli.d.ts +24 -0
- package/dist/testing/cli.js +91 -0
- package/dist/testing/conformance.d.ts +61 -0
- package/dist/testing/conformance.js +455 -0
- package/dist/testing/index.d.ts +23 -0
- package/dist/testing/index.js +15 -0
- package/dist/testing/mcp.d.ts +25 -0
- package/dist/testing/mcp.js +80 -0
- package/dist/testing/project.d.ts +81 -0
- package/dist/testing/project.js +215 -0
- package/dist/testing/samples.d.ts +42 -0
- package/dist/testing/samples.js +122 -0
- package/dist/transform/operations.d.ts +5 -0
- package/dist/transform/operations.js +320 -0
- package/dist/transform/raster-engine.d.ts +9 -0
- package/dist/transform/raster-engine.js +329 -0
- package/dist/transform/rendition.d.ts +65 -0
- package/dist/transform/rendition.js +317 -0
- package/dist/transform/run.d.ts +138 -0
- package/dist/transform/run.js +442 -0
- package/dist/transform/schema.d.ts +33 -0
- package/dist/transform/schema.js +73 -0
- package/dist/transform/types.d.ts +101 -0
- package/dist/transform/types.js +1 -0
- package/dist/tree/address.d.ts +18 -0
- package/dist/tree/address.js +59 -0
- package/dist/tree/list.d.ts +18 -0
- package/dist/tree/list.js +101 -0
- package/dist/tree/project.d.ts +61 -0
- package/dist/tree/project.js +145 -0
- package/dist/tree/read.d.ts +43 -0
- package/dist/tree/read.js +715 -0
- package/dist/tree/search.d.ts +20 -0
- package/dist/tree/search.js +44 -0
- package/dist/tree/serve.d.ts +79 -0
- package/dist/tree/serve.js +415 -0
- package/dist/tree/thumbs.d.ts +26 -0
- package/dist/tree/thumbs.js +134 -0
- package/dist/turnaround.d.ts +195 -0
- package/dist/turnaround.js +622 -0
- package/dist/types.d.ts +595 -0
- package/dist/types.js +1 -0
- package/package.json +112 -3
- package/policy/blocklist.json +47 -0
- package/policy/prompt-policy-cuts.json +15 -0
- package/skills/art-direction/SKILL.md +16 -0
- package/skills/art-direction/default.md +14 -0
- package/skills/art-direction/presets/cozy-storybook.md +121 -0
- package/skills/art-direction/presets/dark-gritty-isometric.md +121 -0
- package/skills/art-direction/presets/flat-cartoon-kids.md +121 -0
- package/skills/art-direction/references/bible-format.md +47 -0
- package/skills/assetgrove/SKILL.md +109 -0
- package/skills/assetgrove/references/commands.md +723 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { encodePng } from "../../image/raster.js";
|
|
2
|
+
import { GLB_MEDIA_TYPE, parseGlb, writeGlb } from "../glb.js";
|
|
3
|
+
import { compactBin } from "../lookdev/edit.js";
|
|
4
|
+
import { renderView, TURNTABLE_VIEWS } from "../render.js";
|
|
5
|
+
import { boundsOf, imageSize, measure, posedPrimitives } from "../scene.js";
|
|
6
|
+
import { clipsCheck, rigCheck, silhouette, silhouetteCheck, silhouetteDifference } from "./qa.js";
|
|
7
|
+
import { silhouetteViews, trianglesCheck, viewPose } from "./qa.js";
|
|
8
|
+
import { appendSimplifiedMesh, levelGlb, pruneAccessors, simplifyPrimitives } from "./simplify.js";
|
|
9
|
+
import { TextureFitError, fitEmbeddedImages, tierSideImages } from "./textures.js";
|
|
10
|
+
/** One mesh-carrying node of the scene and the meshes its levels use. */
|
|
11
|
+
function meshNodes(glb) {
|
|
12
|
+
return (glb.json.nodes ?? []).flatMap((n, i) => (n.mesh === undefined ? [] : [i]));
|
|
13
|
+
}
|
|
14
|
+
/** Removes meshes no node uses, renumbering the rest, then drops data nothing references. */
|
|
15
|
+
export function dropUnusedMeshes(glb) {
|
|
16
|
+
const json = glb.json;
|
|
17
|
+
const used = [
|
|
18
|
+
...new Set((json.nodes ?? []).flatMap((n) => (n.mesh === undefined ? [] : [n.mesh]))),
|
|
19
|
+
];
|
|
20
|
+
used.sort((a, b) => a - b);
|
|
21
|
+
const remap = new Map(used.map((old, i) => [old, i]));
|
|
22
|
+
const meshes = json.meshes ?? [];
|
|
23
|
+
json.meshes = used.map((i) => meshes[i]);
|
|
24
|
+
for (const node of json.nodes ?? [])
|
|
25
|
+
if (node.mesh !== undefined)
|
|
26
|
+
node.mesh = remap.get(node.mesh);
|
|
27
|
+
pruneAccessors(glb);
|
|
28
|
+
compactBin(glb);
|
|
29
|
+
}
|
|
30
|
+
const copy = (glb) => parseGlb(writeGlb(glb));
|
|
31
|
+
/**
|
|
32
|
+
* One file holding `levels` (level numbers, first shown nearest) with `MSFT_lod`: each mesh node
|
|
33
|
+
* shows the first level, and names a node per lower level in `MSFT_lod.ids`, with the screen
|
|
34
|
+
* heights in `extras.MSFT_screencoverage`. Lower-level nodes sit outside the scene, as the
|
|
35
|
+
* extension has them, so the scene's bounds and triangles are the first level's.
|
|
36
|
+
*/
|
|
37
|
+
function embeddedFile(source, chosen) {
|
|
38
|
+
const glb = copy(source);
|
|
39
|
+
const json = glb.json;
|
|
40
|
+
for (const n of meshNodes(source)) {
|
|
41
|
+
const node = json.nodes[n];
|
|
42
|
+
const sourceMesh = node.mesh;
|
|
43
|
+
const meshFor = (level) => level.level === 0
|
|
44
|
+
? sourceMesh
|
|
45
|
+
: appendSimplifiedMesh(glb, sourceMesh, level.primitives.filter((p) => p.mesh === sourceMesh), level.level);
|
|
46
|
+
const meshes = chosen.map(meshFor);
|
|
47
|
+
node.mesh = meshes[0];
|
|
48
|
+
if (chosen.length < 2)
|
|
49
|
+
continue;
|
|
50
|
+
const ids = chosen.slice(1).map((level, i) => {
|
|
51
|
+
const lodNode = { ...structuredClone(node), mesh: meshes[i + 1] };
|
|
52
|
+
delete lodNode.children;
|
|
53
|
+
delete lodNode.extensions;
|
|
54
|
+
if (node.name !== undefined)
|
|
55
|
+
lodNode.name = `${node.name}_lod${level.level}`;
|
|
56
|
+
json.nodes.push(lodNode);
|
|
57
|
+
return json.nodes.length - 1;
|
|
58
|
+
});
|
|
59
|
+
node.extensions = { ...node.extensions, MSFT_lod: { ids } };
|
|
60
|
+
node["extras"] = {
|
|
61
|
+
...node["extras"],
|
|
62
|
+
MSFT_screencoverage: chosen.map((level) => level.minScreenHeight),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (chosen.length > 1) {
|
|
66
|
+
json.extensionsUsed = [...new Set([...(json.extensionsUsed ?? []), "MSFT_lod"])];
|
|
67
|
+
}
|
|
68
|
+
dropUnusedMeshes(glb);
|
|
69
|
+
return glb;
|
|
70
|
+
}
|
|
71
|
+
function levelFile(source, level) {
|
|
72
|
+
return level.level === 0 ? copy(source) : copy(level.glb);
|
|
73
|
+
}
|
|
74
|
+
function sideBySide(images) {
|
|
75
|
+
const height = Math.max(...images.map((i) => i.height));
|
|
76
|
+
const width = images.reduce((s, i) => s + i.width, 0);
|
|
77
|
+
const out = { width, height, data: new Uint8Array(width * height * 4) };
|
|
78
|
+
let x0 = 0;
|
|
79
|
+
for (const image of images) {
|
|
80
|
+
for (let y = 0; y < image.height; y++) {
|
|
81
|
+
out.data.set(image.data.subarray(y * image.width * 4, (y + 1) * image.width * 4), (y * width + x0) * 4);
|
|
82
|
+
}
|
|
83
|
+
x0 += image.width;
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
function stacked(images) {
|
|
88
|
+
const width = Math.max(...images.map((i) => i.width));
|
|
89
|
+
const height = images.reduce((n, i) => n + i.height, 0);
|
|
90
|
+
const out = { width, height, data: new Uint8Array(width * height * 4) };
|
|
91
|
+
let y0 = 0;
|
|
92
|
+
for (const image of images) {
|
|
93
|
+
out.data.set(image.data, y0 * width * 4);
|
|
94
|
+
y0 += image.height;
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
function renderViews(glb, sizePx, framing, forwardYawDeg) {
|
|
99
|
+
return TURNTABLE_VIEWS.map((view) => renderView(glb, { sizePx, yawDeg: forwardYawDeg + view.yawDeg, framing }));
|
|
100
|
+
}
|
|
101
|
+
/** `fern.groom.summer.length.png` → `fern.phone.groom.summer.length.png`. */
|
|
102
|
+
function tierName(asset, tier, name) {
|
|
103
|
+
return name.startsWith(`${asset}.`)
|
|
104
|
+
? `${asset}.${tier}.${name.slice(asset.length + 1)}`
|
|
105
|
+
: `${tier}.${name}`;
|
|
106
|
+
}
|
|
107
|
+
export async function buildChain(options) {
|
|
108
|
+
const { source, settings, assetId: asset } = options;
|
|
109
|
+
const fullTriangles = measure(source).triangles;
|
|
110
|
+
const framing = boundsOf(posedPrimitives(source));
|
|
111
|
+
const reasons = [];
|
|
112
|
+
const artifacts = [];
|
|
113
|
+
// 1. Every level, checked against the full model.
|
|
114
|
+
const views = silhouetteViews(source, options.forwardYawDeg);
|
|
115
|
+
const fullMasks = views.map((view) => {
|
|
116
|
+
const pose = viewPose(source, view);
|
|
117
|
+
return silhouette(source, view, { sizePx: options.sizePx, framing, ...(pose && { pose }) });
|
|
118
|
+
});
|
|
119
|
+
const built = [];
|
|
120
|
+
for (const declared of settings.levels) {
|
|
121
|
+
if (declared.level === 0) {
|
|
122
|
+
built.push({
|
|
123
|
+
...declared,
|
|
124
|
+
triangles: fullTriangles,
|
|
125
|
+
passed: true,
|
|
126
|
+
glb: source,
|
|
127
|
+
primitives: await simplifyPrimitives(source, 1),
|
|
128
|
+
renders: renderViews(source, options.sizePx, framing, options.forwardYawDeg),
|
|
129
|
+
});
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const made = await levelGlb(source, declared.triangleRatio, declared.level);
|
|
133
|
+
const level = parseGlb(writeGlb(made.glb));
|
|
134
|
+
const differences = views.map((view, i) => {
|
|
135
|
+
const pose = viewPose(source, view);
|
|
136
|
+
const mask = silhouette(level, view, {
|
|
137
|
+
sizePx: options.sizePx,
|
|
138
|
+
framing,
|
|
139
|
+
...(pose && { pose }),
|
|
140
|
+
});
|
|
141
|
+
return { view: view.name, difference: silhouetteDifference(fullMasks[i], mask) };
|
|
142
|
+
});
|
|
143
|
+
const checks = [
|
|
144
|
+
trianglesCheck(declared.level, declared.triangleRatio, made.triangles, fullTriangles),
|
|
145
|
+
rigCheck(source, level, declared.level, made.primitives),
|
|
146
|
+
clipsCheck(source, level, declared.level),
|
|
147
|
+
silhouetteCheck(declared.level, differences, settings.silhouette),
|
|
148
|
+
];
|
|
149
|
+
const passed = checks.every((c) => c.passed);
|
|
150
|
+
// A failing level is filtered from the chain, not the candidate: shadow, with its reason.
|
|
151
|
+
reasons.push(...checks.map((c) => (passed ? c : { ...c, shadow: true })));
|
|
152
|
+
if (!passed) {
|
|
153
|
+
reasons.push({
|
|
154
|
+
check: `lod-${declared.level}`,
|
|
155
|
+
passed: true,
|
|
156
|
+
shadow: true,
|
|
157
|
+
reason: `level ${declared.level} is left out of the chain: ${checks
|
|
158
|
+
.filter((c) => !c.passed)
|
|
159
|
+
.map((c) => c.check)
|
|
160
|
+
.join(", ")} failed`,
|
|
161
|
+
source: "deterministic",
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
built.push({
|
|
165
|
+
...declared,
|
|
166
|
+
triangles: made.triangles,
|
|
167
|
+
passed,
|
|
168
|
+
glb: level,
|
|
169
|
+
primitives: made.primitives,
|
|
170
|
+
renders: renderViews(level, options.sizePx, framing, options.forwardYawDeg),
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
for (const level of built) {
|
|
174
|
+
level.renders.forEach((raster, v) => {
|
|
175
|
+
artifacts.push({
|
|
176
|
+
name: `lod${level.level}-${TURNTABLE_VIEWS[v].name}.png`,
|
|
177
|
+
bytes: encodePng(raster),
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
TURNTABLE_VIEWS.forEach((view, v) => {
|
|
182
|
+
artifacts.push({
|
|
183
|
+
name: `lods-${view.name}.png`,
|
|
184
|
+
bytes: encodePng(sideBySide(built.map((level) => level.renders[v]))),
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
// Each level mid-way through every clip, one row per level, so the person sees them deform alike.
|
|
188
|
+
const clipViews = views.filter((v) => v.clip !== undefined && v.name.endsWith("frame 2"));
|
|
189
|
+
if (clipViews.length > 0) {
|
|
190
|
+
const rows = built.map((level) => sideBySide(clipViews.map((view) => {
|
|
191
|
+
const pose = viewPose(source, view);
|
|
192
|
+
return renderView(level.glb, {
|
|
193
|
+
sizePx: Math.max(32, Math.round(options.sizePx / 2)),
|
|
194
|
+
yawDeg: view.yawDeg,
|
|
195
|
+
framing,
|
|
196
|
+
...(pose && { pose }),
|
|
197
|
+
});
|
|
198
|
+
})));
|
|
199
|
+
artifacts.push({ name: "lods-clips.png", bytes: encodePng(stacked(rows)) });
|
|
200
|
+
}
|
|
201
|
+
const passing = built.filter((level) => level.passed);
|
|
202
|
+
// 2. The default tier: the main file and, for `files`, a file per lower level.
|
|
203
|
+
const sidecars = [...options.sides];
|
|
204
|
+
const files = settings.packaging === "files";
|
|
205
|
+
const main = files ? copy(source) : embeddedFile(source, passing);
|
|
206
|
+
if (files) {
|
|
207
|
+
for (const level of passing.slice(1)) {
|
|
208
|
+
sidecars.push({
|
|
209
|
+
name: `${asset}.lod${level.level}.glb`,
|
|
210
|
+
bytes: writeGlb(levelFile(source, level)),
|
|
211
|
+
mediaType: GLB_MEDIA_TYPE,
|
|
212
|
+
field: `levels.lod${level.level}`,
|
|
213
|
+
extra: {
|
|
214
|
+
level: level.level,
|
|
215
|
+
triangles: level.triangles,
|
|
216
|
+
triangleRatio: level.triangleRatio,
|
|
217
|
+
minScreenHeight: level.minScreenHeight,
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// 3. Each declared tier: its levels, its textures, its side maps.
|
|
223
|
+
const tiers = [];
|
|
224
|
+
const sourceTexture = measureTextures(source, options.sides);
|
|
225
|
+
for (const tier of settings.tiers) {
|
|
226
|
+
const result = tierRendition(tier, passing, {
|
|
227
|
+
source,
|
|
228
|
+
sides: options.sides,
|
|
229
|
+
asset,
|
|
230
|
+
files,
|
|
231
|
+
sourceTexture,
|
|
232
|
+
budgets: options.budgets,
|
|
233
|
+
});
|
|
234
|
+
reasons.push(result.reason);
|
|
235
|
+
if (!result.rendition)
|
|
236
|
+
continue;
|
|
237
|
+
sidecars.push(...result.rendition.sidecars);
|
|
238
|
+
tiers.push({
|
|
239
|
+
name: tier.name,
|
|
240
|
+
levels: result.rendition.levels,
|
|
241
|
+
textureMaxPx: result.rendition.textureMaxPx,
|
|
242
|
+
files: result.rendition.sidecars.map((s) => s.name),
|
|
243
|
+
});
|
|
244
|
+
const first = result.rendition.firstFile;
|
|
245
|
+
if (first) {
|
|
246
|
+
const renders = renderViews(first, options.sizePx, framing, options.forwardYawDeg);
|
|
247
|
+
artifacts.push({
|
|
248
|
+
name: `tier-${tier.name}.png`,
|
|
249
|
+
bytes: encodePng(sideBySide(renders)),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
bytes: writeGlb(main),
|
|
255
|
+
sidecars,
|
|
256
|
+
reasons,
|
|
257
|
+
artifacts,
|
|
258
|
+
levels: built.map(({ level, triangleRatio, minScreenHeight, triangles, passed }) => ({
|
|
259
|
+
level,
|
|
260
|
+
triangleRatio,
|
|
261
|
+
minScreenHeight,
|
|
262
|
+
triangles,
|
|
263
|
+
passed,
|
|
264
|
+
})),
|
|
265
|
+
tiers,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
/** The largest image edge, embedded or beside the model. */
|
|
269
|
+
function measureTextures(glb, sides) {
|
|
270
|
+
let max = measure(glb).textureMaxPx;
|
|
271
|
+
const referenced = new Set((glb.json.images ?? []).map((i) => i.uri).filter(Boolean));
|
|
272
|
+
for (const side of sides) {
|
|
273
|
+
if (!referenced.has(side.name) && !referenced.has(encodeURIComponent(side.name)))
|
|
274
|
+
continue;
|
|
275
|
+
const size = sizeOf(side.bytes);
|
|
276
|
+
if (size)
|
|
277
|
+
max = Math.max(max, size);
|
|
278
|
+
}
|
|
279
|
+
return max;
|
|
280
|
+
}
|
|
281
|
+
function sizeOf(bytes) {
|
|
282
|
+
const size = imageSize(bytes);
|
|
283
|
+
return size && Math.max(size.width, size.height);
|
|
284
|
+
}
|
|
285
|
+
function tierRendition(tier, passing, context) {
|
|
286
|
+
const check = `tier-${tier.name}`;
|
|
287
|
+
let levels = passing.filter((l) => tier.triangles === undefined || l.triangles <= tier.triangles);
|
|
288
|
+
if (tier.lods !== undefined)
|
|
289
|
+
levels = levels.slice(0, Math.max(tier.lods, 0));
|
|
290
|
+
if (levels.length === 0) {
|
|
291
|
+
return {
|
|
292
|
+
reason: {
|
|
293
|
+
check,
|
|
294
|
+
passed: false,
|
|
295
|
+
reason: `tier ${tier.name}: no level is within its ${tier.triangles} triangles ` +
|
|
296
|
+
`(levels: ${passing.map((l) => `${l.level} ${l.triangles}`).join(", ")})`,
|
|
297
|
+
source: "deterministic",
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const resize = tier.textureMaxPx !== undefined && context.sourceTexture > tier.textureMaxPx;
|
|
302
|
+
const sameAsDefault = levels.length === passing.length &&
|
|
303
|
+
!resize &&
|
|
304
|
+
tier.fur &&
|
|
305
|
+
(tier.textureMaxPx === undefined || context.budgets.textureMaxPx <= tier.textureMaxPx);
|
|
306
|
+
const levelText = `level(s) ${levels.map((l) => `${l.level} (${l.triangles} triangles)`).join(", ")}`;
|
|
307
|
+
// The main file serves the tier as it is only when it is within the tier's other budgets too.
|
|
308
|
+
const sourceMeasures = measure(context.source);
|
|
309
|
+
const overMain = ["materials", "bones"].flatMap((key) => {
|
|
310
|
+
const limit = tier[key];
|
|
311
|
+
return limit !== undefined && sourceMeasures[key] > limit
|
|
312
|
+
? [`${key} ${sourceMeasures[key]} over ${limit}`]
|
|
313
|
+
: [];
|
|
314
|
+
});
|
|
315
|
+
if (sameAsDefault && overMain.length > 0) {
|
|
316
|
+
return {
|
|
317
|
+
reason: {
|
|
318
|
+
check,
|
|
319
|
+
passed: false,
|
|
320
|
+
reason: `tier ${tier.name}: the main file: ${overMain.join("; ")}`,
|
|
321
|
+
source: "deterministic",
|
|
322
|
+
},
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
if (sameAsDefault) {
|
|
326
|
+
return {
|
|
327
|
+
reason: {
|
|
328
|
+
check,
|
|
329
|
+
passed: true,
|
|
330
|
+
reason: `tier ${tier.name}: the main file serves it as it is: ${levelText}, textures ${context.sourceTexture} px`,
|
|
331
|
+
source: "deterministic",
|
|
332
|
+
},
|
|
333
|
+
rendition: {
|
|
334
|
+
sidecars: [],
|
|
335
|
+
levels: levels.map((l) => l.level),
|
|
336
|
+
textureMaxPx: context.sourceTexture,
|
|
337
|
+
},
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
const glbs = [];
|
|
341
|
+
const groups = context.files ? levels.map((l) => [l]) : [levels];
|
|
342
|
+
for (const group of groups) {
|
|
343
|
+
const glb = group.length === 1 && context.files
|
|
344
|
+
? levelFile(context.source, group[0])
|
|
345
|
+
: embeddedFile(context.source, group);
|
|
346
|
+
const first = group[0];
|
|
347
|
+
const name = context.files
|
|
348
|
+
? `${context.asset}.${tier.name}.lod${first.level}.glb`
|
|
349
|
+
: `${context.asset}.${tier.name}.glb`;
|
|
350
|
+
const field = context.files
|
|
351
|
+
? `tiers.${tier.name}.levels.lod${first.level}`
|
|
352
|
+
: `tiers.${tier.name}.model`;
|
|
353
|
+
glbs.push({
|
|
354
|
+
glb,
|
|
355
|
+
name,
|
|
356
|
+
field,
|
|
357
|
+
extra: context.files
|
|
358
|
+
? {
|
|
359
|
+
level: first.level,
|
|
360
|
+
triangles: first.triangles,
|
|
361
|
+
triangleRatio: first.triangleRatio,
|
|
362
|
+
minScreenHeight: first.minScreenHeight,
|
|
363
|
+
}
|
|
364
|
+
: { levels: group.map((l) => l.level), triangles: first.triangles, lods: group.length },
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
const sides = new Map();
|
|
368
|
+
let textureMaxPx = 0;
|
|
369
|
+
const problems = [];
|
|
370
|
+
for (const entry of glbs) {
|
|
371
|
+
let own;
|
|
372
|
+
try {
|
|
373
|
+
if (tier.textureMaxPx !== undefined)
|
|
374
|
+
fitEmbeddedImages(entry.glb, tier.textureMaxPx);
|
|
375
|
+
own = tierSideImages(entry.glb, context.sides, {
|
|
376
|
+
...(tier.textureMaxPx !== undefined && { maxPx: tier.textureMaxPx }),
|
|
377
|
+
fur: tier.fur,
|
|
378
|
+
rename: (name) => tierName(context.asset, tier.name, name),
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
if (!(error instanceof TextureFitError))
|
|
383
|
+
throw error;
|
|
384
|
+
return {
|
|
385
|
+
reason: {
|
|
386
|
+
check,
|
|
387
|
+
passed: false,
|
|
388
|
+
reason: `tier ${tier.name}: ${entry.name}: ${error.message}`,
|
|
389
|
+
source: "deterministic",
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
for (const side of own)
|
|
394
|
+
sides.set(side.name, side);
|
|
395
|
+
const measures = measure(entry.glb);
|
|
396
|
+
textureMaxPx = Math.max(textureMaxPx, measures.textureMaxPx);
|
|
397
|
+
for (const key of ["materials", "bones"]) {
|
|
398
|
+
const limit = tier[key];
|
|
399
|
+
if (limit !== undefined && measures[key] > limit) {
|
|
400
|
+
problems.push(`${entry.name}: ${key} ${measures[key]} over ${limit}`);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
entry.extra["textureMaxPx"] = measures.textureMaxPx;
|
|
404
|
+
}
|
|
405
|
+
for (const side of sides.values()) {
|
|
406
|
+
const size = sizeOf(side.bytes);
|
|
407
|
+
if (size)
|
|
408
|
+
textureMaxPx = Math.max(textureMaxPx, size);
|
|
409
|
+
}
|
|
410
|
+
if (tier.textureMaxPx !== undefined && textureMaxPx > tier.textureMaxPx) {
|
|
411
|
+
problems.push(`textures ${textureMaxPx} px over ${tier.textureMaxPx}`);
|
|
412
|
+
}
|
|
413
|
+
const sidecars = [
|
|
414
|
+
...glbs.map((g) => ({
|
|
415
|
+
name: g.name,
|
|
416
|
+
bytes: writeGlb(g.glb),
|
|
417
|
+
mediaType: GLB_MEDIA_TYPE,
|
|
418
|
+
field: g.field,
|
|
419
|
+
extra: g.extra,
|
|
420
|
+
})),
|
|
421
|
+
...[...sides.values()].map((side) => ({
|
|
422
|
+
...side,
|
|
423
|
+
field: `tiers.${tier.name}.${side.field}`,
|
|
424
|
+
})),
|
|
425
|
+
];
|
|
426
|
+
const dropped = tier.fur
|
|
427
|
+
? ""
|
|
428
|
+
: `; it draws no fur, so ${context.sides.length - sides.size} side map(s) are left out`;
|
|
429
|
+
return {
|
|
430
|
+
reason: {
|
|
431
|
+
check,
|
|
432
|
+
passed: problems.length === 0,
|
|
433
|
+
reason: problems.length === 0
|
|
434
|
+
? `tier ${tier.name}: ${levelText}; textures within ${textureMaxPx} px` +
|
|
435
|
+
(tier.textureMaxPx === undefined ? "" : ` (budget ${tier.textureMaxPx})`) +
|
|
436
|
+
dropped
|
|
437
|
+
: `tier ${tier.name}: ${problems.join("; ")}`,
|
|
438
|
+
source: "deterministic",
|
|
439
|
+
},
|
|
440
|
+
rendition: {
|
|
441
|
+
sidecars,
|
|
442
|
+
levels: levels.map((l) => l.level),
|
|
443
|
+
textureMaxPx,
|
|
444
|
+
firstFile: parseGlb(sidecars[0].bytes),
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { RunRecord } from "../../loop.ts";
|
|
2
|
+
import type { AssetSpec, Provenance, TargetProfile } from "../../types.ts";
|
|
3
|
+
import type { Glb } from "../glb.ts";
|
|
4
|
+
export declare const LOD_STEP = "lod-chain";
|
|
5
|
+
export declare const LOD_METHOD = "meshoptimizer simplifyWithAttributes on index lists only (kept vertices copied byte for byte)";
|
|
6
|
+
export interface LodOptions {
|
|
7
|
+
/** A staged candidate: its run directory and id. */
|
|
8
|
+
run?: {
|
|
9
|
+
dir: string;
|
|
10
|
+
candidate: string;
|
|
11
|
+
};
|
|
12
|
+
/** Or a `.glb` and the provenance it was handed off with, with the spec it was made for. */
|
|
13
|
+
model?: {
|
|
14
|
+
bytes: Uint8Array;
|
|
15
|
+
path: string;
|
|
16
|
+
};
|
|
17
|
+
provenance?: Provenance;
|
|
18
|
+
spec?: AssetSpec;
|
|
19
|
+
specDir?: string;
|
|
20
|
+
/** The target profile; defaults to the staged run's. */
|
|
21
|
+
profile?: TargetProfile;
|
|
22
|
+
/** The given profile's directory, where its rig template is read for the `rig-template` check. */
|
|
23
|
+
profileDir?: string;
|
|
24
|
+
runsDir: string;
|
|
25
|
+
runId?: string;
|
|
26
|
+
now?: () => Date;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The model without a chain made before: `MSFT_lod` and its screen coverage are removed, and so
|
|
30
|
+
* are the level nodes, which a chain appends after every other node. Levels a model carries from
|
|
31
|
+
* elsewhere (nodes not at the end) are refused rather than guessed at.
|
|
32
|
+
*/
|
|
33
|
+
export declare function withoutChain(glb: Glb): Glb;
|
|
34
|
+
export declare function lodChain(options: LodOptions): Promise<{
|
|
35
|
+
run: RunRecord;
|
|
36
|
+
runDir: string;
|
|
37
|
+
passed: boolean;
|
|
38
|
+
}>;
|