@playdrop/playdrop-cli 0.16.16 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/client-meta.json +4 -4
- package/dist/apiClient.d.ts +1 -2
- package/dist/apiClient.js +1 -16
- package/dist/appUrls.js +4 -0
- package/dist/apps/build.d.ts +12 -4
- package/dist/apps/build.js +55 -22
- package/dist/apps/index.d.ts +2 -1
- package/dist/apps/index.js +4 -1
- package/dist/apps/loadCheck.d.ts +5 -1
- package/dist/apps/loadCheck.js +52 -18
- package/dist/apps/serverBuild.d.ts +17 -0
- package/dist/apps/serverBuild.js +155 -0
- package/dist/apps/staticHtml.d.ts +1 -0
- package/dist/apps/staticHtml.js +19 -10
- package/dist/apps/upload.d.ts +12 -2
- package/dist/apps/upload.js +127 -46
- package/dist/catalogue.d.ts +23 -1
- package/dist/catalogue.js +126 -100
- package/dist/commandContext.d.ts +6 -3
- package/dist/commandContext.js +108 -18
- package/dist/commands/build.js +0 -7
- package/dist/commands/captureListing.d.ts +3 -0
- package/dist/commands/captureListing.js +48 -4
- package/dist/commands/chat.d.ts +4 -0
- package/dist/commands/chat.js +133 -8
- package/dist/commands/check.js +34 -1
- package/dist/commands/create.js +30 -263
- package/dist/commands/dev.js +37 -3
- package/dist/commands/devBrowser.js +2 -2
- package/dist/commands/devGameServer.d.ts +16 -0
- package/dist/commands/devGameServer.js +237 -0
- package/dist/commands/devRuntimeAssets.d.ts +1 -0
- package/dist/commands/devRuntimeAssets.js +2 -0
- package/dist/commands/devServer.d.ts +3 -0
- package/dist/commands/devServer.js +111 -5
- package/dist/commands/generation.d.ts +33 -4
- package/dist/commands/generation.js +304 -115
- package/dist/commands/login.js +23 -7
- package/dist/commands/review.d.ts +1 -1
- package/dist/commands/review.js +68 -95
- package/dist/commands/source.d.ts +19 -0
- package/dist/commands/source.js +142 -0
- package/dist/commands/tweaks.js +5 -11
- package/dist/commands/upload-content.d.ts +1 -1
- package/dist/commands/upload-content.js +16 -12
- package/dist/commands/upload.d.ts +17 -1
- package/dist/commands/upload.js +47 -10
- package/dist/commands/worker/archive-staging.d.ts +1 -0
- package/dist/commands/worker/archive-staging.js +13 -2
- package/dist/commands/worker/e2e-fixtures.d.ts +32 -0
- package/dist/commands/worker/e2e-fixtures.js +466 -0
- package/dist/commands/worker/game-server-infra.d.ts +80 -0
- package/dist/commands/worker/game-server-infra.js +595 -0
- package/dist/commands/worker/game-source-git.d.ts +126 -0
- package/dist/commands/worker/game-source-git.js +780 -0
- package/dist/commands/worker/generation.d.ts +94 -0
- package/dist/commands/worker/generation.js +1458 -0
- package/dist/commands/worker/runtime.d.ts +8 -10
- package/dist/commands/worker/runtime.js +51 -45
- package/dist/commands/worker.d.ts +79 -19
- package/dist/commands/worker.js +1796 -419
- package/dist/config.d.ts +2 -0
- package/dist/config.js +16 -3
- package/dist/environment.d.ts +0 -1
- package/dist/environment.js +0 -8
- package/dist/index.js +92 -13
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +15 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts +72 -25
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +33 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts +1 -0
- package/node_modules/@playdrop/api-client/dist/core/request.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/core/request.js +17 -11
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts +51 -6
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/agent-tasks.js +338 -41
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts +24 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +20 -0
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +13 -8
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +158 -90
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts +4 -0
- package/node_modules/@playdrop/api-client/dist/domains/assets.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +27 -0
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts +35 -3
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.js +89 -7
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts +2 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +9 -0
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts +1 -2
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/playtrade.js +0 -11
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts +29 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/domains/social.js +79 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +80 -29
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +217 -56
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts +18 -0
- package/node_modules/@playdrop/api-client/dist/runtime.d.ts.map +1 -0
- package/node_modules/@playdrop/api-client/dist/runtime.js +54 -0
- package/node_modules/@playdrop/api-client/package.json +7 -0
- package/node_modules/@playdrop/config/client-meta.json +4 -4
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts +11 -0
- package/node_modules/@playdrop/config/dist/src/creator-plans.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/creator-plans.js +13 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/public-deployment.js +0 -8
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +2 -2
- package/node_modules/@playdrop/config/dist/src/server/logging.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/logging.js +31 -2
- package/node_modules/@playdrop/config/dist/test/creator-plans.test.js +10 -0
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +0 -4
- package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +2 -0
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/config/package.json +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts +9 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/archive.js +107 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts +29 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/bundle-storage.js +64 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts +8 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/export.js +25 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts +39 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/git.js +195 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts +6 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/ignore.js +51 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/index.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-core/dist/src/humanoid/r15 → game-source-git/dist/src}/index.js +9 -4
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts +17 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/lock.js +72 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts +10 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/materialize.js +99 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts +24 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/paths.js +207 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts +66 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/src/repository.js +213 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts +2 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.d.ts.map +1 -0
- package/node_modules/@playdrop/game-source-git/dist/test/core.test.js +441 -0
- package/node_modules/@playdrop/game-source-git/dist/tsconfig.tsbuildinfo +1 -0
- package/node_modules/@playdrop/game-source-git/package.json +28 -0
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/agent-task-terminal.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/agent-task-terminal.js +15 -9
- package/node_modules/@playdrop/types/dist/api.d.ts +728 -164
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +60 -11
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +2 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +22 -8
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.js +26 -26
- package/node_modules/@playdrop/types/dist/chat.d.ts +107 -3
- package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.js +33 -4
- package/node_modules/@playdrop/types/dist/index.d.ts +3 -0
- package/node_modules/@playdrop/types/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/index.js +7 -1
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts +11 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/public-cache-tags.js +78 -0
- package/node_modules/@playdrop/types/dist/realtime.d.ts +3 -15
- package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/social.d.ts +64 -0
- package/node_modules/@playdrop/types/dist/social.d.ts.map +1 -0
- package/node_modules/@playdrop/{boxel-three/dist/src/types.js → types/dist/social.js} +14 -2
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts +51 -0
- package/node_modules/@playdrop/types/dist/spritesheet.d.ts.map +1 -0
- package/node_modules/@playdrop/types/dist/spritesheet.js +73 -0
- package/node_modules/@playdrop/types/dist/version.d.ts +86 -58
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/version.js +111 -0
- package/node_modules/@playdrop/types/package.json +14 -0
- package/node_modules/@playdrop/vox-three/dist/src/index.d.ts +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/index.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/src/vox.d.ts +0 -3
- package/node_modules/@playdrop/vox-three/dist/src/vox.js +0 -110
- package/node_modules/@playdrop/vox-three/dist/src/vox.js.map +1 -1
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js +0 -18
- package/node_modules/@playdrop/vox-three/dist/test/vox.test.js.map +1 -1
- package/node_modules/@playdrop/vox-three/package.json +8 -4
- package/package.json +9 -11
- package/dist/assets/model-artifacts.d.ts +0 -8
- package/dist/assets/model-artifacts.js +0 -382
- package/dist/assets/model-worker.d.ts +0 -22
- package/dist/assets/model-worker.js +0 -123
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +0 -441
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +0 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +0 -499
- package/node_modules/@playdrop/ai-client/package.json +0 -22
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.d.ts +0 -13
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js +0 -141
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.d.ts +0 -47
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js +0 -313
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/format-utils.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/geometry.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js +0 -21
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/common.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js +0 -387
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +0 -6
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js +0 -373
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js +0 -215
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js +0 -18
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.d.ts +0 -42
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js +0 -145
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/scanner.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js +0 -65
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/artifacts.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.d.ts +0 -33
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js +0 -175
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/textures/face-map.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r15.json +0 -1517
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/humanoid_r6.json +0 -61
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.d.ts +0 -10
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/index.d.ts +0 -19
- package/node_modules/@playdrop/boxel-core/dist/src/index.js +0 -36
- package/node_modules/@playdrop/boxel-core/dist/src/index.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/materials.d.ts +0 -26
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js +0 -184
- package/node_modules/@playdrop/boxel-core/dist/src/materials.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.d.ts +0 -68
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js +0 -488
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +0 -4
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js +0 -380
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/textures.d.ts +0 -29
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js +0 -208
- package/node_modules/@playdrop/boxel-core/dist/src/textures.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js +0 -312
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts +0 -9
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +0 -154
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js +0 -121
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.d.ts +0 -20
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js +0 -389
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js +0 -206
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js +0 -81
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/slice.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -12
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js +0 -318
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/types.d.ts +0 -168
- package/node_modules/@playdrop/boxel-core/dist/src/types.js +0 -3
- package/node_modules/@playdrop/boxel-core/dist/src/types.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/validation.d.ts +0 -24
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js +0 -620
- package/node_modules/@playdrop/boxel-core/dist/src/validation.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.d.ts +0 -11
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js +0 -135
- package/node_modules/@playdrop/boxel-core/dist/src/voxels/greedy-mesher.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.d.ts +0 -23
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js +0 -52
- package/node_modules/@playdrop/boxel-core/dist/src/voxels.js.map +0 -1
- package/node_modules/@playdrop/boxel-core/package.json +0 -19
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/animations.js +0 -92
- package/node_modules/@playdrop/boxel-three/dist/src/builders.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/builders.js +0 -363
- package/node_modules/@playdrop/boxel-three/dist/src/context.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/context.js +0 -58
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.d.ts +0 -100
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +0 -927
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.d.ts +0 -18
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +0 -294
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +0 -64
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.d.ts +0 -40
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +0 -96
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.d.ts +0 -8
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +0 -7
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +0 -123
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.d.ts +0 -4
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +0 -48
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +0 -3
- package/node_modules/@playdrop/boxel-three/dist/src/scene.js +0 -168
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.d.ts +0 -29
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +0 -623
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.d.ts +0 -13
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +0 -133
- package/node_modules/@playdrop/boxel-three/dist/src/textures.d.ts +0 -17
- package/node_modules/@playdrop/boxel-three/dist/src/textures.js +0 -216
- package/node_modules/@playdrop/boxel-three/dist/src/types.d.ts +0 -112
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.d.ts +0 -28
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +0 -344
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.d.ts +0 -24
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +0 -113
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +0 -137
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.d.ts +0 -20
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +0 -104
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +0 -30
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +0 -88
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +0 -85
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +0 -73
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +0 -136
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.d.ts +0 -1
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +0 -42
- package/node_modules/@playdrop/boxel-three/package.json +0 -28
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "template_humanoid_r6",
|
|
3
|
-
"geometry": {
|
|
4
|
-
"id": "humanoid_r6",
|
|
5
|
-
"root": {
|
|
6
|
-
"id": "root",
|
|
7
|
-
"position": [0, 0, 0],
|
|
8
|
-
"scale": [0.0625, 0.0625, 0.0625],
|
|
9
|
-
"children": [
|
|
10
|
-
{
|
|
11
|
-
"id": "torso",
|
|
12
|
-
"position": [0, 12, 0],
|
|
13
|
-
"center": [0, 6, 0],
|
|
14
|
-
"size": [8, 12, 4],
|
|
15
|
-
"children": [
|
|
16
|
-
{
|
|
17
|
-
"id": "head",
|
|
18
|
-
"position": [0, 12, 0],
|
|
19
|
-
"center": [0, 4, 0],
|
|
20
|
-
"size": [8, 8, 8],
|
|
21
|
-
"children": []
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "arm_right",
|
|
25
|
-
"position": [-6, 10, 0],
|
|
26
|
-
"center": [-4, 0, 0],
|
|
27
|
-
"size": [12, 4, 4],
|
|
28
|
-
"children": []
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"id": "arm_left",
|
|
32
|
-
"position": [6, 10, 0],
|
|
33
|
-
"center": [4, 0, 0],
|
|
34
|
-
"size": [12, 4, 4],
|
|
35
|
-
"children": []
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "leg_right",
|
|
39
|
-
"position": [-2, 0, 0],
|
|
40
|
-
"center": [0, -6, 0],
|
|
41
|
-
"size": [4, 12, 4],
|
|
42
|
-
"children": []
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"id": "leg_left",
|
|
46
|
-
"position": [2, 0, 0],
|
|
47
|
-
"center": [0, -6, 0],
|
|
48
|
-
"size": [4, 12, 4],
|
|
49
|
-
"children": []
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"patterns": [],
|
|
57
|
-
"materials": [],
|
|
58
|
-
"textures": [],
|
|
59
|
-
"primitives": [],
|
|
60
|
-
"animations": []
|
|
61
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BoxelDefinition } from "../../types";
|
|
2
|
-
declare const TEMPLATE_REGISTRY: {
|
|
3
|
-
readonly humanoid_r6: BoxelDefinition;
|
|
4
|
-
readonly humanoid_r15: BoxelDefinition;
|
|
5
|
-
};
|
|
6
|
-
export type HumanoidTemplateId = keyof typeof TEMPLATE_REGISTRY;
|
|
7
|
-
export declare const getHumanoidTemplate: (id: HumanoidTemplateId) => BoxelDefinition;
|
|
8
|
-
export declare const HUMANOID_R6_TEMPLATE_ID: HumanoidTemplateId;
|
|
9
|
-
export declare const HUMANOID_R15_TEMPLATE_ID: HumanoidTemplateId;
|
|
10
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HUMANOID_R15_TEMPLATE_ID = exports.HUMANOID_R6_TEMPLATE_ID = exports.getHumanoidTemplate = void 0;
|
|
7
|
-
const humanoid_r6_json_1 = __importDefault(require("./humanoid_r6.json"));
|
|
8
|
-
const humanoid_r15_json_1 = __importDefault(require("./humanoid_r15.json"));
|
|
9
|
-
const TEMPLATE_REGISTRY = {
|
|
10
|
-
humanoid_r6: humanoid_r6_json_1.default,
|
|
11
|
-
humanoid_r15: humanoid_r15_json_1.default,
|
|
12
|
-
};
|
|
13
|
-
const getHumanoidTemplate = (id) => {
|
|
14
|
-
const template = TEMPLATE_REGISTRY[id];
|
|
15
|
-
if (!template) {
|
|
16
|
-
throw new Error(`Unknown humanoid template: ${id}`);
|
|
17
|
-
}
|
|
18
|
-
return JSON.parse(JSON.stringify(template));
|
|
19
|
-
};
|
|
20
|
-
exports.getHumanoidTemplate = getHumanoidTemplate;
|
|
21
|
-
exports.HUMANOID_R6_TEMPLATE_ID = "humanoid_r6";
|
|
22
|
-
exports.HUMANOID_R15_TEMPLATE_ID = "humanoid_r15";
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/humanoid/templates/index.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAoD;AACpD,4EAAsD;AAGtD,MAAM,iBAAiB,GAAG;IACxB,WAAW,EAAE,0BAAgD;IAC7D,YAAY,EAAE,2BAAiD;CACvD,CAAC;AAIJ,MAAM,mBAAmB,GAAG,CAAC,EAAsB,EAAmB,EAAE;IAC7E,MAAM,QAAQ,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAoB,CAAC;AACjE,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEW,QAAA,uBAAuB,GAAuB,aAAa,CAAC;AAC5D,QAAA,wBAAwB,GAAuB,cAAc,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from "./types";
|
|
2
|
-
export * from "./format-utils";
|
|
3
|
-
export * from "./serialization";
|
|
4
|
-
export * from "./validation";
|
|
5
|
-
export * from "./voxels";
|
|
6
|
-
export * from "./textures";
|
|
7
|
-
export * from "./materials";
|
|
8
|
-
export * from "./entity-utils";
|
|
9
|
-
export * from "./entity-cleaner";
|
|
10
|
-
export * from "./transforms/upscale";
|
|
11
|
-
export * from "./transforms/textured-boxes/infer-face";
|
|
12
|
-
export * from "./transforms/textured-boxes/merge-overlay";
|
|
13
|
-
export * from "./transforms/textured-boxes/layer-mode";
|
|
14
|
-
export * from "./transforms/textured-boxes/slice";
|
|
15
|
-
export * from "./transforms/voxels/textured-to-voxel";
|
|
16
|
-
export * from "./transforms/voxels/slice";
|
|
17
|
-
export * from "./voxels/greedy-mesher";
|
|
18
|
-
export * from "./humanoid";
|
|
19
|
-
export * from "./palette_tools";
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
|
-
__exportStar(require("./format-utils"), exports);
|
|
19
|
-
__exportStar(require("./serialization"), exports);
|
|
20
|
-
__exportStar(require("./validation"), exports);
|
|
21
|
-
__exportStar(require("./voxels"), exports);
|
|
22
|
-
__exportStar(require("./textures"), exports);
|
|
23
|
-
__exportStar(require("./materials"), exports);
|
|
24
|
-
__exportStar(require("./entity-utils"), exports);
|
|
25
|
-
__exportStar(require("./entity-cleaner"), exports);
|
|
26
|
-
__exportStar(require("./transforms/upscale"), exports);
|
|
27
|
-
__exportStar(require("./transforms/textured-boxes/infer-face"), exports);
|
|
28
|
-
__exportStar(require("./transforms/textured-boxes/merge-overlay"), exports);
|
|
29
|
-
__exportStar(require("./transforms/textured-boxes/layer-mode"), exports);
|
|
30
|
-
__exportStar(require("./transforms/textured-boxes/slice"), exports);
|
|
31
|
-
__exportStar(require("./transforms/voxels/textured-to-voxel"), exports);
|
|
32
|
-
__exportStar(require("./transforms/voxels/slice"), exports);
|
|
33
|
-
__exportStar(require("./voxels/greedy-mesher"), exports);
|
|
34
|
-
__exportStar(require("./humanoid"), exports);
|
|
35
|
-
__exportStar(require("./palette_tools"), exports);
|
|
36
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,iDAA+B;AAC/B,kDAAgC;AAChC,+CAA6B;AAC7B,2CAAyB;AACzB,6CAA2B;AAC3B,8CAA4B;AAC5B,iDAA+B;AAC/B,mDAAiC;AACjC,uDAAqC;AACrC,yEAAuD;AACvD,4EAA0D;AAC1D,yEAAuD;AACvD,oEAAkD;AAClD,wEAAsD;AACtD,4DAA0C;AAE1C,yDAAuC;AACvC,6CAA2B;AAC3B,kDAAgC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Material } from "./types";
|
|
2
|
-
export declare function materialsApproximatelyEqual(a: Material, b: Material): boolean;
|
|
3
|
-
export declare function materialFingerprint(material: Material): string;
|
|
4
|
-
export interface MaterialMergeResult {
|
|
5
|
-
additions: Material[];
|
|
6
|
-
rewrites: Map<string, string>;
|
|
7
|
-
}
|
|
8
|
-
export declare function mergeMaterials(existingMaterials: readonly Material[], incomingMaterials: readonly Material[]): MaterialMergeResult;
|
|
9
|
-
interface PaletteCarrier {
|
|
10
|
-
palette?: ReadonlyArray<string> | null;
|
|
11
|
-
}
|
|
12
|
-
export declare function collectPaletteIds(primitives: Iterable<PaletteCarrier>): Set<string>;
|
|
13
|
-
export declare function cloneMaterialsByPalette(materials: readonly Material[], paletteIds: Set<string>): Material[];
|
|
14
|
-
export interface MaterialEnsurerOptions {
|
|
15
|
-
prefix?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface MaterialEnsurer {
|
|
18
|
-
ensure(color: {
|
|
19
|
-
r: number;
|
|
20
|
-
g: number;
|
|
21
|
-
b: number;
|
|
22
|
-
a: number;
|
|
23
|
-
}): string;
|
|
24
|
-
}
|
|
25
|
-
export declare function createMaterialEnsurer(materials: Material[], options?: MaterialEnsurerOptions): MaterialEnsurer;
|
|
26
|
-
export {};
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.materialsApproximatelyEqual = materialsApproximatelyEqual;
|
|
4
|
-
exports.materialFingerprint = materialFingerprint;
|
|
5
|
-
exports.mergeMaterials = mergeMaterials;
|
|
6
|
-
exports.collectPaletteIds = collectPaletteIds;
|
|
7
|
-
exports.cloneMaterialsByPalette = cloneMaterialsByPalette;
|
|
8
|
-
exports.createMaterialEnsurer = createMaterialEnsurer;
|
|
9
|
-
const COLOR_COMPONENT_EPSILON = 1e-3;
|
|
10
|
-
const OPACITY_EPSILON = 1e-4;
|
|
11
|
-
const normalizeVec3 = (input) => {
|
|
12
|
-
if (!Array.isArray(input) || input.length !== 3) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
return [Number(input[0]) || 0, Number(input[1]) || 0, Number(input[2]) || 0];
|
|
16
|
-
};
|
|
17
|
-
const componentsEqual = (a, b, epsilon) => Math.abs(a - b) <= epsilon;
|
|
18
|
-
const vecsEqual = (a, b, epsilon) => {
|
|
19
|
-
if (!a || !b)
|
|
20
|
-
return !a && !b;
|
|
21
|
-
for (let i = 0; i < 3; i += 1) {
|
|
22
|
-
if (!componentsEqual(a[i], b[i], epsilon)) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return true;
|
|
27
|
-
};
|
|
28
|
-
const normalizeOpacity = (value) => {
|
|
29
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
return value;
|
|
33
|
-
};
|
|
34
|
-
function materialsApproximatelyEqual(a, b) {
|
|
35
|
-
const baseA = normalizeVec3(a.baseColor);
|
|
36
|
-
const baseB = normalizeVec3(b.baseColor);
|
|
37
|
-
if (!vecsEqual(baseA, baseB, COLOR_COMPONENT_EPSILON)) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
const emissiveA = normalizeVec3(a.emissiveColor);
|
|
41
|
-
const emissiveB = normalizeVec3(b.emissiveColor);
|
|
42
|
-
if (!vecsEqual(emissiveA, emissiveB, COLOR_COMPONENT_EPSILON)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
const opacityA = normalizeOpacity(a.opacity);
|
|
46
|
-
const opacityB = normalizeOpacity(b.opacity);
|
|
47
|
-
if (opacityA === null && opacityB === null) {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
if (opacityA === null || opacityB === null) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return componentsEqual(opacityA, opacityB, OPACITY_EPSILON);
|
|
54
|
-
}
|
|
55
|
-
function materialFingerprint(material) {
|
|
56
|
-
const base = normalizeVec3(material.baseColor) ?? [0, 0, 0];
|
|
57
|
-
const emissive = normalizeVec3(material.emissiveColor);
|
|
58
|
-
const opacity = normalizeOpacity(material.opacity);
|
|
59
|
-
const formatScalar = (value) => value.toFixed(4);
|
|
60
|
-
const formatVec = (vec) => (vec ? vec.map((component) => component.toFixed(4)).join(",") : "null");
|
|
61
|
-
return [formatVec(base), formatVec(emissive), opacity === null ? "null" : formatScalar(opacity)].join("|");
|
|
62
|
-
}
|
|
63
|
-
function mergeMaterials(existingMaterials, incomingMaterials) {
|
|
64
|
-
const additions = [];
|
|
65
|
-
const rewrites = new Map();
|
|
66
|
-
const existingByFingerprint = new Map();
|
|
67
|
-
existingMaterials.forEach((material) => {
|
|
68
|
-
existingByFingerprint.set(materialFingerprint(material), material.id);
|
|
69
|
-
});
|
|
70
|
-
incomingMaterials.forEach((material) => {
|
|
71
|
-
const fingerprint = materialFingerprint(material);
|
|
72
|
-
const existingId = existingByFingerprint.get(fingerprint);
|
|
73
|
-
if (existingId) {
|
|
74
|
-
rewrites.set(material.id, existingId);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const duplicate = existingMaterials.find((candidate) => materialsApproximatelyEqual(candidate, material));
|
|
78
|
-
if (duplicate) {
|
|
79
|
-
rewrites.set(material.id, duplicate.id);
|
|
80
|
-
existingByFingerprint.set(fingerprint, duplicate.id);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
additions.push(material);
|
|
84
|
-
existingByFingerprint.set(fingerprint, material.id);
|
|
85
|
-
});
|
|
86
|
-
return { additions, rewrites };
|
|
87
|
-
}
|
|
88
|
-
function collectPaletteIds(primitives) {
|
|
89
|
-
const paletteIds = new Set();
|
|
90
|
-
for (const primitive of primitives) {
|
|
91
|
-
const palette = primitive.palette;
|
|
92
|
-
if (!Array.isArray(palette)) {
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
for (const materialId of palette) {
|
|
96
|
-
if (typeof materialId === "string" && materialId.length > 0) {
|
|
97
|
-
paletteIds.add(materialId);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return paletteIds;
|
|
102
|
-
}
|
|
103
|
-
function cloneMaterialsByPalette(materials, paletteIds) {
|
|
104
|
-
return materials
|
|
105
|
-
.filter((material) => paletteIds.has(material.id))
|
|
106
|
-
.map((material) => JSON.parse(JSON.stringify(material)));
|
|
107
|
-
}
|
|
108
|
-
const clampChannel = (value) => {
|
|
109
|
-
const numeric = Number(value);
|
|
110
|
-
if (!Number.isFinite(numeric)) {
|
|
111
|
-
return 0;
|
|
112
|
-
}
|
|
113
|
-
return Math.max(0, Math.min(255, Math.round(numeric)));
|
|
114
|
-
};
|
|
115
|
-
const clampOpacity = (value) => {
|
|
116
|
-
const numeric = Number(value);
|
|
117
|
-
if (!Number.isFinite(numeric)) {
|
|
118
|
-
return 1;
|
|
119
|
-
}
|
|
120
|
-
return Math.max(0, Math.min(1, numeric));
|
|
121
|
-
};
|
|
122
|
-
const opacityToAlpha = (opacity) => {
|
|
123
|
-
if (opacity === undefined) {
|
|
124
|
-
return 255;
|
|
125
|
-
}
|
|
126
|
-
return clampChannel(Math.round(clampOpacity(opacity) * 255));
|
|
127
|
-
};
|
|
128
|
-
const toMaterialKey = (channels) => {
|
|
129
|
-
const r = clampChannel(channels.r);
|
|
130
|
-
const g = clampChannel(channels.g);
|
|
131
|
-
const b = clampChannel(channels.b);
|
|
132
|
-
const a = clampChannel(channels.a);
|
|
133
|
-
return `${r},${g},${b},${a}`;
|
|
134
|
-
};
|
|
135
|
-
function createMaterialEnsurer(materials, options = {}) {
|
|
136
|
-
const materialIdByColor = new Map();
|
|
137
|
-
const prefix = options.prefix ?? "humanoid_mat";
|
|
138
|
-
const seedExistingMaterials = () => {
|
|
139
|
-
materials.forEach((material) => {
|
|
140
|
-
if (!Array.isArray(material.baseColor) || material.baseColor.length !== 3) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const baseColor = {
|
|
144
|
-
r: clampChannel(material.baseColor[0]),
|
|
145
|
-
g: clampChannel(material.baseColor[1]),
|
|
146
|
-
b: clampChannel(material.baseColor[2]),
|
|
147
|
-
};
|
|
148
|
-
const alpha = opacityToAlpha(material.opacity);
|
|
149
|
-
const key = toMaterialKey({ ...baseColor, a: alpha });
|
|
150
|
-
if (!materialIdByColor.has(key)) {
|
|
151
|
-
materialIdByColor.set(key, material.id);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
seedExistingMaterials();
|
|
156
|
-
return {
|
|
157
|
-
ensure(color) {
|
|
158
|
-
const sanitized = {
|
|
159
|
-
r: clampChannel(color.r),
|
|
160
|
-
g: clampChannel(color.g),
|
|
161
|
-
b: clampChannel(color.b),
|
|
162
|
-
a: clampChannel(color.a),
|
|
163
|
-
};
|
|
164
|
-
const key = toMaterialKey(sanitized);
|
|
165
|
-
const existing = materialIdByColor.get(key);
|
|
166
|
-
if (existing) {
|
|
167
|
-
return existing;
|
|
168
|
-
}
|
|
169
|
-
const suffix = materials.length + 1;
|
|
170
|
-
const id = `${prefix}_${suffix}`;
|
|
171
|
-
const material = {
|
|
172
|
-
id,
|
|
173
|
-
baseColor: [sanitized.r, sanitized.g, sanitized.b],
|
|
174
|
-
};
|
|
175
|
-
if (sanitized.a < 255) {
|
|
176
|
-
material.opacity = parseFloat((sanitized.a / 255).toFixed(4));
|
|
177
|
-
}
|
|
178
|
-
materials.push(material);
|
|
179
|
-
materialIdByColor.set(key, id);
|
|
180
|
-
return id;
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
//# sourceMappingURL=materials.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"materials.js","sourceRoot":"","sources":["../../src/materials.ts"],"names":[],"mappings":";;AA+BA,kEAsBC;AAED,kDASC;AAOD,wCAgCC;AAMD,8CAcC;AAED,0DAIC;AAyCD,sDAqDC;AA7ND,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,MAAM,aAAa,GAAG,CAAC,KAA8B,EAAe,EAAE;IACpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,OAAe,EAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,CAAC;AAEvG,MAAM,SAAS,GAAG,CAAC,CAAc,EAAE,CAAc,EAAE,OAAe,EAAW,EAAE;IAC7E,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,K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,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAa;gBACzB,EAAE;gBACF,SAAS,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;aACnD,CAAC;YACF,IAAI,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC;gBACtB,QAAQ,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YAChE,CAAC;YAED,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzB,iBAAiB,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YAC/B,OAAO,EAAE,CAAC;QACZ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { BoxelDefinition, Vec3 } from "./types";
|
|
2
|
-
export declare const DEFAULT_SATURATION_FACTOR = 2;
|
|
3
|
-
export interface MaterialSample {
|
|
4
|
-
materialId: string;
|
|
5
|
-
baseColor: Vec3;
|
|
6
|
-
opacity?: number | undefined;
|
|
7
|
-
usageCount: number;
|
|
8
|
-
}
|
|
9
|
-
export interface LuminanceOptions {
|
|
10
|
-
min: number;
|
|
11
|
-
max: number;
|
|
12
|
-
kneeLow?: number;
|
|
13
|
-
kneeHigh?: number;
|
|
14
|
-
}
|
|
15
|
-
export interface SaturationResult {
|
|
16
|
-
color: Vec3;
|
|
17
|
-
luminance: number;
|
|
18
|
-
clipped: boolean;
|
|
19
|
-
}
|
|
20
|
-
export interface LuminanceResult {
|
|
21
|
-
color: Vec3;
|
|
22
|
-
luminance: number;
|
|
23
|
-
}
|
|
24
|
-
export interface MaterialCluster {
|
|
25
|
-
id: string;
|
|
26
|
-
centerRgb: Vec3;
|
|
27
|
-
centerLab: [number, number, number];
|
|
28
|
-
totalCount: number;
|
|
29
|
-
samples: MaterialSample[];
|
|
30
|
-
}
|
|
31
|
-
export declare function collectMaterialUsage(entity: BoxelDefinition): MaterialSample[];
|
|
32
|
-
export declare function rebalanceLuminance(color: Vec3, options: LuminanceOptions): LuminanceResult;
|
|
33
|
-
export declare function applySaturation(color: Vec3, options: {
|
|
34
|
-
scale: number;
|
|
35
|
-
luminance?: number;
|
|
36
|
-
}): SaturationResult;
|
|
37
|
-
export declare function mapLuminance(samples: MaterialSample[], options: LuminanceOptions): Array<MaterialSample & {
|
|
38
|
-
color: Vec3;
|
|
39
|
-
luminance: number;
|
|
40
|
-
}>;
|
|
41
|
-
export declare function mapSaturation(entries: Array<{
|
|
42
|
-
color: Vec3;
|
|
43
|
-
luminance: number;
|
|
44
|
-
}>, options: {
|
|
45
|
-
scale: number;
|
|
46
|
-
}): Array<SaturationResult>;
|
|
47
|
-
export declare function rewriteEntityPalette(entity: BoxelDefinition, colors: Map<string, Vec3>): BoxelDefinition;
|
|
48
|
-
export declare function clusterMaterials(samples: MaterialSample[], options?: {
|
|
49
|
-
deltaE?: number;
|
|
50
|
-
}): MaterialCluster[];
|
|
51
|
-
export interface AnalyzePaletteOptions {
|
|
52
|
-
luminance?: Partial<LuminanceOptions>;
|
|
53
|
-
saturationScale?: number;
|
|
54
|
-
}
|
|
55
|
-
export interface AnalyzedMaterial {
|
|
56
|
-
materialId: string;
|
|
57
|
-
baseColor: Vec3;
|
|
58
|
-
opacity?: number | undefined;
|
|
59
|
-
count: number;
|
|
60
|
-
luminance: number;
|
|
61
|
-
balancedColor: Vec3;
|
|
62
|
-
balancedLuminance: number;
|
|
63
|
-
saturatedColor: Vec3;
|
|
64
|
-
saturatedLuminance: number;
|
|
65
|
-
saturationClipped: boolean;
|
|
66
|
-
}
|
|
67
|
-
export declare function analyzePalette(entity: BoxelDefinition, options?: AnalyzePaletteOptions): AnalyzedMaterial[];
|
|
68
|
-
export declare const analyzeEntityMaterials: typeof analyzePalette;
|