@playdrop/playdrop-cli 0.16.12 → 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 -7
- package/dist/commands/chat.js +165 -77
- 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/provider-telemetry.js +1 -1
- package/dist/commands/worker/runtime.d.ts +8 -10
- package/dist/commands/worker/runtime.js +53 -48
- 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 -22
- package/dist/workerAppProject.d.ts +1 -1
- package/dist/workerAppProject.js +15 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts +143 -39
- 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 +152 -21
- package/node_modules/@playdrop/api-client/dist/domains/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/chat.js +477 -100
- 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 +81 -30
- 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 +730 -166
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +65 -18
- 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 +273 -31
- package/node_modules/@playdrop/types/dist/chat.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/chat.js +38 -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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textures.js","sourceRoot":"","sources":["../../src/textures.ts"],"names":[],"mappings":";;;AAgDA,0CAWC;AAwBD,oDASC;AAED,kEASC;AAED,sDASC;AAED,oEASC;AAED,kCAEC;AAED,sDAEC;AAED,gEAKC;AAED,kEASC;AAED,gEASC;AAUD,wEAqBC;AAQD,wEAgBC;AAED,gEAEC;AAED,kEAEC;AAED,gEAEC;AAxND,MAAM,cAAc,GAA8C;IAChE,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;IAC5B,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uB;IAChE,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAU,CAAC,CAAC,CAAC;AACnF,CAAC"}
|
package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BoxelDefinition, TexturedBox } from "../../types";
|
|
2
|
-
export interface BuildFaceOptions {
|
|
3
|
-
entity: BoxelDefinition;
|
|
4
|
-
primitive: TexturedBox;
|
|
5
|
-
face: FaceName;
|
|
6
|
-
prefix?: string;
|
|
7
|
-
}
|
|
8
|
-
export type FaceName = "north" | "south" | "east" | "west" | "top" | "bottom";
|
|
9
|
-
export declare function buildFaceFromNeighbors(options: BuildFaceOptions): string | undefined;
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildFaceFromNeighbors = buildFaceFromNeighbors;
|
|
4
|
-
const textures_1 = require("../../textures");
|
|
5
|
-
const EDGE_SOURCES = {
|
|
6
|
-
east: {
|
|
7
|
-
left: { kind: "column", face: "north", index: "last" },
|
|
8
|
-
right: { kind: "column", face: "south", index: "first", reverse: true },
|
|
9
|
-
top: { kind: "column", face: "top", index: "last" },
|
|
10
|
-
bottom: { kind: "column", face: "bottom", index: "first", reverse: true },
|
|
11
|
-
},
|
|
12
|
-
west: {
|
|
13
|
-
left: { kind: "column", face: "south", index: "last" },
|
|
14
|
-
right: { kind: "column", face: "north", index: "first", reverse: true },
|
|
15
|
-
top: { kind: "column", face: "top", index: "first", reverse: true },
|
|
16
|
-
bottom: { kind: "column", face: "bottom", index: "last" },
|
|
17
|
-
},
|
|
18
|
-
north: {
|
|
19
|
-
left: { kind: "column", face: "west", index: "last" },
|
|
20
|
-
right: { kind: "column", face: "east", index: "first" },
|
|
21
|
-
top: { kind: "row", face: "top", index: "first" },
|
|
22
|
-
bottom: { kind: "row", face: "bottom", index: "last", reverse: true },
|
|
23
|
-
},
|
|
24
|
-
south: {
|
|
25
|
-
left: { kind: "column", face: "east", index: "last" },
|
|
26
|
-
right: { kind: "column", face: "west", index: "first" },
|
|
27
|
-
top: { kind: "row", face: "top", index: "last" },
|
|
28
|
-
bottom: { kind: "row", face: "bottom", index: "first", reverse: true },
|
|
29
|
-
},
|
|
30
|
-
top: {
|
|
31
|
-
left: { kind: "row", face: "west", index: "first", reverse: true },
|
|
32
|
-
right: { kind: "row", face: "east", index: "first" },
|
|
33
|
-
top: { kind: "row", face: "north", index: "first", reverse: true },
|
|
34
|
-
bottom: { kind: "row", face: "south", index: "last" },
|
|
35
|
-
},
|
|
36
|
-
bottom: {
|
|
37
|
-
left: { kind: "row", face: "west", index: "last", reverse: true },
|
|
38
|
-
right: { kind: "row", face: "east", index: "last" },
|
|
39
|
-
top: { kind: "row", face: "south", index: "first" },
|
|
40
|
-
bottom: { kind: "row", face: "north", index: "last", reverse: true },
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
const toNumber = (value) => {
|
|
44
|
-
const num = Number(value);
|
|
45
|
-
return Number.isFinite(num) ? num : 0;
|
|
46
|
-
};
|
|
47
|
-
const toDimension = (value) => Math.max(1, Math.round(toNumber(value)));
|
|
48
|
-
const getSeamDimensions = (size, face) => {
|
|
49
|
-
const sx = toDimension(size[0]);
|
|
50
|
-
const sy = toDimension(size[1]);
|
|
51
|
-
const sz = toDimension(size[2]);
|
|
52
|
-
switch (face) {
|
|
53
|
-
case "top":
|
|
54
|
-
case "bottom":
|
|
55
|
-
return [sx, sz];
|
|
56
|
-
case "east":
|
|
57
|
-
case "west":
|
|
58
|
-
return [sz, sy];
|
|
59
|
-
case "north":
|
|
60
|
-
case "south":
|
|
61
|
-
default:
|
|
62
|
-
return [sx, sy];
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const getFaceGrid = (entity, primitive, face) => {
|
|
66
|
-
const textureId = (0, textures_1.resolveFaceTextureId)(primitive, face);
|
|
67
|
-
if (!textureId) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
const texture = entity.textures.find((entry) => entry.id === textureId);
|
|
71
|
-
if (!texture) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
const pattern = entity.patterns.find((entry) => entry.id === texture.pattern);
|
|
75
|
-
if (!pattern) {
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
const width = toDimension(pattern.size?.[0]);
|
|
79
|
-
const height = toDimension(pattern.size?.[1]);
|
|
80
|
-
const grid = [];
|
|
81
|
-
for (let y = 0; y < height; y += 1) {
|
|
82
|
-
const row = [];
|
|
83
|
-
for (let x = 0; x < width; x += 1) {
|
|
84
|
-
const index = pattern.data?.[y * width + x];
|
|
85
|
-
row.push(index !== undefined ? texture.materials[index] : undefined);
|
|
86
|
-
}
|
|
87
|
-
grid.push(row);
|
|
88
|
-
}
|
|
89
|
-
return { width, height, grid };
|
|
90
|
-
};
|
|
91
|
-
const extractColumn = (grid, index, reverse) => {
|
|
92
|
-
if (!grid || index < 0 || index >= grid.width) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
const column = [];
|
|
96
|
-
for (let y = 0; y < grid.height; y += 1) {
|
|
97
|
-
column.push(grid.grid[y][index]);
|
|
98
|
-
}
|
|
99
|
-
return reverse ? column.reverse() : column;
|
|
100
|
-
};
|
|
101
|
-
const extractRow = (grid, index, reverse) => {
|
|
102
|
-
if (!grid || index < 0 || index >= grid.height) {
|
|
103
|
-
return undefined;
|
|
104
|
-
}
|
|
105
|
-
const row = [...grid.grid[index]];
|
|
106
|
-
return reverse ? row.reverse() : row;
|
|
107
|
-
};
|
|
108
|
-
const enqueueSeed = (grid, x, y, value, queue) => {
|
|
109
|
-
if (value === undefined) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (grid[y][x] !== undefined) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
grid[y][x] = value;
|
|
116
|
-
queue.push({ x, y });
|
|
117
|
-
};
|
|
118
|
-
const propagate = (grid) => {
|
|
119
|
-
const height = grid.length;
|
|
120
|
-
const width = grid[0]?.length ?? 0;
|
|
121
|
-
const queue = [];
|
|
122
|
-
for (let y = 0; y < height; y += 1) {
|
|
123
|
-
for (let x = 0; x < width; x += 1) {
|
|
124
|
-
if (grid[y][x] !== undefined) {
|
|
125
|
-
queue.push({ x, y });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
const directions = [
|
|
130
|
-
[1, 0],
|
|
131
|
-
[-1, 0],
|
|
132
|
-
[0, 1],
|
|
133
|
-
[0, -1],
|
|
134
|
-
];
|
|
135
|
-
while (queue.length > 0) {
|
|
136
|
-
const { x, y } = queue.shift();
|
|
137
|
-
const value = grid[y][x];
|
|
138
|
-
if (value === undefined) {
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
for (const [dx, dy] of directions) {
|
|
142
|
-
const nx = x + dx;
|
|
143
|
-
const ny = y + dy;
|
|
144
|
-
if (nx < 0 || ny < 0 || nx >= width || ny >= height) {
|
|
145
|
-
continue;
|
|
146
|
-
}
|
|
147
|
-
if (grid[ny][nx] !== undefined) {
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
grid[ny][nx] = value;
|
|
151
|
-
queue.push({ x: nx, y: ny });
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
const createPatternAndTexture = (entity, grid, prefix) => {
|
|
156
|
-
const height = grid.length;
|
|
157
|
-
const width = grid[0]?.length ?? 0;
|
|
158
|
-
const materialIds = new Map();
|
|
159
|
-
const materials = [];
|
|
160
|
-
const data = [];
|
|
161
|
-
for (let y = 0; y < height; y += 1) {
|
|
162
|
-
for (let x = 0; x < width; x += 1) {
|
|
163
|
-
const material = grid[y][x];
|
|
164
|
-
if (material === undefined) {
|
|
165
|
-
return undefined;
|
|
166
|
-
}
|
|
167
|
-
let index = materialIds.get(material);
|
|
168
|
-
if (index === undefined) {
|
|
169
|
-
index = materials.length;
|
|
170
|
-
materials.push(material);
|
|
171
|
-
materialIds.set(material, index);
|
|
172
|
-
}
|
|
173
|
-
data.push(index);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
if (materials.length === 0) {
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
const patternId = `${prefix}_pattern_${entity.patterns.length + 1}`;
|
|
180
|
-
const textureId = `${prefix}_texture_${entity.textures.length + 1}`;
|
|
181
|
-
entity.patterns.push({
|
|
182
|
-
id: patternId,
|
|
183
|
-
size: [width, height],
|
|
184
|
-
data,
|
|
185
|
-
});
|
|
186
|
-
entity.textures.push({
|
|
187
|
-
id: textureId,
|
|
188
|
-
pattern: patternId,
|
|
189
|
-
materials,
|
|
190
|
-
});
|
|
191
|
-
return textureId;
|
|
192
|
-
};
|
|
193
|
-
function buildFaceFromNeighbors(options) {
|
|
194
|
-
const { entity, primitive, face, prefix } = options;
|
|
195
|
-
const [width, height] = getSeamDimensions([toDimension(primitive.size?.[0]), toDimension(primitive.size?.[1]), toDimension(primitive.size?.[2])], face);
|
|
196
|
-
const materialLookup = new Map(entity.materials.map((material) => [material.id, material]));
|
|
197
|
-
const getMaterialOpacity = (materialId) => {
|
|
198
|
-
if (!materialId) {
|
|
199
|
-
return 0;
|
|
200
|
-
}
|
|
201
|
-
const material = materialLookup.get(materialId);
|
|
202
|
-
if (!material) {
|
|
203
|
-
return 1;
|
|
204
|
-
}
|
|
205
|
-
return material.opacity !== undefined ? Number(material.opacity) : 1;
|
|
206
|
-
};
|
|
207
|
-
const grids = new Map();
|
|
208
|
-
["north", "south", "east", "west", "top", "bottom"].forEach((faceName) => {
|
|
209
|
-
const grid = getFaceGrid(entity, primitive, faceName);
|
|
210
|
-
if (grid) {
|
|
211
|
-
grids.set(faceName, grid);
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
const mapping = EDGE_SOURCES[face];
|
|
215
|
-
const seamGrid = new Array(height)
|
|
216
|
-
.fill(null)
|
|
217
|
-
.map(() => new Array(width).fill(undefined));
|
|
218
|
-
const queue = [];
|
|
219
|
-
let seeded = false;
|
|
220
|
-
let hasTransparentEdge = false;
|
|
221
|
-
const seedColumn = (targetColumn, selector) => {
|
|
222
|
-
if (selector.kind !== "column") {
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const source = grids.get(selector.face);
|
|
226
|
-
const index = selector.index === "first" ? 0 : (source?.width ?? 1) - 1;
|
|
227
|
-
const column = extractColumn(source, index, selector.reverse ?? false);
|
|
228
|
-
if (!column) {
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
for (let y = 0; y < Math.min(height, column.length); y += 1) {
|
|
232
|
-
const value = column[y];
|
|
233
|
-
if (value === undefined || getMaterialOpacity(value) === 0) {
|
|
234
|
-
hasTransparentEdge = true;
|
|
235
|
-
continue;
|
|
236
|
-
}
|
|
237
|
-
enqueueSeed(seamGrid, targetColumn, y, value, queue);
|
|
238
|
-
seeded = true;
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
const seedRow = (targetRow, selector) => {
|
|
242
|
-
if (selector.kind !== "row") {
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const source = grids.get(selector.face);
|
|
246
|
-
const index = selector.index === "first" ? 0 : (source?.height ?? 1) - 1;
|
|
247
|
-
const row = extractRow(source, index, selector.reverse ?? false);
|
|
248
|
-
if (!row) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
for (let x = 0; x < Math.min(width, row.length); x += 1) {
|
|
252
|
-
const value = row[x];
|
|
253
|
-
if (value === undefined || getMaterialOpacity(value) === 0) {
|
|
254
|
-
hasTransparentEdge = true;
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
enqueueSeed(seamGrid, x, targetRow, value, queue);
|
|
258
|
-
seeded = true;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
seedColumn(0, mapping.left);
|
|
262
|
-
seedColumn(width - 1, mapping.right);
|
|
263
|
-
seedRow(0, mapping.top);
|
|
264
|
-
seedRow(height - 1, mapping.bottom);
|
|
265
|
-
let transparentMaterialId = (() => {
|
|
266
|
-
for (const material of entity.materials) {
|
|
267
|
-
if ((material.opacity ?? 1) === 0) {
|
|
268
|
-
return material.id;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
return undefined;
|
|
272
|
-
})();
|
|
273
|
-
const ensureTransparentMaterial = () => {
|
|
274
|
-
if (transparentMaterialId) {
|
|
275
|
-
return transparentMaterialId;
|
|
276
|
-
}
|
|
277
|
-
const newId = `${prefix ?? primitive.id}_seam_transparent_${entity.materials.length + 1}`;
|
|
278
|
-
entity.materials.push({
|
|
279
|
-
id: newId,
|
|
280
|
-
baseColor: [255, 255, 255],
|
|
281
|
-
opacity: 0,
|
|
282
|
-
});
|
|
283
|
-
transparentMaterialId = newId;
|
|
284
|
-
return newId;
|
|
285
|
-
};
|
|
286
|
-
const createTransparentSeam = () => {
|
|
287
|
-
const materialId = ensureTransparentMaterial();
|
|
288
|
-
const patternId = `${prefix ?? primitive.id}_${face}_seam_transparent_pattern_${entity.patterns.length + 1}`;
|
|
289
|
-
const textureId = `${prefix ?? primitive.id}_${face}_seam_transparent_texture_${entity.textures.length + 1}`;
|
|
290
|
-
entity.patterns.push({
|
|
291
|
-
id: patternId,
|
|
292
|
-
size: [width, height],
|
|
293
|
-
data: new Array(width * height).fill(0),
|
|
294
|
-
});
|
|
295
|
-
entity.textures.push({
|
|
296
|
-
id: textureId,
|
|
297
|
-
pattern: patternId,
|
|
298
|
-
materials: [materialId],
|
|
299
|
-
});
|
|
300
|
-
return textureId;
|
|
301
|
-
};
|
|
302
|
-
if (hasTransparentEdge) {
|
|
303
|
-
return createTransparentSeam();
|
|
304
|
-
}
|
|
305
|
-
if (!seeded || queue.length === 0) {
|
|
306
|
-
return undefined;
|
|
307
|
-
}
|
|
308
|
-
propagate(seamGrid);
|
|
309
|
-
const identifier = `${prefix ?? primitive.id}_${face}_seam`;
|
|
310
|
-
return createPatternAndTexture(entity, seamGrid, identifier);
|
|
311
|
-
}
|
|
312
|
-
//# sourceMappingURL=infer-face.js.map
|
package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"infer-face.js","sourceRoot":"","sources":["../../../../src/transforms/textured-boxes/infer-face.ts"],"names":[],"mappings":";;AAyPA,wDAsIC;AA/XD,6CAAsD;AAgBtD,MAAM,YAAY,GAGd;IACF,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE;QACtD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;QACvE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE;QACnD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;KAC1E;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE;QACtD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;QACvE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EA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,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,SAAS,CAAC,QAAQ,CAAC,CAAC;IAEpB,MAAM,UAAU,GAAG,GAAG,MAAM,IAAI,SAAS,CAAC,EAAE,IAAI,IAAI,OAAO,CAAC;IAC5D,OAAO,uBAAuB,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC/D,CAAC"}
|
package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BoxelDefinition } from "../../types";
|
|
2
|
-
import { type OverlayVoxelMode } from "../voxels/textured-to-voxel";
|
|
3
|
-
export type LayerMode = "base_only" | "flat" | "overlay" | "voxel";
|
|
4
|
-
export interface LayerModeOptions {
|
|
5
|
-
voxelMode?: OverlayVoxelMode;
|
|
6
|
-
stripAlpha?: boolean;
|
|
7
|
-
transparentFillColor?: [number, number, number];
|
|
8
|
-
}
|
|
9
|
-
export declare function applyLayerMode(entity: BoxelDefinition, mode: LayerMode, options?: LayerModeOptions | OverlayVoxelMode): BoxelDefinition;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyLayerMode = applyLayerMode;
|
|
4
|
-
const entity_utils_1 = require("../../entity-utils");
|
|
5
|
-
const textures_1 = require("../../textures");
|
|
6
|
-
const validation_1 = require("../../validation");
|
|
7
|
-
const textured_to_voxel_1 = require("../voxels/textured-to-voxel");
|
|
8
|
-
const merge_overlay_1 = require("./merge-overlay");
|
|
9
|
-
const FACE_KEYS = ["north", "south", "east", "west", "top", "bottom"];
|
|
10
|
-
const OVERLAY_PROPS = [
|
|
11
|
-
"northOverlay",
|
|
12
|
-
"southOverlay",
|
|
13
|
-
"eastOverlay",
|
|
14
|
-
"westOverlay",
|
|
15
|
-
"topOverlay",
|
|
16
|
-
"bottomOverlay",
|
|
17
|
-
"sidesOverlay",
|
|
18
|
-
"allOverlay",
|
|
19
|
-
];
|
|
20
|
-
const stripOverlay = (primitive) => {
|
|
21
|
-
const target = primitive;
|
|
22
|
-
OVERLAY_PROPS.forEach((prop) => {
|
|
23
|
-
target[prop] = undefined;
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
const buildOverlayPrimitive = (primitive) => {
|
|
27
|
-
const overlayTextures = [];
|
|
28
|
-
FACE_KEYS.forEach((face) => {
|
|
29
|
-
const textureId = (0, textures_1.resolveOverlayFaceTextureId)(primitive, face);
|
|
30
|
-
if (typeof textureId === "string" && textureId.length > 0) {
|
|
31
|
-
overlayTextures.push({ face, textureId });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
if (overlayTextures.length === 0) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
const overlay = {
|
|
38
|
-
id: `${primitive.id}_overlay_source`,
|
|
39
|
-
kind: "textured_box",
|
|
40
|
-
size: primitive.size ? [...primitive.size] : [1, 1, 1],
|
|
41
|
-
};
|
|
42
|
-
overlayTextures.forEach(({ face, textureId }) => {
|
|
43
|
-
overlay[face] = textureId;
|
|
44
|
-
});
|
|
45
|
-
return overlay;
|
|
46
|
-
};
|
|
47
|
-
const FACE_NAMES = ["north", "south", "east", "west", "top", "bottom"];
|
|
48
|
-
const hasOverlayFaces = (primitive) => FACE_NAMES.some((face) => {
|
|
49
|
-
const value = primitive[face];
|
|
50
|
-
return typeof value === "string" && value.length > 0;
|
|
51
|
-
});
|
|
52
|
-
const convertPrimitiveToVoxel = (entity, primitive, mode) => {
|
|
53
|
-
const textureLookup = new Map(entity.textures.map((entry) => [entry.id, entry]));
|
|
54
|
-
const patternLookup = new Map(entity.patterns.map((entry) => [entry.id, entry]));
|
|
55
|
-
const materialLookup = new Map(entity.materials.map((entry) => [entry.id, entry]));
|
|
56
|
-
let overlayPrimitive = buildOverlayPrimitive(primitive);
|
|
57
|
-
if (overlayPrimitive && primitive.id === "torso_primitive") {
|
|
58
|
-
overlayPrimitive.top = undefined;
|
|
59
|
-
overlayPrimitive.bottom = undefined;
|
|
60
|
-
if (Array.isArray(overlayPrimitive.size) && overlayPrimitive.size.length >= 3) {
|
|
61
|
-
overlayPrimitive.size = overlayPrimitive.size.map((value) => Math.max(1, Math.round(value ?? 1) - 2));
|
|
62
|
-
}
|
|
63
|
-
if (!hasOverlayFaces(overlayPrimitive)) {
|
|
64
|
-
overlayPrimitive = undefined;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return (0, textured_to_voxel_1.convertTexturedBoxesToVoxel)({
|
|
68
|
-
base: primitive,
|
|
69
|
-
overlay: overlayPrimitive,
|
|
70
|
-
textureLookup,
|
|
71
|
-
patternLookup,
|
|
72
|
-
materialLookup,
|
|
73
|
-
mode,
|
|
74
|
-
targetId: primitive.id,
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
const transformPrimitiveLayer = (entity, primitive, mode, voxelMode) => {
|
|
78
|
-
if (primitive.kind !== "textured_box") {
|
|
79
|
-
return primitive;
|
|
80
|
-
}
|
|
81
|
-
const textured = primitive;
|
|
82
|
-
if (mode === "overlay") {
|
|
83
|
-
return textured;
|
|
84
|
-
}
|
|
85
|
-
if (mode === "base_only") {
|
|
86
|
-
stripOverlay(textured);
|
|
87
|
-
return textured;
|
|
88
|
-
}
|
|
89
|
-
if (mode === "flat") {
|
|
90
|
-
(0, merge_overlay_1.mergeOverlayIntoBase)(entity, textured);
|
|
91
|
-
stripOverlay(textured);
|
|
92
|
-
textured.renderMode = (0, textures_1.determineTexturedBoxRenderMode)(entity, textured);
|
|
93
|
-
return textured;
|
|
94
|
-
}
|
|
95
|
-
if (mode === "voxel") {
|
|
96
|
-
return convertPrimitiveToVoxel(entity, textured, voxelMode);
|
|
97
|
-
}
|
|
98
|
-
return textured;
|
|
99
|
-
};
|
|
100
|
-
const stripPrimitiveRenderMode = (primitive) => {
|
|
101
|
-
if (primitive.kind === "textured_box" && primitive.renderMode === "cutout") {
|
|
102
|
-
primitive.renderMode = undefined;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
const enforceOpaqueMaterials = (materials, fillColor, stripAlpha) => {
|
|
106
|
-
if (!stripAlpha) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const [fillR, fillG, fillB] = fillColor;
|
|
110
|
-
materials.forEach((material) => {
|
|
111
|
-
const opacity = material.opacity ?? 1;
|
|
112
|
-
if (opacity <= 0) {
|
|
113
|
-
material.baseColor = [fillR, fillG, fillB];
|
|
114
|
-
}
|
|
115
|
-
if (material.opacity !== undefined) {
|
|
116
|
-
delete material.opacity;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
function applyLayerMode(entity, mode, options) {
|
|
121
|
-
if (mode === "overlay") {
|
|
122
|
-
return entity;
|
|
123
|
-
}
|
|
124
|
-
const opts = typeof options === "string" ? { voxelMode: options } : (options ?? {});
|
|
125
|
-
const voxelMode = opts.voxelMode ?? "outer_wrap";
|
|
126
|
-
const stripAlpha = opts.stripAlpha ?? false;
|
|
127
|
-
const fillColor = opts.transparentFillColor ?? [0, 0, 0];
|
|
128
|
-
const transformed = (0, entity_utils_1.cloneEntity)(entity);
|
|
129
|
-
const primitives = [];
|
|
130
|
-
transformed.primitives.forEach((primitive) => {
|
|
131
|
-
const result = transformPrimitiveLayer(transformed, primitive, mode, voxelMode);
|
|
132
|
-
if (Array.isArray(result)) {
|
|
133
|
-
primitives.push(...result);
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
primitives.push(result);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
if (mode === "flat" && stripAlpha) {
|
|
140
|
-
primitives.forEach(stripPrimitiveRenderMode);
|
|
141
|
-
enforceOpaqueMaterials(transformed.materials, fillColor, stripAlpha);
|
|
142
|
-
}
|
|
143
|
-
transformed.primitives = primitives;
|
|
144
|
-
const { issues } = (0, validation_1.validateBoxel)(transformed);
|
|
145
|
-
if (issues.length > 0) {
|
|
146
|
-
const summary = issues
|
|
147
|
-
.slice(0, 3)
|
|
148
|
-
.map((issue) => `${issue.path}: ${issue.message}`)
|
|
149
|
-
.join("; ");
|
|
150
|
-
throw new Error(`Layer transformation produced invalid entity — ${summary}`);
|
|
151
|
-
}
|
|
152
|
-
return transformed;
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=layer-mode.js.map
|
package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layer-mode.js","sourceRoot":"","sources":["../../../../src/transforms/textured-boxes/layer-mode.ts"],"names":[],"mappings":";;AA8JA,wCA2CC;AAzMD,qDAAiD;AACjD,6CAA6F;AAG7F,iDAAiD;AACjD,mEAAiG;AACjG,mDAAuD;AAYvD,MAAM,SAAS,GAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AACjF,MAAM,aAAa,GAA6B;IAC9C,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,YAAY;IACZ,eAAe;IACf,cAAc;IACd,YAAY;CACb,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,SAAsB,EAAQ,EAAE;IACpD,MAAM,MAAM,GAAG,SAA0D,CAAC;IAC1E,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7B,MAAM,CAAC,IAAc,CAAC,GAAG,SAAS,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,SAAsB,EAA2B,EAAE;IAChF,MAAM,eAAe,GAAgD,EAAE,CAAC;IACxE,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,MAAM,SAAS,GAAG,IAAA,sCAA2B,EAAC,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AAC,CAAC,SAAS,EAAE,EAAE;QAC3C,MAAM,MAAM,GAAG,uBAAuB,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;QAChF,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1B,UAAU,CAAC,IAAI,CAAC,GAAI,MAAsB,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,IAAI,KAAK,MAAM,IAAI,UAAU,EAAE,CAAC;QAClC,UAAU,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;QAC7C,sBAAsB,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;IAED,WAAW,CAAC,UAAU,GAAG,UAAU,CAAC;IAEpC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,OAAO,GAAI,MAAiC;aAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;aACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;aACjD,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kDAAkD,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mergeOverlayIntoBase = mergeOverlayIntoBase;
|
|
4
|
-
const textures_1 = require("../../textures");
|
|
5
|
-
const FACE_NAMES = ["north", "south", "east", "west", "top", "bottom"];
|
|
6
|
-
const getFaceTexture = (primitive, face) => {
|
|
7
|
-
switch (face) {
|
|
8
|
-
case "north":
|
|
9
|
-
return primitive.north;
|
|
10
|
-
case "south":
|
|
11
|
-
return primitive.south;
|
|
12
|
-
case "east":
|
|
13
|
-
return primitive.east;
|
|
14
|
-
case "west":
|
|
15
|
-
return primitive.west;
|
|
16
|
-
case "top":
|
|
17
|
-
return primitive.top;
|
|
18
|
-
case "bottom":
|
|
19
|
-
return primitive.bottom;
|
|
20
|
-
default:
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const setFaceTexture = (primitive, face, textureId) => {
|
|
25
|
-
switch (face) {
|
|
26
|
-
case "north":
|
|
27
|
-
primitive.north = textureId;
|
|
28
|
-
break;
|
|
29
|
-
case "south":
|
|
30
|
-
primitive.south = textureId;
|
|
31
|
-
break;
|
|
32
|
-
case "east":
|
|
33
|
-
primitive.east = textureId;
|
|
34
|
-
break;
|
|
35
|
-
case "west":
|
|
36
|
-
primitive.west = textureId;
|
|
37
|
-
break;
|
|
38
|
-
case "top":
|
|
39
|
-
primitive.top = textureId;
|
|
40
|
-
break;
|
|
41
|
-
case "bottom":
|
|
42
|
-
primitive.bottom = textureId;
|
|
43
|
-
break;
|
|
44
|
-
default:
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
function mergeOverlayIntoBase(entity, primitive) {
|
|
49
|
-
const textureLookup = new Map(entity.textures.map((entry) => [entry.id, entry]));
|
|
50
|
-
const patternLookup = new Map(entity.patterns.map((entry) => [entry.id, entry]));
|
|
51
|
-
const materialLookup = new Map(entity.materials.map((entry) => [entry.id, entry]));
|
|
52
|
-
FACE_NAMES.forEach((face) => {
|
|
53
|
-
const overlayTextureId = (0, textures_1.resolveOverlayFaceTextureId)(primitive, face);
|
|
54
|
-
if (!overlayTextureId) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const baseTextureId = (0, textures_1.resolveFaceTextureId)(primitive, face) ?? getFaceTexture(primitive, face);
|
|
58
|
-
if (!baseTextureId) {
|
|
59
|
-
setFaceTexture(primitive, face, overlayTextureId);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const overlayTexture = textureLookup.get(overlayTextureId);
|
|
63
|
-
const overlayPattern = overlayTexture ? patternLookup.get(overlayTexture.pattern) : undefined;
|
|
64
|
-
if (!overlayTexture || !overlayPattern) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
const baseTexture = textureLookup.get(baseTextureId);
|
|
68
|
-
const basePattern = baseTexture ? patternLookup.get(baseTexture.pattern) : undefined;
|
|
69
|
-
if (!baseTexture || !basePattern) {
|
|
70
|
-
setFaceTexture(primitive, face, overlayTextureId);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const baseData = Array.isArray(basePattern.data) ? basePattern.data.slice() : [];
|
|
74
|
-
const overlayData = Array.isArray(overlayPattern.data) ? overlayPattern.data : [];
|
|
75
|
-
const materialIndexLookup = new Map();
|
|
76
|
-
baseTexture.materials.forEach((materialId, idx) => {
|
|
77
|
-
if (!materialIndexLookup.has(materialId)) {
|
|
78
|
-
materialIndexLookup.set(materialId, idx);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
const ensureMaterialIndex = (materialId) => {
|
|
82
|
-
if (!materialId) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
const existing = materialIndexLookup.get(materialId);
|
|
86
|
-
if (existing !== undefined) {
|
|
87
|
-
return existing;
|
|
88
|
-
}
|
|
89
|
-
const nextIndex = baseTexture.materials.length;
|
|
90
|
-
baseTexture.materials.push(materialId);
|
|
91
|
-
materialIndexLookup.set(materialId, nextIndex);
|
|
92
|
-
return nextIndex;
|
|
93
|
-
};
|
|
94
|
-
const opaqueOverlayIndex = (overlayValue) => {
|
|
95
|
-
if (overlayValue === undefined) {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
const overlayMaterialId = overlayTexture.materials[overlayValue];
|
|
99
|
-
if (!overlayMaterialId) {
|
|
100
|
-
return undefined;
|
|
101
|
-
}
|
|
102
|
-
const overlayMaterial = materialLookup.get(overlayMaterialId);
|
|
103
|
-
if (overlayMaterial && typeof overlayMaterial.opacity === "number" && overlayMaterial.opacity <= 0) {
|
|
104
|
-
return undefined;
|
|
105
|
-
}
|
|
106
|
-
const mapped = ensureMaterialIndex(overlayMaterialId);
|
|
107
|
-
return mapped;
|
|
108
|
-
};
|
|
109
|
-
const combined = baseData.map((value, index) => {
|
|
110
|
-
const overlayValue = overlayData[index];
|
|
111
|
-
const mappedIndex = opaqueOverlayIndex(overlayValue);
|
|
112
|
-
if (mappedIndex === undefined) {
|
|
113
|
-
return value;
|
|
114
|
-
}
|
|
115
|
-
return mappedIndex;
|
|
116
|
-
});
|
|
117
|
-
basePattern.data = combined;
|
|
118
|
-
basePattern.size = [...overlayPattern.size];
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=merge-overlay.js.map
|