@wildshard/sdk 0.0.1 → 0.2.4
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/GUIDE.md +895 -0
- package/README.md +13 -5
- package/bin/wildshard.mjs +38 -0
- package/lint/declaration-config.d.mts +2 -0
- package/lint/declaration-config.mjs +19 -0
- package/lint/engine-plugin.d.mts +2 -0
- package/lint/engine-plugin.mjs +40 -0
- package/lint/host-callbacks.d.mts +6 -0
- package/lint/host-callbacks.mjs +123 -0
- package/lint/host-files.d.mts +1 -0
- package/lint/host-files.mjs +7 -0
- package/lint/layer-exports.d.mts +2 -0
- package/lint/layer-exports.mjs +21 -0
- package/lint/legacy-line-basis.json +995 -0
- package/lint/nine-tiling-baseline.json +35 -0
- package/lint/ratchet.json +11 -0
- package/lint/runtime-files.d.mts +12 -0
- package/lint/runtime-files.json +16 -0
- package/lint/runtime-files.mjs +69 -0
- package/lint/runtime-performance.d.mts +6 -0
- package/lint/runtime-performance.mjs +184 -0
- package/lint/sdk-plugin.d.mts +4 -0
- package/lint/sdk-plugin.mjs +134 -0
- package/lint/shardfile-boundaries.d.mts +10 -0
- package/lint/shardfile-boundaries.mjs +122 -0
- package/lint/tile-bake-debt.json +556 -0
- package/package.json +365 -3
- package/scripts/agent-parity.mjs +1524 -0
- package/scripts/agent-sync.mjs +518 -0
- package/scripts/apfs-clone.mjs +67 -0
- package/scripts/assert-store-layout.mjs +23 -0
- package/scripts/astc6-phone-cap.d.mts +3 -0
- package/scripts/astc6-phone-cap.mjs +137 -0
- package/scripts/audit-assets.d.mts +10 -0
- package/scripts/audit-assets.mjs +151 -0
- package/scripts/bake/coatFiles.d.mts +6 -0
- package/scripts/bake/coatFiles.mjs +37 -0
- package/scripts/bake/environment.d.mts +2 -0
- package/scripts/bake/environment.mjs +58 -0
- package/scripts/bake/far-proxies.mjs +45 -0
- package/scripts/bake/keyed-sky.d.mts +4 -0
- package/scripts/bake/keyed-sky.mjs +34 -0
- package/scripts/bake/movers.mjs +56 -0
- package/scripts/bake/nativeWorld.d.mts +6 -0
- package/scripts/bake/nativeWorld.mjs +43 -0
- package/scripts/bake/navmeshGround.ts +22 -0
- package/scripts/bake/near-placeholder.mjs +331 -0
- package/scripts/bake/placeholderShards.mjs +41 -0
- package/scripts/bake/skins.mjs +15 -0
- package/scripts/bake/template-skins.mjs +33 -0
- package/scripts/bake/viewmodelBytes.ts +26 -0
- package/scripts/bake/viewmodelPage.ts +11 -0
- package/scripts/bake/worldHost.d.mts +35 -0
- package/scripts/bake/worldHost.mjs +110 -0
- package/scripts/bake-astc6.cache.json +80 -0
- package/scripts/bake-astc6.far-reach.cache.json +23 -0
- package/scripts/bake-astc6.list.json +111 -0
- package/scripts/bake-astc6.mjs +279 -0
- package/scripts/bake-astc6.nalati-grasslands.cache.json +42 -0
- package/scripts/bake-catalogue.mjs +44 -0
- package/scripts/bake-check.mjs +54 -0
- package/scripts/bake-chunk.mjs +124 -0
- package/scripts/bake-cloud-field.mjs +24 -0
- package/scripts/bake-coats.mjs +110 -0
- package/scripts/bake-data-maps.d.mts +24 -0
- package/scripts/bake-data-maps.mjs +72 -0
- package/scripts/bake-entry-programs.mjs +117 -0
- package/scripts/bake-geometry.mjs +106 -0
- package/scripts/bake-hybrid-tiles.mjs +28 -0
- package/scripts/bake-ktx2.cache.json +276 -0
- package/scripts/bake-ktx2.list.json +365 -0
- package/scripts/bake-ktx2.mjs +477 -0
- package/scripts/bake-map-glb.mjs +127 -0
- package/scripts/bake-map-rest.d.mts +7 -0
- package/scripts/bake-map-rest.mjs +50 -0
- package/scripts/bake-maps.mjs +200 -0
- package/scripts/bake-navmesh.mjs +259 -0
- package/scripts/bake-packs.mjs +129 -0
- package/scripts/bake-pickups.mjs +102 -0
- package/scripts/bake-query-terrain.mjs +64 -0
- package/scripts/bake-recurve-pool.mjs +16 -0
- package/scripts/bake-section-schemas.d.mts +3 -0
- package/scripts/bake-template-shardfile.mjs +32 -0
- package/scripts/bake-textures.mjs +80 -0
- package/scripts/bake-viewmodel-sets.json +45 -0
- package/scripts/bake-viewmodel-sets.mjs +137 -0
- package/scripts/bake-voxel-ao.mjs +119 -0
- package/scripts/bake-water-ripples.mjs +25 -0
- package/scripts/blender/README.md +129 -0
- package/scripts/blender/build.sh +166 -0
- package/scripts/blender/lib/export-scene.mjs +129 -0
- package/scripts/blender/lib/glb-digest.mjs +188 -0
- package/scripts/blender/lib/glb.py +68 -0
- package/scripts/blender/lib/save_blend.py +17 -0
- package/scripts/blender/lib/world_fixture.py +55 -0
- package/scripts/blender/targets.json +591 -0
- package/scripts/build-sdk.mjs +95 -0
- package/scripts/build-shardfiles.d.mts +7 -0
- package/scripts/build-shardfiles.mjs +206 -0
- package/scripts/capture-hero.mjs +137 -0
- package/scripts/check-lift-review.mjs +23 -0
- package/scripts/chromium-keychain-check.mjs +139 -0
- package/scripts/chromium-keychain.d.mts +1 -0
- package/scripts/chromium-keychain.mjs +5 -0
- package/scripts/compile-script.d.mts +3 -0
- package/scripts/compile-script.mjs +8 -0
- package/scripts/creature-color.mjs +255 -0
- package/scripts/decide/calibrate.py +127 -0
- package/scripts/decide/calibration/2026-10-03/labels-s1.tsv +281 -0
- package/scripts/decide/calibration/2026-10-03/labels-s2.tsv +97 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3.tsv +48 -0
- package/scripts/decide/calibration/2026-10-03/labels-s3b.tsv +26 -0
- package/scripts/decide/calibration/2026-10-03/res-capture-status-v1.jsonl +376 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-strings.jsonl +48 -0
- package/scripts/decide/calibration/2026-10-03/res-text-garbled-v1.jsonl +73 -0
- package/scripts/decide/decide.py +262 -0
- package/scripts/decide/decide.sh +50 -0
- package/scripts/decide/layer-purity-pilot.mjs +41 -0
- package/scripts/decide/sets/capture-status.json +46 -0
- package/scripts/decide/sets/layer-purity.json +28 -0
- package/scripts/decide/sets/text-garbled.json +17 -0
- package/scripts/decide/test_decide.py +37 -0
- package/scripts/docs.mjs +15 -0
- package/scripts/entry-reads/crawl.ts +152 -0
- package/scripts/entry-reads/tsconfig.json +25 -0
- package/scripts/gen-format-schema.d.mts +2 -0
- package/scripts/gen-format-schema.mjs +21 -0
- package/scripts/gen-host-catalogue.d.mts +14 -0
- package/scripts/gen-host-catalogue.mjs +108 -0
- package/scripts/gen-shard-layout-doc.d.mts +4 -0
- package/scripts/gen-shard-layout-doc.mjs +55 -0
- package/scripts/gen-shards.d.mts +17 -0
- package/scripts/gen-shards.mjs +311 -0
- package/scripts/goldens/capture-inputs.d.mts +4 -0
- package/scripts/goldens/capture-inputs.mjs +34 -0
- package/scripts/goldens/colour_shift.py +27 -0
- package/scripts/goldens/native-residency.d.mts +10 -0
- package/scripts/goldens/native-residency.mjs +104 -0
- package/scripts/goldens/plot-inputs.d.mts +12 -0
- package/scripts/goldens/plot-inputs.mjs +46 -0
- package/scripts/gpu-texmem.mjs +98 -0
- package/scripts/horizon-matte/config.py +24 -0
- package/scripts/horizon-matte/encode.py +91 -0
- package/scripts/horizon-matte/key.py +141 -0
- package/scripts/horizon-matte/mkjobs.py +33 -0
- package/scripts/horizon-matte/mkjobs_day2.py +11 -0
- package/scripts/horizon-matte/overlap.py +80 -0
- package/scripts/horizon-matte/run_codex.py +57 -0
- package/scripts/horizon-matte/stitch.py +133 -0
- package/scripts/img2mesh/CC0.md +105 -0
- package/scripts/img2mesh/README.md +209 -0
- package/scripts/img2mesh/ab_board.py +102 -0
- package/scripts/img2mesh/birds/birds.json +255 -0
- package/scripts/img2mesh/birds/birds_atlas.py +150 -0
- package/scripts/img2mesh/birds/birds_fix_preview.mjs +103 -0
- package/scripts/img2mesh/birds/birds_fix_render.py +75 -0
- package/scripts/img2mesh/birds/birds_pack.py +110 -0
- package/scripts/img2mesh/birds/birds_phone_b.py +112 -0
- package/scripts/img2mesh/birds/birds_post.py +550 -0
- package/scripts/img2mesh/birds/birds_render.py +125 -0
- package/scripts/img2mesh/birds/birds_sheet.py +33 -0
- package/scripts/img2mesh/birds/birds_view.py +60 -0
- package/scripts/img2mesh/board.py +100 -0
- package/scripts/img2mesh/build_cc0.sh +52 -0
- package/scripts/img2mesh/build_driftwood.sh +12 -0
- package/scripts/img2mesh/build_faces.sh +53 -0
- package/scripts/img2mesh/build_props.py +81 -0
- package/scripts/img2mesh/cc0_export.py +186 -0
- package/scripts/img2mesh/driftwood_post.py +571 -0
- package/scripts/img2mesh/e304_faces.sh +67 -0
- package/scripts/img2mesh/face_remaster.py +911 -0
- package/scripts/img2mesh/face_views.py +95 -0
- package/scripts/img2mesh/faces-e304.json +9 -0
- package/scripts/img2mesh/faces.json +30 -0
- package/scripts/img2mesh/head_cut.py +100 -0
- package/scripts/img2mesh/hi3d_paint.py +94 -0
- package/scripts/img2mesh/hi3d_refine.py +161 -0
- package/scripts/img2mesh/hunyuan_cpu_rasterizer.sh +42 -0
- package/scripts/img2mesh/pine_hollow_phone.sh +13 -0
- package/scripts/img2mesh/props/coral-arch.json +32 -0
- package/scripts/img2mesh/props/ember-furnace.json +30 -0
- package/scripts/img2mesh/props/night-market-gate.json +10 -0
- package/scripts/img2mesh/render_still.py +86 -0
- package/scripts/img2mesh/rig_strip.mjs +46 -0
- package/scripts/img2mesh/rig_transfer.mjs +104 -0
- package/scripts/img2mesh/split_sheet.py +48 -0
- package/scripts/img2mesh/trellis_batch.py +110 -0
- package/scripts/img2mesh/versus_board.py +114 -0
- package/scripts/import-bundle.d.mts +2 -0
- package/scripts/import-bundle.mjs +20 -0
- package/scripts/ktx2-ab-board.py +133 -0
- package/scripts/ktx2-ab.mjs +111 -0
- package/scripts/ktx2-settings.mjs +18 -0
- package/scripts/land.d.mts +14 -0
- package/scripts/land.mjs +809 -0
- package/scripts/lint-dispatch.mjs +14 -0
- package/scripts/map-bake-frames.d.mts +4 -0
- package/scripts/map-bake-frames.mjs +23 -0
- package/scripts/map-geometry.d.mts +9 -0
- package/scripts/map-geometry.mjs +29 -0
- package/scripts/map-world.mjs +162 -0
- package/scripts/mockup-local.sh +46 -0
- package/scripts/music/export-midi.mjs +68 -0
- package/scripts/music/gen/analyze.py +308 -0
- package/scripts/music/gen/audio_jobs.py +46 -0
- package/scripts/music/gen/briefs.json +51 -0
- package/scripts/music/gen/build_page.py +334 -0
- package/scripts/music/gen/folk.json +3187 -0
- package/scripts/music/gen/gen_ace_step.py +156 -0
- package/scripts/music/gen/gen_heartmula.py +187 -0
- package/scripts/music/gen/gen_minimax.py +143 -0
- package/scripts/music/gen/gen_sao.py +122 -0
- package/scripts/music/gen/gen_sao_small.py +104 -0
- package/scripts/music/gen/gen_sfx.py +98 -0
- package/scripts/music/gen/gen_sfx_ezaudio.py +112 -0
- package/scripts/music/gen/gen_sfx_moss.py +112 -0
- package/scripts/music/gen/models.json +61 -0
- package/scripts/music/gen/nalati-jobs.json +104 -0
- package/scripts/music/gen/nalati-score-build.json +119 -0
- package/scripts/music/gen/nalati-score.json +3448 -0
- package/scripts/music/gen/ob7-fit-decisions.json +38 -0
- package/scripts/music/gen/ob7-score-jobs.json +152 -0
- package/scripts/music/gen/ob7-sfx-jobs.json +897 -0
- package/scripts/music/gen/ob7_build.py +469 -0
- package/scripts/music/gen/ob7_generate.py +67 -0
- package/scripts/music/gen/ob7_run.sh +42 -0
- package/scripts/music/gen/orchestral.json +3187 -0
- package/scripts/music/gen/own_score.py +486 -0
- package/scripts/music/gen/ph-jobs.json +27 -0
- package/scripts/music/gen/ph_page.py +222 -0
- package/scripts/music/gen/piano.json +3175 -0
- package/scripts/music/gen/rank_v3.py +248 -0
- package/scripts/music/gen/sfx-best.json +2486 -0
- package/scripts/music/gen/sfx-ezaudio.json +4082 -0
- package/scripts/music/gen/sfx-jobs.json +57 -0
- package/scripts/music/gen/sfx-minimax-jobs.json +16 -0
- package/scripts/music/gen/sfx-minimax.json +289 -0
- package/scripts/music/gen/sfx-moss.json +4082 -0
- package/scripts/music/gen/sfx-nalati-b3-jobs.json +17 -0
- package/scripts/music/gen/sfx-nalati-jobs.json +338 -0
- package/scripts/music/gen/sfx-nalati.json +11202 -0
- package/scripts/music/gen/sfx-nd-jobs.json +57 -0
- package/scripts/music/gen/sfx-nd-moss.json +2097 -0
- package/scripts/music/gen/sfx-nd-sa3-medium.json +2097 -0
- package/scripts/music/gen/sfx-nd-summary.json +38 -0
- package/scripts/music/gen/sfx-peaks.json +7 -0
- package/scripts/music/gen/sfx-ph-jobs.json +169 -0
- package/scripts/music/gen/sfx-ph-moss.json +6564 -0
- package/scripts/music/gen/sfx-ph-sa3-medium.json +7239 -0
- package/scripts/music/gen/sfx-ph-summary.json +63 -0
- package/scripts/music/gen/sfx-sa3-medium.json +4082 -0
- package/scripts/music/gen/sfx-sa3.json +4082 -0
- package/scripts/music/gen/sfx-summary.json +107 -0
- package/scripts/music/gen/sfx_build.py +332 -0
- package/scripts/music/gen/sfx_merge.py +255 -0
- package/scripts/music/gen/sfx_minimax.py +61 -0
- package/scripts/music/gen/sfx_nalati.py +331 -0
- package/scripts/music/gen/sfx_sprite.py +424 -0
- package/scripts/music/gen/stems.py +539 -0
- package/scripts/music/gen/test_loop_meter.py +29 -0
- package/scripts/music/gen/test_ob7_provenance.py +77 -0
- package/scripts/music/gen/v3-folk-build.json +148 -0
- package/scripts/music/gen/v3-folk.json +1818 -0
- package/scripts/music/gen/v3-jobs.json +145 -0
- package/scripts/music/gen/v3-orchestral-build.json +148 -0
- package/scripts/music/gen/v3-orchestral.json +1813 -0
- package/scripts/music/gen/v3-ph-folk-build.json +94 -0
- package/scripts/music/gen/v3-ph-folk.json +1806 -0
- package/scripts/music/gen/v3-ph-orchestral-build.json +94 -0
- package/scripts/music/gen/v3-ph-orchestral.json +1824 -0
- package/scripts/music/gen/v3-ph-piano-build.json +94 -0
- package/scripts/music/gen/v3-ph-piano.json +1818 -0
- package/scripts/music/gen/v3-piano-build.json +148 -0
- package/scripts/music/gen/v3-piano.json +1813 -0
- package/scripts/music/wildshard-theme.mid +0 -0
- package/scripts/music/wildshard-trailer30.mid +0 -0
- package/scripts/named-blob-output.d.mts +8 -0
- package/scripts/named-blob-output.mjs +48 -0
- package/scripts/pack-all.mjs +15 -0
- package/scripts/pid-lock.d.mts +1 -0
- package/scripts/pid-lock.mjs +63 -0
- package/scripts/practice/bake_dummy.py +53 -0
- package/scripts/practice/build_dummies.sh +43 -0
- package/scripts/practice/dummy_parts.py +568 -0
- package/scripts/practice/dummy_rig_gate.py +139 -0
- package/scripts/practice/gate_sheet.py +36 -0
- package/scripts/practice/generate_dummy_unimate.py +132 -0
- package/scripts/practice/pack_dummy.mjs +59 -0
- package/scripts/practice/repair_dummy_weights.mjs +68 -0
- package/scripts/practice/rig_dummy.py +828 -0
- package/scripts/practice/verify_unimate_skin.mjs +356 -0
- package/scripts/preparation-seed.mjs +15 -0
- package/scripts/prepare-basis-tool.mjs +6 -0
- package/scripts/prepare-product.d.mts +14 -0
- package/scripts/prepare-product.mjs +101 -0
- package/scripts/product-build-tools.d.mts +3 -0
- package/scripts/product-build-tools.json +3 -0
- package/scripts/product-build-tools.mjs +31 -0
- package/scripts/publish-public.mjs +7 -0
- package/scripts/push-tables.d.mts +1 -0
- package/scripts/push-tables.mjs +28 -0
- package/scripts/record-shard-mounts.mjs +133 -0
- package/scripts/sdk-externals.d.mts +2 -0
- package/scripts/sdk-externals.mjs +2 -0
- package/scripts/section-inventory.ts +209 -0
- package/scripts/select-candidate.mjs +15 -0
- package/scripts/shard-build-pool.d.mts +4 -0
- package/scripts/shard-build-pool.mjs +53 -0
- package/scripts/shard-line-baseline.json +17 -0
- package/scripts/shard-milestones.d.mts +15 -0
- package/scripts/shard-milestones.mjs +105 -0
- package/scripts/shard-output-report.d.mts +9 -0
- package/scripts/shard-output-report.mjs +85 -0
- package/scripts/shard-platform-cli.mjs +93 -0
- package/scripts/shard-progress.mjs +212 -0
- package/scripts/shard-timelapse.py +102 -0
- package/scripts/shardfile-cold-boot.mjs +79 -0
- package/scripts/shardfile-vite.d.mts +4 -0
- package/scripts/shardfile-vite.mjs +20 -0
- package/scripts/simplify-models.mjs +24 -0
- package/scripts/site-facts.mjs +88 -0
- package/scripts/test-template-gate.mjs +44 -0
- package/scripts/test_golden_compare.py +68 -0
- package/scripts/tex-tiers.cache.json +181 -0
- package/scripts/tex-tiers.mjs +240 -0
- package/scripts/texmem-probe.mjs +184 -0
- package/scripts/unused-assets.mjs +173 -0
- package/scripts/vite-tmp.d.mts +23 -0
- package/scripts/vite-tmp.mjs +157 -0
- package/scripts/wave-line-baselines.json +32 -0
- package/scripts/wildshard.d.mts +4 -0
- package/scripts/wildshard.mjs +105 -0
- package/scripts/witness-checkpoints.d.mts +10 -0
- package/scripts/witness-checkpoints.mjs +84 -0
- package/scripts/witness-generation.d.mts +10 -0
- package/scripts/witness-generation.mjs +45 -0
- package/scripts/witness-manifests.d.mts +8 -0
- package/scripts/witness-manifests.mjs +157 -0
- package/scripts/worktree-ignore.d.mts +4 -0
- package/scripts/worktree-ignore.mjs +36 -0
- package/scripts/worktree-reap.mjs +214 -0
- package/scripts/worktree.mjs +396 -0
- package/scripts/worldclaw/capture-front.sh +28 -0
- package/scripts/worldclaw/design-template.md +62 -0
- package/scripts/worldclaw/spec-map.py +92 -0
- package/scripts/worldclaw/spec.ts +96 -0
- package/skills/wildshard/SKILL.md +50 -0
- package/skills/wildshard-goldens/SKILL.md +54 -0
- package/skills/wildshard-mockup-to-model/SKILL.md +56 -0
- package/skills/wildshard-upgrade/SKILL.md +47 -0
- package/src/.oxfmtrc.json +50 -0
- package/src/.oxlintrc.json +173 -0
- package/src/cli/account/account.ts +199 -0
- package/src/cli/account/command.ts +193 -0
- package/src/cli/account/key.ts +154 -0
- package/src/cli/args.ts +97 -0
- package/src/cli/audio/audio.ts +39 -0
- package/src/cli/bin.mjs +8 -0
- package/src/cli/delete/delete.ts +258 -0
- package/src/cli/help.ts +204 -0
- package/src/cli/hero/adopt.ts +103 -0
- package/src/cli/hero/hero.ts +112 -0
- package/src/cli/hero/stamp.ts +298 -0
- package/src/cli/main.ts +291 -0
- package/src/cli/report.ts +20 -0
- package/src/cli/shardfile/command.ts +49 -0
- package/src/cli/shardfile/shardfile.ts +192 -0
- package/src/cli/upload/api.ts +246 -0
- package/src/cli/upload/compress.ts +55 -0
- package/src/cli/upload/hero.ts +62 -0
- package/src/cli/upload/placement.ts +115 -0
- package/src/cli/upload/provenance.ts +192 -0
- package/src/cli/upload/signature.ts +30 -0
- package/src/cli/upload/upload.ts +269 -0
- package/src/cli/upload/validate.ts +74 -0
- package/src/cli/upload/wire.ts +147 -0
- package/src/cli/version.ts +63 -0
- package/src/commons/bake/portableMath.ts +187 -0
- package/src/commons/catalogue.ts +10 -0
- package/src/commons/courseProgram.ts +32 -0
- package/src/commons/practiceCourse.ts +16 -0
- package/src/commons/scripts/abi.as +14 -0
- package/src/commons/scripts/bridge.as +14 -0
- package/src/commons/scripts/course.as +63 -0
- package/src/scripts/ask-new.sh +29 -0
- package/src/scripts/asks.mjs +141 -0
- package/src/scripts/herdr-prompt.sh +34 -0
- package/src/scripts/herdr-question-open.sh +67 -0
- package/src/scripts/md-wrap.mjs +229 -0
- package/src/server/app.ts +19 -0
- package/src/server/serve.ts +49 -0
- package/src/sharddev/admission.ts +7 -0
- package/src/sharddev/agentFiles.ts +127 -0
- package/src/sharddev/arenaView.ts +15 -0
- package/src/sharddev/as/groupBankV2.ts +36 -0
- package/src/sharddev/as/groupStepV2.ts +13 -0
- package/src/sharddev/as/ws.ts +30 -0
- package/src/sharddev/as/wsV2.ts +180 -0
- package/src/sharddev/assemblyscriptCompiler.d.mts +5 -0
- package/src/sharddev/assemblyscriptCompiler.mjs +14 -0
- package/src/sharddev/assetHandle.ts +84 -0
- package/src/sharddev/assetOwner.ts +70 -0
- package/src/sharddev/assetScope.ts +30 -0
- package/src/sharddev/assets.ts +21 -0
- package/src/sharddev/audio.ts +9 -0
- package/src/sharddev/audioEncode.ts +211 -0
- package/src/sharddev/author.ts +3 -0
- package/src/sharddev/authorError.ts +28 -0
- package/src/sharddev/authorManifest.ts +39 -0
- package/src/sharddev/bake/annulus.ts +19 -0
- package/src/sharddev/bake/assemblyscriptMemo.ts +76 -0
- package/src/sharddev/bake/assemblyscriptMemoPort.ts +4 -0
- package/src/sharddev/bake/authoredWorld.ts +201 -0
- package/src/sharddev/bake/basisEncoder.ts +95 -0
- package/src/sharddev/bake/basisGlb.ts +85 -0
- package/src/sharddev/bake/basisTool.ts +74 -0
- package/src/sharddev/bake/basisToolInputs.ts +476 -0
- package/src/sharddev/bake/byteCodec.ts +33 -0
- package/src/sharddev/bake/canvasAtlas.ts +406 -0
- package/src/sharddev/bake/coarseCopy.ts +59 -0
- package/src/sharddev/bake/colliders.ts +87 -0
- package/src/sharddev/bake/compactGlb.ts +224 -0
- package/src/sharddev/bake/compileScript.ts +119 -0
- package/src/sharddev/bake/compileScriptV2.ts +75 -0
- package/src/sharddev/bake/contactRows.ts +84 -0
- package/src/sharddev/bake/creaturePlacement.ts +117 -0
- package/src/sharddev/bake/export.ts +67 -0
- package/src/sharddev/bake/facetedGeometry.ts +379 -0
- package/src/sharddev/bake/farImpostor.ts +120 -0
- package/src/sharddev/bake/forest.ts +100 -0
- package/src/sharddev/bake/format-hook.mjs +2 -0
- package/src/sharddev/bake/generatorGlb.ts +23 -0
- package/src/sharddev/bake/geometryBounds.ts +77 -0
- package/src/sharddev/bake/geometryError.ts +48 -0
- package/src/sharddev/bake/glb.ts +355 -0
- package/src/sharddev/bake/glbCompression.ts +143 -0
- package/src/sharddev/bake/gltfSource.ts +59 -0
- package/src/sharddev/bake/groundMap.ts +142 -0
- package/src/sharddev/bake/image.ts +20 -0
- package/src/sharddev/bake/isleMap.ts +64 -0
- package/src/sharddev/bake/json.mjs +84 -0
- package/src/sharddev/bake/keyedSky.ts +47 -0
- package/src/sharddev/bake/keyedSkyMemo.ts +39 -0
- package/src/sharddev/bake/kinds.ts +137 -0
- package/src/sharddev/bake/lightSources.ts +31 -0
- package/src/sharddev/bake/mapAssembly.ts +84 -0
- package/src/sharddev/bake/mapRaster.ts +173 -0
- package/src/sharddev/bake/mapRest.ts +57 -0
- package/src/sharddev/bake/mapScenes.ts +234 -0
- package/src/sharddev/bake/materialGraph.ts +32 -0
- package/src/sharddev/bake/meadow.ts +27 -0
- package/src/sharddev/bake/meshoptChoiceMemo.ts +34 -0
- package/src/sharddev/bake/nativeInteractionFacts.ts +5 -0
- package/src/sharddev/bake/nativeLattice.ts +178 -0
- package/src/sharddev/bake/nativeRaster.ts +106 -0
- package/src/sharddev/bake/nativeTerrainField.ts +11 -0
- package/src/sharddev/bake/navigation-json.mjs +38 -0
- package/src/sharddev/bake/navigation.ts +113 -0
- package/src/sharddev/bake/navigationAsset.ts +18 -0
- package/src/sharddev/bake/nearPlaceholder.ts +206 -0
- package/src/sharddev/bake/normalizeRig.ts +80 -0
- package/src/sharddev/bake/phoneAstc.ts +93 -0
- package/src/sharddev/bake/placeholders.ts +581 -0
- package/src/sharddev/bake/placement.ts +80 -0
- package/src/sharddev/bake/portableBytes.ts +18 -0
- package/src/sharddev/bake/portableBytesMemo.ts +50 -0
- package/src/sharddev/bake/practiceCourse.ts +49 -0
- package/src/sharddev/bake/primitives.ts +96 -0
- package/src/sharddev/bake/props.ts +443 -0
- package/src/sharddev/bake/questPlacement.ts +98 -0
- package/src/sharddev/bake/rawTexture.ts +26 -0
- package/src/sharddev/bake/riderArms.ts +97 -0
- package/src/sharddev/bake/rig.ts +95 -0
- package/src/sharddev/bake/riggedHullRecipes.ts +40 -0
- package/src/sharddev/bake/signPlacements.ts +25 -0
- package/src/sharddev/bake/simplifier.ts +52 -0
- package/src/sharddev/bake/skinned.ts +312 -0
- package/src/sharddev/bake/slabChunks.ts +149 -0
- package/src/sharddev/bake/slabs.ts +263 -0
- package/src/sharddev/bake/source-loader.mjs +55 -0
- package/src/sharddev/bake/sourceMetadata.ts +54 -0
- package/src/sharddev/bake/species.ts +368 -0
- package/src/sharddev/bake/specimenCatalogue.ts +47 -0
- package/src/sharddev/bake/splatGround.ts +141 -0
- package/src/sharddev/bake/staticMaterials.ts +171 -0
- package/src/sharddev/bake/terrain.ts +195 -0
- package/src/sharddev/bake/texture.ts +33 -0
- package/src/sharddev/bake/textureWasm.ts +81 -0
- package/src/sharddev/bake/tileEncoder.ts +11 -0
- package/src/sharddev/bake/tileGrid.ts +62 -0
- package/src/sharddev/bake/v2Finite.ts +160 -0
- package/src/sharddev/bake/v2Fuel.ts +71 -0
- package/src/sharddev/bake/wholePartition.ts +74 -0
- package/src/sharddev/bake/wholePieceJoin.ts +147 -0
- package/src/sharddev/bake/world.ts +173 -0
- package/src/sharddev/bake/worldCollision.ts +128 -0
- package/src/sharddev/bake/worldGeometry.ts +237 -0
- package/src/sharddev/bake/worldGlb.ts +123 -0
- package/src/sharddev/bake/worldImage.ts +12 -0
- package/src/sharddev/bake/worldLod.ts +128 -0
- package/src/sharddev/bake/worldRows.ts +102 -0
- package/src/sharddev/bake/worldTextureMemo.ts +63 -0
- package/src/sharddev/bake/zstdBytesMemo.ts +52 -0
- package/src/sharddev/bake.ts +193 -0
- package/src/sharddev/bakePublication.ts +31 -0
- package/src/sharddev/behaviourSource.ts +94 -0
- package/src/sharddev/bin/wildshard.mjs +7 -0
- package/src/sharddev/blobBytes.ts +65 -0
- package/src/sharddev/blobs.ts +138 -0
- package/src/sharddev/bootInventory.ts +129 -0
- package/src/sharddev/bossProfiles.ts +18 -0
- package/src/sharddev/buildBehaviour.ts +77 -0
- package/src/sharddev/buildCacheMetrics.ts +17 -0
- package/src/sharddev/buildDecisionScripts.ts +122 -0
- package/src/sharddev/check.ts +118 -0
- package/src/sharddev/checkProject.ts +127 -0
- package/src/sharddev/cli.ts +200 -0
- package/src/sharddev/clientChannels.ts +169 -0
- package/src/sharddev/clientScripts.ts +10 -0
- package/src/sharddev/commons.ts +77 -0
- package/src/sharddev/commonsCosts.ts +11 -0
- package/src/sharddev/compileMovers.ts +11 -0
- package/src/sharddev/configBoundary.ts +6 -0
- package/src/sharddev/cookInput.ts +40 -0
- package/src/sharddev/crowds.ts +6 -0
- package/src/sharddev/decisionBindingMap.ts +11 -0
- package/src/sharddev/decisionScriptBindings.ts +117 -0
- package/src/sharddev/decisionScripts.ts +28 -0
- package/src/sharddev/decisionSource.ts +51 -0
- package/src/sharddev/dev.ts +113 -0
- package/src/sharddev/director.ts +26 -0
- package/src/sharddev/directorAbi.ts +77 -0
- package/src/sharddev/discoveryDocument.ts +97 -0
- package/src/sharddev/draft.ts +11 -0
- package/src/sharddev/eliteEntryRows.ts +29 -0
- package/src/sharddev/entries.ts +76 -0
- package/src/sharddev/entryReads.ts +73 -0
- package/src/sharddev/executeBundle.ts +55 -0
- package/src/sharddev/finds.ts +5 -0
- package/src/sharddev/formatJsonSchema.ts +3 -0
- package/src/sharddev/generationCache.ts +257 -0
- package/src/sharddev/generationRecipe.ts +94 -0
- package/src/sharddev/handwritten.ts +110 -0
- package/src/sharddev/immutable.ts +14 -0
- package/src/sharddev/interactions.ts +38 -0
- package/src/sharddev/kit/bakedGeometry.ts +16 -0
- package/src/sharddev/kit/geometryPack.ts +110 -0
- package/src/sharddev/ledger.ts +13 -0
- package/src/sharddev/looks/tileField.ts +67 -0
- package/src/sharddev/materialGraphFiles.ts +57 -0
- package/src/sharddev/materials.ts +574 -0
- package/src/sharddev/measure.ts +18 -0
- package/src/sharddev/modes.ts +115 -0
- package/src/sharddev/moverPrograms.ts +213 -0
- package/src/sharddev/movers.ts +75 -0
- package/src/sharddev/nativePopulationRows.ts +46 -0
- package/src/sharddev/newProject.ts +226 -0
- package/src/sharddev/noise.ts +54 -0
- package/src/sharddev/outputProduct.ts +188 -0
- package/src/sharddev/outputRuntime.ts +66 -0
- package/src/sharddev/performancePolicy.ts +29 -0
- package/src/sharddev/phasedBoss.ts +34 -0
- package/src/sharddev/physics.ts +194 -0
- package/src/sharddev/platformSections.ts +42 -0
- package/src/sharddev/plumbing.ts +8 -0
- package/src/sharddev/productOutput.ts +128 -0
- package/src/sharddev/project.ts +337 -0
- package/src/sharddev/projectCompilerIdentity.ts +94 -0
- package/src/sharddev/projectDecisions.ts +66 -0
- package/src/sharddev/projectEntryProof.ts +32 -0
- package/src/sharddev/projectGeneration.ts +219 -0
- package/src/sharddev/projectInputFiles.ts +47 -0
- package/src/sharddev/projectManifest.ts +108 -0
- package/src/sharddev/projectMap.ts +35 -0
- package/src/sharddev/projectOutput.ts +242 -0
- package/src/sharddev/projectPolicy.ts +17 -0
- package/src/sharddev/projectSections.ts +27 -0
- package/src/sharddev/questGraph.ts +25 -0
- package/src/sharddev/quests.ts +65 -0
- package/src/sharddev/random.ts +61 -0
- package/src/sharddev/refusals.ts +304 -0
- package/src/sharddev/reportCard.ts +13 -0
- package/src/sharddev/returnProjectionV2.ts +81 -0
- package/src/sharddev/rows.ts +192 -0
- package/src/sharddev/runtimeImports.ts +38 -0
- package/src/sharddev/runtimeMirrors.ts +39 -0
- package/src/sharddev/runtimePerformance.ts +38 -0
- package/src/sharddev/scene.ts +321 -0
- package/src/sharddev/sceneAnimation.ts +54 -0
- package/src/sharddev/sceneAudio.ts +64 -0
- package/src/sharddev/sceneDeclarations.ts +100 -0
- package/src/sharddev/sceneGraph.ts +139 -0
- package/src/sharddev/sceneTransform.ts +12 -0
- package/src/sharddev/schemaValidation.ts +61 -0
- package/src/sharddev/sections.ts +47 -0
- package/src/sharddev/shardSource.ts +59 -0
- package/src/sharddev/sourceReader.ts +26 -0
- package/src/sharddev/spawns.ts +38 -0
- package/src/sharddev/species/clips.ts +24 -0
- package/src/sharddev/species.ts +29 -0
- package/src/sharddev/speciesBrains.ts +19 -0
- package/src/sharddev/synth.ts +66 -0
- package/src/sharddev/test/compileDualScriptV2.ts +71 -0
- package/src/sharddev/test/compileSimV2.ts +21 -0
- package/src/sharddev/test/diskScriptScenario.ts +86 -0
- package/src/sharddev/test/scriptScenario.ts +249 -0
- package/src/sharddev/test/scriptSource.ts +12 -0
- package/src/sharddev/version.ts +4 -0
- package/src/sharddev/weapons/bowProfile.ts +20 -0
- package/src/sharddev/weapons/firearmRows.ts +11 -0
- package/src/sharddev/weapons/meleeProfile.ts +71 -0
- package/src/sharddev/weapons/thrownProfile.ts +10 -0
- package/src/sharddev/worldScenes.ts +308 -0
- package/src/sharddev/worldSource.ts +82 -0
- package/src/shards/_template/README.md +78 -0
- package/src/shards/_template/assets/2bf489fdb15f1734ddb4c4f32d500ec6da85c765ec7a4eb28dc6781160e7ec8c +0 -0
- package/src/shards/_template/assets/97ec4d8f75f5fa6239ee919444d6dc19fd35896bb305930c1f050ac6e0e0e6a6 +1 -0
- package/src/shards/_template/assets/a6a587a31327f936b1b04c05ade818c73fc8964260918662db43539465e27586 +0 -0
- package/src/shards/_template/assets/b4fbde0422e125b498c3dc8b9a5cc2516c8598f09e9d0e5f6b639b32f98179e6 +0 -0
- package/src/shards/_template/assets/bfa4dfc9c18979f904557ee8deab0058b8a399be10266f5fb1578b403f482fd4 +1 -0
- package/src/shards/_template/assets/ef3b7ff4fd22715771cb7d68a3977a903c5e7c3dc293542687d04b3ef3ace2cb +0 -0
- package/src/shards/_template/assets/f2db05998615ce1cb79ea96be32c168842eb6a2b34ec01feb86d36404603ee54 +0 -0
- package/src/shards/_template/assets/fef98ebb7fce6f66b26e78ac699e5c90f9bdcfaf8cabeb2b58125347eea8b4ab +0 -0
- package/src/shards/_template/behaviour/boss.as +39 -0
- package/src/shards/_template/behaviour/door.as +32 -0
- package/src/shards/_template/behaviour/hooks.json +129 -0
- package/src/shards/_template/behaviour/idle.as +75 -0
- package/src/shards/_template/behaviour/items.as +22 -0
- package/src/shards/_template/card/landscape.jpg +0 -0
- package/src/shards/_template/card/portrait.jpg +0 -0
- package/src/shards/_template/card/thumb.jpg +0 -0
- package/src/shards/_template/data/audio.json +45 -0
- package/src/shards/_template/data/bossDecision.json +83 -0
- package/src/shards/_template/data/budgets.json +70 -0
- package/src/shards/_template/data/card.json +281 -0
- package/src/shards/_template/data/clientScripts.json +987 -0
- package/src/shards/_template/data/creatures.json +65 -0
- package/src/shards/_template/data/director.json +39 -0
- package/src/shards/_template/data/encounters.json +96 -0
- package/src/shards/_template/data/items.json +172 -0
- package/src/shards/_template/data/layout.json +66 -0
- package/src/shards/_template/data/ledger.json +32 -0
- package/src/shards/_template/data/look.json +521 -0
- package/src/shards/_template/data/map.json +64 -0
- package/src/shards/_template/data/moves.json +16 -0
- package/src/shards/_template/data/placeholder.json +8 -0
- package/src/shards/_template/data/plumbing.json +32 -0
- package/src/shards/_template/data/quests.json +223 -0
- package/src/shards/_template/data/rows.json +423 -0
- package/src/shards/_template/data/skins.json +66 -0
- package/src/shards/_template/data/spawn.json +6 -0
- package/src/shards/_template/data/targets.json +150 -0
- package/src/shards/_template/data/text.json +12 -0
- package/src/shards/_template/data/ui.json +33 -0
- package/src/shards/_template/data/water.json +13 -0
- package/src/shards/_template/generators/behaviour.ts +34 -0
- package/src/shards/_template/generators/boss.ts +29 -0
- package/src/shards/_template/generators/buildOptions.ts +2 -0
- package/src/shards/_template/generators/cell.ts +224 -0
- package/src/shards/_template/generators/districts.ts +215 -0
- package/src/shards/_template/generators/farLook.ts +15 -0
- package/src/shards/_template/generators/generate.ts +27 -0
- package/src/shards/_template/generators/ground.ts +15 -0
- package/src/shards/_template/generators/kit.ts +69 -0
- package/src/shards/_template/generators/landscape.ts +59 -0
- package/src/shards/_template/generators/landscapeNoise.ts +62 -0
- package/src/shards/_template/generators/mapInputs.ts +10 -0
- package/src/shards/_template/generators/product.ts +100 -0
- package/src/shards/_template/generators/productOutput.ts +18 -0
- package/src/shards/_template/generators/props.ts +9 -0
- package/src/shards/_template/generators/templatePropsSource.ts +58 -0
- package/src/shards/_template/generators/terrain.ts +17 -0
- package/src/shards/_template/generators/world.ts +630 -0
- package/src/shards/_template/hero.json +10 -0
- package/src/shards/_template/look/entry-reads.json +20 -0
- package/src/shards/_template/manifest.json +281 -0
- package/src/shards/_template/shard.config.ts +10 -0
- package/src/shared/health.ts +10 -0
- package/src/tools/build-web.ts +59 -0
- package/src/tsconfig.json +30 -0
- package/src/web/app.tsx +53 -0
- package/src/web/index.html +12 -0
- package/src/web/main.tsx +10 -0
- package/src/web/tsconfig.json +13 -0
- package/tsconfig.author.json +23 -0
- package/tsconfig.commons.json +21 -0
- package/tsconfig.json +47 -0
- package/tsconfig.sharddev.json +20 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_note": "rot: Blender Euler XYZ degrees after import (Hunyuan faces glTF +Z = Blender -Y; the ref's right = +X). fit: tips (beak tip to tail tip) | span | length | height. level: turn the wing plane horizontal (PCA). flatten: wings to the root's height. span (fly): stretch the wings outboard of the body to this span after fitting the length.",
|
|
3
|
+
"raven_perch": {
|
|
4
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-raven-perch.glb",
|
|
5
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
6
|
+
"pose": "perch",
|
|
7
|
+
"rot": [
|
|
8
|
+
0,
|
|
9
|
+
0,
|
|
10
|
+
-90
|
|
11
|
+
],
|
|
12
|
+
"fit": "tips",
|
|
13
|
+
"size": 0.62,
|
|
14
|
+
"tris": 1200,
|
|
15
|
+
"neck": [
|
|
16
|
+
0,
|
|
17
|
+
0.1,
|
|
18
|
+
0.05
|
|
19
|
+
],
|
|
20
|
+
"headAxis": [
|
|
21
|
+
0,
|
|
22
|
+
0.8,
|
|
23
|
+
0.6
|
|
24
|
+
],
|
|
25
|
+
"tailRoot": [
|
|
26
|
+
0,
|
|
27
|
+
-0.07,
|
|
28
|
+
-0.12
|
|
29
|
+
],
|
|
30
|
+
"tailAxis": [
|
|
31
|
+
0,
|
|
32
|
+
-0.55,
|
|
33
|
+
-0.83
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"raven_fly": {
|
|
37
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-raven-fly.glb",
|
|
38
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
39
|
+
"pose": "fly",
|
|
40
|
+
"rot": [
|
|
41
|
+
90,
|
|
42
|
+
180,
|
|
43
|
+
0
|
|
44
|
+
],
|
|
45
|
+
"level": true,
|
|
46
|
+
"flatten": true,
|
|
47
|
+
"fit": "length",
|
|
48
|
+
"size": 0.62,
|
|
49
|
+
"tris": 900,
|
|
50
|
+
"span": 1.2,
|
|
51
|
+
"neck": [
|
|
52
|
+
0,
|
|
53
|
+
0.03,
|
|
54
|
+
0.15
|
|
55
|
+
],
|
|
56
|
+
"tailRoot": [
|
|
57
|
+
0,
|
|
58
|
+
-0.01,
|
|
59
|
+
-0.11
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"owl_perch": {
|
|
63
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-owl-perch.glb",
|
|
64
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
65
|
+
"pose": "perch",
|
|
66
|
+
"rot": [
|
|
67
|
+
0,
|
|
68
|
+
0,
|
|
69
|
+
-90
|
|
70
|
+
],
|
|
71
|
+
"fit": "tips",
|
|
72
|
+
"size": 0.7,
|
|
73
|
+
"tris": 1200,
|
|
74
|
+
"remesh": 0.004,
|
|
75
|
+
"neck": [
|
|
76
|
+
0,
|
|
77
|
+
0.11,
|
|
78
|
+
0.08
|
|
79
|
+
],
|
|
80
|
+
"headAxis": [
|
|
81
|
+
0,
|
|
82
|
+
0.97,
|
|
83
|
+
0.25
|
|
84
|
+
],
|
|
85
|
+
"tailRoot": [
|
|
86
|
+
0,
|
|
87
|
+
-0.12,
|
|
88
|
+
-0.15
|
|
89
|
+
],
|
|
90
|
+
"tailAxis": [
|
|
91
|
+
0,
|
|
92
|
+
-0.7,
|
|
93
|
+
-0.7
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
"owl_fly": {
|
|
97
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-owl-fly.glb",
|
|
98
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
99
|
+
"pose": "fly",
|
|
100
|
+
"rot": [
|
|
101
|
+
90,
|
|
102
|
+
180,
|
|
103
|
+
0
|
|
104
|
+
],
|
|
105
|
+
"level": true,
|
|
106
|
+
"flatten": true,
|
|
107
|
+
"fit": "length",
|
|
108
|
+
"size": 0.7,
|
|
109
|
+
"tris": 900,
|
|
110
|
+
"span": 1.4,
|
|
111
|
+
"inflate": 1.7,
|
|
112
|
+
"neck": [
|
|
113
|
+
0,
|
|
114
|
+
0.03,
|
|
115
|
+
0.17
|
|
116
|
+
],
|
|
117
|
+
"tailRoot": [
|
|
118
|
+
0,
|
|
119
|
+
-0.03,
|
|
120
|
+
-0.15
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"wood_perch": {
|
|
124
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-woodpecker-perch.glb",
|
|
125
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
126
|
+
"pose": "perch",
|
|
127
|
+
"rot": [
|
|
128
|
+
0,
|
|
129
|
+
0,
|
|
130
|
+
-90
|
|
131
|
+
],
|
|
132
|
+
"fit": "tips",
|
|
133
|
+
"size": 0.45,
|
|
134
|
+
"tris": 1200,
|
|
135
|
+
"neck": [
|
|
136
|
+
0,
|
|
137
|
+
0.035,
|
|
138
|
+
0.02
|
|
139
|
+
],
|
|
140
|
+
"headAxis": [
|
|
141
|
+
0,
|
|
142
|
+
0.8,
|
|
143
|
+
0.6
|
|
144
|
+
],
|
|
145
|
+
"tailRoot": [
|
|
146
|
+
0,
|
|
147
|
+
-0.1,
|
|
148
|
+
-0.1
|
|
149
|
+
],
|
|
150
|
+
"tailAxis": [
|
|
151
|
+
0,
|
|
152
|
+
-0.63,
|
|
153
|
+
-0.77
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"wood_fly": {
|
|
157
|
+
"src": "~/ml/img2mesh/out/pine-hollow-birds-hy/ref-woodpecker-fly.glb",
|
|
158
|
+
"gen": "Hunyuan3D-2 full + paint",
|
|
159
|
+
"pose": "fly",
|
|
160
|
+
"rot": [
|
|
161
|
+
90,
|
|
162
|
+
180,
|
|
163
|
+
0
|
|
164
|
+
],
|
|
165
|
+
"level": true,
|
|
166
|
+
"flatten": true,
|
|
167
|
+
"fit": "length",
|
|
168
|
+
"size": 0.45,
|
|
169
|
+
"tris": 900,
|
|
170
|
+
"span": 0.66,
|
|
171
|
+
"neck": [
|
|
172
|
+
0,
|
|
173
|
+
0.05,
|
|
174
|
+
0.13
|
|
175
|
+
],
|
|
176
|
+
"tailRoot": [
|
|
177
|
+
0,
|
|
178
|
+
-0.01,
|
|
179
|
+
-0.06
|
|
180
|
+
]
|
|
181
|
+
},
|
|
182
|
+
"_grade": {
|
|
183
|
+
"owl_perch": {
|
|
184
|
+
"eyes": [
|
|
185
|
+
{
|
|
186
|
+
"at": [
|
|
187
|
+
-0.047,
|
|
188
|
+
0.222,
|
|
189
|
+
0.2
|
|
190
|
+
],
|
|
191
|
+
"dir": [
|
|
192
|
+
0,
|
|
193
|
+
0,
|
|
194
|
+
1
|
|
195
|
+
],
|
|
196
|
+
"r": 0.012
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"at": [
|
|
200
|
+
0.047,
|
|
201
|
+
0.222,
|
|
202
|
+
0.2
|
|
203
|
+
],
|
|
204
|
+
"dir": [
|
|
205
|
+
0,
|
|
206
|
+
0,
|
|
207
|
+
1
|
|
208
|
+
],
|
|
209
|
+
"r": 0.012
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
"owl_fly": {
|
|
214
|
+
"eyes": [
|
|
215
|
+
{
|
|
216
|
+
"at": [
|
|
217
|
+
-0.036,
|
|
218
|
+
0.05,
|
|
219
|
+
0.267
|
|
220
|
+
],
|
|
221
|
+
"dir": [
|
|
222
|
+
0,
|
|
223
|
+
1,
|
|
224
|
+
0.25
|
|
225
|
+
],
|
|
226
|
+
"r": 0.011
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"at": [
|
|
230
|
+
0.036,
|
|
231
|
+
0.05,
|
|
232
|
+
0.267
|
|
233
|
+
],
|
|
234
|
+
"dir": [
|
|
235
|
+
0,
|
|
236
|
+
1,
|
|
237
|
+
0.25
|
|
238
|
+
],
|
|
239
|
+
"r": 0.011
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
"raven_perch": {
|
|
244
|
+
"lMean": 17,
|
|
245
|
+
"lMax": 32
|
|
246
|
+
},
|
|
247
|
+
"raven_fly": {
|
|
248
|
+
"lMean": 17,
|
|
249
|
+
"lMax": 32
|
|
250
|
+
},
|
|
251
|
+
"wood_fly": {
|
|
252
|
+
"lMean": 25
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Pine Hollow birds (round 16), step 2: the six 1024² bakes → one colour-matched base-colour atlas.
|
|
3
|
+
|
|
4
|
+
python3 scripts/img2mesh/birds/birds_atlas.py --post <post dir> --refs <cutout dir> --out <dir> [--grade scripts/img2mesh/birds/birds.json]
|
|
5
|
+
|
|
6
|
+
Layout (4×2 tiles of 512², row 0 at the TOP of the image): raven_perch, raven_fly, owl_perch, owl_fly /
|
|
7
|
+
wood_perch, wood_fly, white, neutral grey. Per tile: the islands (from <mesh>.json uvTris) keep the bake, the gutters are
|
|
8
|
+
push-pull filled (no dark mip bleed), then the island pixels are matched in CIELAB to the reference's foreground (the
|
|
9
|
+
cutout's alpha): the mean fully (or grade.lMean), the spread clamped (grade.k), optional value clamps (grade.lMin/lMax),
|
|
10
|
+
then grade.eyes: an iris + pupil painted where a cylinder meets the front-most surface (<mesh>.pos.npy, the position bake).
|
|
11
|
+
Writes atlas.png (2048×1024), atlas.phone.png (1024×512) and tiles/<mesh>.png.
|
|
12
|
+
"""
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import os
|
|
16
|
+
|
|
17
|
+
import numpy as np
|
|
18
|
+
from PIL import Image, ImageDraw, ImageFilter
|
|
19
|
+
|
|
20
|
+
ORDER = ["raven_perch", "raven_fly", "owl_perch", "owl_fly", "wood_perch", "wood_fly"]
|
|
21
|
+
REF = {"raven_perch": "ref-raven-perch", "raven_fly": "ref-raven-fly", "owl_perch": "ref-owl-perch",
|
|
22
|
+
"owl_fly": "ref-owl-fly", "wood_perch": "ref-woodpecker-perch", "wood_fly": "ref-woodpecker-fly"}
|
|
23
|
+
TILE = 512
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def srgb2lin(c):
|
|
27
|
+
return np.where(c <= 0.04045, c / 12.92, ((c + 0.055) / 1.055) ** 2.4)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def lin2srgb(c):
|
|
31
|
+
c = np.clip(c, 0, 1)
|
|
32
|
+
return np.where(c <= 0.0031308, c * 12.92, 1.055 * c ** (1 / 2.4) - 0.055)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
M = np.array([[0.4124, 0.3576, 0.1805], [0.2126, 0.7152, 0.0722], [0.0193, 0.1192, 0.9505]])
|
|
36
|
+
WP = np.array([0.95047, 1.0, 1.08883])
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def rgb2lab(rgb):
|
|
40
|
+
xyz = srgb2lin(rgb) @ M.T / WP
|
|
41
|
+
f = np.where(xyz > 0.008856, np.cbrt(xyz), 7.787 * xyz + 16 / 116)
|
|
42
|
+
return np.stack([116 * f[..., 1] - 16, 500 * (f[..., 0] - f[..., 1]), 200 * (f[..., 1] - f[..., 2])], -1)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def lab2rgb(lab):
|
|
46
|
+
fy = (lab[..., 0] + 16) / 116
|
|
47
|
+
fx, fz = fy + lab[..., 1] / 500, fy - lab[..., 2] / 200
|
|
48
|
+
f = np.stack([fx, fy, fz], -1)
|
|
49
|
+
xyz = np.where(f ** 3 > 0.008856, f ** 3, (f - 16 / 116) / 7.787) * WP
|
|
50
|
+
return lin2srgb(xyz @ np.linalg.inv(M).T)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def pushpull(img, mask):
|
|
54
|
+
"""fill every pixel outside `mask` from the nearest island colour (a mask-weighted pyramid)"""
|
|
55
|
+
levels = [(img * mask[..., None], mask.astype(np.float64))]
|
|
56
|
+
while levels[-1][1].shape[0] > 1:
|
|
57
|
+
c, w = levels[-1]
|
|
58
|
+
h2, w2 = c.shape[0] // 2, c.shape[1] // 2
|
|
59
|
+
c = c[:h2 * 2, :w2 * 2].reshape(h2, 2, w2, 2, 3).sum((1, 3))
|
|
60
|
+
w = w[:h2 * 2, :w2 * 2].reshape(h2, 2, w2, 2).sum((1, 3))
|
|
61
|
+
levels.append((c, w))
|
|
62
|
+
fill = levels[-1][0] / np.maximum(levels[-1][1], 1e-9)[..., None]
|
|
63
|
+
for c, w in reversed(levels[:-1]):
|
|
64
|
+
up = np.repeat(np.repeat(fill, 2, 0), 2, 1)[:c.shape[0], :c.shape[1]]
|
|
65
|
+
own = c / np.maximum(w, 1e-9)[..., None]
|
|
66
|
+
fill = np.where((w > 0)[..., None], own, up)
|
|
67
|
+
return np.where(mask[..., None], img, fill)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
ap = argparse.ArgumentParser()
|
|
71
|
+
ap.add_argument("--post", required=True)
|
|
72
|
+
ap.add_argument("--refs", required=True)
|
|
73
|
+
ap.add_argument("--out", required=True)
|
|
74
|
+
ap.add_argument("--grade", default="")
|
|
75
|
+
a = ap.parse_args()
|
|
76
|
+
os.makedirs(os.path.join(a.out, "tiles"), exist_ok=True)
|
|
77
|
+
G = json.load(open(a.grade)).get("_grade", {}) if a.grade else {}
|
|
78
|
+
|
|
79
|
+
atlas = np.zeros((2 * TILE, 4 * TILE, 3))
|
|
80
|
+
atlas[TILE:, 2 * TILE:3 * TILE] = 1.0 # tile 6: pure white
|
|
81
|
+
atlas[TILE:, 3 * TILE:] = 0.5 # tile 7: neutral grey
|
|
82
|
+
report = {}
|
|
83
|
+
for i, name in enumerate(ORDER):
|
|
84
|
+
bake = np.asarray(Image.open(os.path.join(a.post, name + ".png")).convert("RGB"), dtype=np.float64) / 255
|
|
85
|
+
S = bake.shape[0]
|
|
86
|
+
meta = json.load(open(os.path.join(a.post, name + ".json")))
|
|
87
|
+
mk = Image.new("L", (S, S), 0)
|
|
88
|
+
d = ImageDraw.Draw(mk)
|
|
89
|
+
for tri in meta["uvTris"]:
|
|
90
|
+
d.polygon([(u * S, (1 - v) * S) for u, v in tri], fill=255)
|
|
91
|
+
mask_big = np.asarray(mk.filter(ImageFilter.MaxFilter(3))) > 127 # 1 px grow: the bake's own edge texels
|
|
92
|
+
core = np.asarray(mk.filter(ImageFilter.MinFilter(5))) > 127 # stats away from island edges
|
|
93
|
+
lab = rgb2lab(bake)
|
|
94
|
+
ref = np.asarray(Image.open(os.path.join(a.refs, REF[name] + ".png")).convert("RGBA"), dtype=np.float64) / 255
|
|
95
|
+
fg = ref[..., 3] > 0.9
|
|
96
|
+
rl = rgb2lab(ref[..., :3][fg])
|
|
97
|
+
tl = lab[core]
|
|
98
|
+
g = G.get(name, {})
|
|
99
|
+
k = g.get("k", [0.8, 1.25])
|
|
100
|
+
out = lab.copy()
|
|
101
|
+
stats = {}
|
|
102
|
+
for ch in range(3):
|
|
103
|
+
mt, st = tl[:, ch].mean(), tl[:, ch].std() + 1e-6
|
|
104
|
+
mr, sr = rl[:, ch].mean(), rl[:, ch].std()
|
|
105
|
+
if ch == 0 and "lMean" in g: # a hand target for the mean lightness (the raven: the photo's sheen lifts its mean)
|
|
106
|
+
mr = g["lMean"]
|
|
107
|
+
kk = float(np.clip(sr / st, k[0], k[1]))
|
|
108
|
+
mean_w = g.get("meanW", 1.0)
|
|
109
|
+
out[..., ch] = (lab[..., ch] - mt) * kk + mt + (mr - mt) * mean_w
|
|
110
|
+
stats["Lab"[ch]] = {"tile": [round(mt, 1), round(st, 1)], "ref": [round(mr, 1), round(sr, 1)], "k": round(kk, 2)}
|
|
111
|
+
if "lMin" in g or "lMax" in g:
|
|
112
|
+
out[..., 0] = np.clip(out[..., 0], g.get("lMin", 0), g.get("lMax", 100))
|
|
113
|
+
rgb = np.clip(lab2rgb(out), 0, 1)
|
|
114
|
+
for eye in g.get("eyes", []):
|
|
115
|
+
# paint an iris + pupil where a cylinder along `dir` through `at` (glTF) meets the front-most surface
|
|
116
|
+
posp = os.path.join(a.post, name + ".pos.npy")
|
|
117
|
+
Pm = np.load(posp).astype(np.float64)
|
|
118
|
+
Pg = np.stack([Pm[..., 0], Pm[..., 2], -Pm[..., 1]], -1) # Blender → glTF
|
|
119
|
+
e, dv = np.array(eye["at"], dtype=np.float64), np.array(eye["dir"], dtype=np.float64)
|
|
120
|
+
dv /= np.linalg.norm(dv)
|
|
121
|
+
D = Pg - e
|
|
122
|
+
along = D @ dv
|
|
123
|
+
perp = np.linalg.norm(D - along[..., None] * dv, axis=-1)
|
|
124
|
+
r = eye["r"]
|
|
125
|
+
cand = (perp < r * 1.3) & mask_big
|
|
126
|
+
if not cand.any():
|
|
127
|
+
print("eye missed", name, eye["at"]); continue
|
|
128
|
+
front = cand & (along > along[cand].max() - eye.get("depth", 0.02))
|
|
129
|
+
iris = np.array([int(eye.get("iris", "#e3b320")[i:i + 2], 16) for i in (1, 3, 5)]) / 255
|
|
130
|
+
t = np.clip(perp / r, 0, 1.3)
|
|
131
|
+
col = iris * (1.0 - 0.35 * np.clip((t - 0.7) / 0.3, 0, 1))[..., None] # a darker rim
|
|
132
|
+
col = np.where((t < eye.get("pupil", 0.5))[..., None], 0.03, col)
|
|
133
|
+
edge = np.clip((1.3 - t) / 0.3, 0, 1)[..., None] # feather into the face
|
|
134
|
+
sel = front[..., None]
|
|
135
|
+
rgb = np.where(sel, rgb * (1 - edge) + col * edge, rgb)
|
|
136
|
+
print(f"eye painted {name} {int(front.sum())} texels")
|
|
137
|
+
rgb = pushpull(rgb, mask_big)
|
|
138
|
+
tile = Image.fromarray((rgb * 255 + 0.5).astype(np.uint8)).resize((TILE, TILE), Image.LANCZOS)
|
|
139
|
+
tile.save(os.path.join(a.out, "tiles", name + ".png"))
|
|
140
|
+
col, row = i % 4, i // 4
|
|
141
|
+
atlas[row * TILE:(row + 1) * TILE, col * TILE:(col + 1) * TILE] = np.asarray(tile, dtype=np.float64) / 255
|
|
142
|
+
v = (rgb[core] * 255).max(-1)
|
|
143
|
+
stats["value_p10_p50_p90"] = [int(np.percentile(v, p)) for p in (10, 50, 90)]
|
|
144
|
+
report[name] = stats
|
|
145
|
+
print(name, json.dumps(stats), flush=True)
|
|
146
|
+
A = Image.fromarray((atlas * 255 + 0.5).astype(np.uint8))
|
|
147
|
+
A.save(os.path.join(a.out, "atlas.png"))
|
|
148
|
+
A.resize((2 * TILE, TILE), Image.LANCZOS).save(os.path.join(a.out, "atlas.phone.png"))
|
|
149
|
+
json.dump(report, open(os.path.join(a.out, "atlas-report.json"), "w"), indent=1)
|
|
150
|
+
print("atlas", A.size)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// birds_fix_preview.mjs — E322 F-M5: run src/shards/pine-hollow/life/birdFix.ts (Debug ▸ Bird fix = B) on birds.glb in Node and
|
|
3
|
+
// write GLBs to render: the owl's flying body inflated, the perched woodpecker clinging — both in the frame the game
|
|
4
|
+
// shows them in (the owl as flown; the woodpecker in its perch's world frame: +y up, the bark the plane z = 0.05).
|
|
5
|
+
//
|
|
6
|
+
// node --import ./scripts/bake-loader.mjs scripts/img2mesh/birds/birds_fix_preview.mjs <birds.glb> <birds.json> <out dir>
|
|
7
|
+
//
|
|
8
|
+
// Writes <out>/birds-A.glb (today, same frames) and <out>/birds-B.glb (fixed); render them with birds_fix_render.py.
|
|
9
|
+
import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
10
|
+
import * as THREE from 'three';
|
|
11
|
+
import { inflateBody, clingPose } from '../../../src/shards/pine-hollow/life/birdFix.ts';
|
|
12
|
+
|
|
13
|
+
const [src, sidePath, out] = process.argv.slice(2);
|
|
14
|
+
mkdirSync(out, { recursive: true });
|
|
15
|
+
const side = JSON.parse(readFileSync(sidePath, 'utf8')).meshes;
|
|
16
|
+
const WOOD_PITCH = 1.3, WOOD_FEET = 0.115; // birdModels.ts BIRDS: the woodpecker's perch pitch and feet
|
|
17
|
+
|
|
18
|
+
function parse(buf) {
|
|
19
|
+
const len = buf.readUInt32LE(12), json = JSON.parse(buf.subarray(20, 20 + len).toString());
|
|
20
|
+
const binLen = buf.readUInt32LE(20 + len), bin = Buffer.from(buf.subarray(28 + len, 28 + len + binLen));
|
|
21
|
+
return { json, bin };
|
|
22
|
+
}
|
|
23
|
+
function write(path, json, bin) {
|
|
24
|
+
let j = Buffer.from(JSON.stringify(json)); j = Buffer.concat([j, Buffer.alloc((4 - (j.length % 4)) % 4, 0x20)]);
|
|
25
|
+
const b = Buffer.concat([bin, Buffer.alloc((4 - (bin.length % 4)) % 4)]);
|
|
26
|
+
const h = Buffer.alloc(12); h.writeUInt32LE(0x46546c67, 0); h.writeUInt32LE(2, 4); h.writeUInt32LE(12 + 8 + j.length + 8 + b.length, 8);
|
|
27
|
+
const cj = Buffer.alloc(8); cj.writeUInt32LE(j.length, 0); cj.writeUInt32LE(0x4e4f534a, 4);
|
|
28
|
+
const cb = Buffer.alloc(8); cb.writeUInt32LE(b.length, 0); cb.writeUInt32LE(0x004e4942, 4);
|
|
29
|
+
writeFileSync(path, Buffer.concat([h, cj, j, cb, b]));
|
|
30
|
+
}
|
|
31
|
+
const view = (json, bin, ai) => {
|
|
32
|
+
const a = json.accessors[ai], bv = json.bufferViews[a.bufferView], n = { SCALAR: 1, VEC2: 2, VEC3: 3 }[a.type];
|
|
33
|
+
const off = (bv.byteOffset ?? 0) + (a.byteOffset ?? 0);
|
|
34
|
+
if (a.componentType === 5126) return new Float32Array(bin.buffer, bin.byteOffset + off, a.count * n);
|
|
35
|
+
if (a.componentType === 5123) return new Uint16Array(bin.buffer, bin.byteOffset + off, a.count * n);
|
|
36
|
+
return new Uint32Array(bin.buffer, bin.byteOffset + off, a.count * n);
|
|
37
|
+
};
|
|
38
|
+
/** birdModels.ts smoothNormals, on flat arrays */
|
|
39
|
+
function smoothNormals(pos, idx, nor) {
|
|
40
|
+
const key = (i) => `${Math.round(pos[i * 3] * 2e4)},${Math.round(pos[i * 3 + 1] * 2e4)},${Math.round(pos[i * 3 + 2] * 2e4)}`;
|
|
41
|
+
const acc = new Map(), a = new THREE.Vector3(), b = new THREE.Vector3(), c = new THREE.Vector3();
|
|
42
|
+
for (let t = 0; t < idx.length / 3; t++) {
|
|
43
|
+
const i0 = idx[t * 3], i1 = idx[t * 3 + 1], i2 = idx[t * 3 + 2];
|
|
44
|
+
a.fromArray(pos, i0 * 3); b.fromArray(pos, i1 * 3); c.fromArray(pos, i2 * 3);
|
|
45
|
+
const n = c.sub(b).cross(a.sub(b));
|
|
46
|
+
for (const i of [i0, i1, i2]) { const k = key(i), v = acc.get(k); if (v) v.add(n); else acc.set(k, n.clone()); }
|
|
47
|
+
}
|
|
48
|
+
for (let i = 0; i < pos.length / 3; i++) { const v = acc.get(key(i)); if (!v) continue; v.normalize(); nor[i * 3] = v.x; nor[i * 3 + 1] = v.y; nor[i * 3 + 2] = v.z; }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
for (const variant of ['A', 'B']) {
|
|
52
|
+
const parsed = parse(readFileSync(src)), json = parsed.json;
|
|
53
|
+
let bin = parsed.bin;
|
|
54
|
+
for (const node of json.nodes) {
|
|
55
|
+
if (node.mesh === undefined) continue;
|
|
56
|
+
const prim = json.meshes[node.mesh].primitives[0];
|
|
57
|
+
let pos = view(json, bin, prim.attributes.POSITION);
|
|
58
|
+
const nor = view(json, bin, prim.attributes.NORMAL), idx = view(json, bin, prim.indices);
|
|
59
|
+
const s = side[node.name];
|
|
60
|
+
if (node.name === 'owl_fly' && variant === 'B') { inflateBody(pos, nor, s); smoothNormals(pos, idx, nor); }
|
|
61
|
+
if (node.name === 'wood_perch') {
|
|
62
|
+
// birdModels.ts's pose frame (lift, then the level tilt), then — for B — the cling, then the perch's world frame
|
|
63
|
+
const lift = new THREE.Matrix4().makeTranslation(0, -WOOD_FEET - s.feetY, 0);
|
|
64
|
+
const tilt = Math.atan2(s.beakTip[1] - s.tailRoot[1], s.beakTip[2] - s.tailRoot[2]);
|
|
65
|
+
const g2p = new THREE.Matrix4().makeRotationX(tilt).multiply(lift);
|
|
66
|
+
const p = new THREE.Vector3();
|
|
67
|
+
for (let i = 0; i < pos.length / 3; i++) { p.fromArray(pos, i * 3).applyMatrix4(g2p); p.toArray(pos, i * 3); }
|
|
68
|
+
let P = pos, N = nor, I = idx, appended = null;
|
|
69
|
+
if (variant === 'B') {
|
|
70
|
+
// the cling, then its new feet appended (birdModels.ts appendFeet): new accessors at the end of the buffer
|
|
71
|
+
const uv = view(json, bin, prim.attributes.TEXCOORD_0);
|
|
72
|
+
const { feet } = clingPose(pos, s, g2p, { pitch: WOOD_PITCH, uv });
|
|
73
|
+
const n0 = pos.length / 3;
|
|
74
|
+
P = new Float32Array(pos.length + feet.pos.length); P.set(pos); P.set(feet.pos, pos.length);
|
|
75
|
+
N = new Float32Array(P.length);
|
|
76
|
+
const U = new Float32Array(uv.length + feet.uv.length); U.set(uv); U.set(feet.uv, uv.length);
|
|
77
|
+
I = new Uint32Array(idx.length + feet.idx.length); I.set(idx); I.set(Array.from(feet.idx, (v) => v + n0), idx.length);
|
|
78
|
+
const add = (arr, type, target) => {
|
|
79
|
+
const pad = (4 - (bin.length % 4)) % 4, off = bin.length + pad;
|
|
80
|
+
bin = Buffer.concat([bin, Buffer.alloc(pad), Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength)]);
|
|
81
|
+
json.bufferViews.push({ buffer: 0, byteOffset: off, byteLength: arr.byteLength, ...(target ? { target } : {}) });
|
|
82
|
+
json.accessors.push({ bufferView: json.bufferViews.length - 1, componentType: arr instanceof Uint32Array ? 5125 : 5126, count: arr.length / { VEC3: 3, VEC2: 2, SCALAR: 1 }[type], type });
|
|
83
|
+
return json.accessors.length - 1;
|
|
84
|
+
};
|
|
85
|
+
appended = () => { // after the world move and the normals: add() copies
|
|
86
|
+
prim.attributes.POSITION = add(P, 'VEC3', 34962); prim.attributes.NORMAL = add(N, 'VEC3', 34962);
|
|
87
|
+
prim.attributes.TEXCOORD_0 = add(U, 'VEC2', 34962); prim.indices = add(I, 'SCALAR', 34963);
|
|
88
|
+
json.buffers[0].byteLength = bin.length;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const W = new THREE.Matrix4().makeRotationX(-WOOD_PITCH);
|
|
92
|
+
for (let i = 0; i < P.length / 3; i++) { p.fromArray(P, i * 3).applyMatrix4(W); p.toArray(P, i * 3); }
|
|
93
|
+
smoothNormals(P, I, N);
|
|
94
|
+
appended?.();
|
|
95
|
+
pos = P;
|
|
96
|
+
}
|
|
97
|
+
const a = json.accessors[prim.attributes.POSITION];
|
|
98
|
+
a.min = [0, 1, 2].map((k) => Math.min(...Array.from({ length: pos.length / 3 }, (_, i) => pos[i * 3 + k])));
|
|
99
|
+
a.max = [0, 1, 2].map((k) => Math.max(...Array.from({ length: pos.length / 3 }, (_, i) => pos[i * 3 + k])));
|
|
100
|
+
}
|
|
101
|
+
write(`${out}/birds-${variant}.glb`, json, bin);
|
|
102
|
+
console.log(`${out}/birds-${variant}.glb`);
|
|
103
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""E322 F-M5: side / front / 3-4 renders of birds_fix_preview.mjs's GLBs (owl_fly, wood_perch), the woodpecker against its
|
|
2
|
+
bark (the plane glTF z = 0.05: the perch's world frame puts the trunk there).
|
|
3
|
+
|
|
4
|
+
blender -b -P scripts/img2mesh/birds/birds_fix_render.py -- <birds-X.glb> <out prefix> [--size 480]
|
|
5
|
+
"""
|
|
6
|
+
import math
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
import bpy
|
|
10
|
+
from mathutils import Vector
|
|
11
|
+
|
|
12
|
+
argv = sys.argv[sys.argv.index("--") + 1:]
|
|
13
|
+
src, out = argv[0], argv[1]
|
|
14
|
+
size = int(argv[argv.index("--size") + 1]) if "--size" in argv else 480
|
|
15
|
+
|
|
16
|
+
bpy.ops.wm.read_factory_settings(use_empty=True)
|
|
17
|
+
bpy.ops.import_scene.gltf(filepath=src)
|
|
18
|
+
objs = {o.name: o for o in bpy.context.scene.objects if o.type == "MESH"}
|
|
19
|
+
sc = bpy.context.scene
|
|
20
|
+
sc.render.resolution_x = sc.render.resolution_y = size
|
|
21
|
+
sc.view_settings.view_transform = "Standard"
|
|
22
|
+
eng = {e.identifier for e in bpy.types.RenderSettings.bl_rna.properties["engine"].enum_items}
|
|
23
|
+
sc.render.engine = "BLENDER_EEVEE_NEXT" if "BLENDER_EEVEE_NEXT" in eng else "BLENDER_EEVEE"
|
|
24
|
+
sc.world = bpy.data.worlds.new("w")
|
|
25
|
+
sc.world.use_nodes = True
|
|
26
|
+
bg = sc.world.node_tree.nodes["Background"]
|
|
27
|
+
bg.inputs[0].default_value = (0.78, 0.8, 0.83, 1)
|
|
28
|
+
bg.inputs[1].default_value = 0.9
|
|
29
|
+
sun = bpy.data.objects.new("sun", bpy.data.lights.new("sun", "SUN"))
|
|
30
|
+
sun.data.energy = 3.2
|
|
31
|
+
sun.rotation_euler = (math.radians(40), math.radians(10), math.radians(-35))
|
|
32
|
+
sc.collection.objects.link(sun)
|
|
33
|
+
for m in bpy.data.materials:
|
|
34
|
+
m.use_backface_culling = False
|
|
35
|
+
# the bark: a brown vertical plane at glTF z = 0.05 (Blender y = -0.05), facing the bird
|
|
36
|
+
bpy.ops.mesh.primitive_cube_add(size=1, location=(0, -0.05 - 0.03, 0))
|
|
37
|
+
bark = bpy.context.active_object
|
|
38
|
+
bark.scale = (0.8, 0.06, 0.8)
|
|
39
|
+
bm = bpy.data.materials.new("bark")
|
|
40
|
+
bm.diffuse_color = (0.25, 0.17, 0.11, 1)
|
|
41
|
+
bm.use_nodes = True
|
|
42
|
+
bm.node_tree.nodes["Principled BSDF"].inputs[0].default_value = (0.25, 0.17, 0.11, 1)
|
|
43
|
+
bark.data.materials.append(bm)
|
|
44
|
+
|
|
45
|
+
cam = bpy.data.objects.new("cam", bpy.data.cameras.new("cam"))
|
|
46
|
+
cam.data.type = "ORTHO"
|
|
47
|
+
sc.collection.objects.link(cam)
|
|
48
|
+
sc.camera = cam
|
|
49
|
+
|
|
50
|
+
for name in ("owl_fly", "wood_perch"):
|
|
51
|
+
ob = objs[name]
|
|
52
|
+
for o in objs.values():
|
|
53
|
+
o.hide_render = o is not ob
|
|
54
|
+
bark.hide_render = name != "wood_perch"
|
|
55
|
+
lo = Vector([min((ob.matrix_world @ Vector(c))[i] for c in ob.bound_box) for i in range(3)])
|
|
56
|
+
hi = Vector([max((ob.matrix_world @ Vector(c))[i] for c in ob.bound_box) for i in range(3)])
|
|
57
|
+
c = (lo + hi) / 2
|
|
58
|
+
r = max(hi - lo) * 0.62
|
|
59
|
+
if name == "owl_fly":
|
|
60
|
+
r = 0.42 # the body, not the span
|
|
61
|
+
cam.data.ortho_scale = 2 * r
|
|
62
|
+
views = {
|
|
63
|
+
"side": (Vector((-4 * r, 0, 0)), (math.pi / 2, 0, -math.pi / 2)),
|
|
64
|
+
"front": (Vector((0, -4 * r, 0)), (math.pi / 2, 0, 0)) if name == "owl_fly" else (Vector((0, 4 * r, 0)), (math.pi / 2, 0, math.pi)),
|
|
65
|
+
"q34": (Vector((-2.4 * r, 2.4 * r if name == "wood_perch" else -2.4 * r, 1.2 * r)), None),
|
|
66
|
+
}
|
|
67
|
+
for vn, (off, eu) in views.items():
|
|
68
|
+
cam.location = c + off
|
|
69
|
+
if eu is None:
|
|
70
|
+
d = (c - cam.location).normalized()
|
|
71
|
+
cam.rotation_euler = d.to_track_quat("-Z", "Y").to_euler()
|
|
72
|
+
else:
|
|
73
|
+
cam.rotation_euler = eu
|
|
74
|
+
sc.render.filepath = f"{out}{name}.{vn}.png"
|
|
75
|
+
bpy.ops.render.render(write_still=True)
|