@playdrop/playdrop-cli 0.3.1-build.1 → 0.3.4-build.1
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/README.md +1 -0
- package/config/client-meta.json +5 -5
- package/dist/apps/build.js +90 -114
- package/dist/apps/upload.js +30 -8
- package/dist/apps/validate.js +61 -0
- package/dist/assets/model-artifacts.d.ts +8 -0
- package/dist/assets/model-artifacts.js +375 -0
- package/dist/assets/model-worker.d.ts +22 -0
- package/dist/assets/model-worker.js +123 -0
- package/dist/catalogue.d.ts +4 -4
- package/dist/catalogue.js +234 -44
- package/dist/commands/build.js +15 -2
- package/dist/commands/dev.js +2 -0
- package/dist/commands/devServer.js +88 -9
- package/dist/commands/generation.js +130 -6
- package/dist/commands/migrateCatalogueV2.js +4 -4
- package/dist/commands/upload.js +63 -18
- package/dist/index.js +6 -5
- package/dist/playwright.js +9 -1
- package/node_modules/@playdrop/ai-client/dist/index.d.ts +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +39 -17
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +236 -42
- package/node_modules/@playdrop/api-client/dist/index.d.ts +27 -5
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +39 -9
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-cleaner.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/entity-cleaner.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-utils.d.ts +8 -8
- package/node_modules/@playdrop/boxel-core/dist/src/entity-utils.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/textured-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/textured-builder.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/types.d.ts +6 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/voxel-builder.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r15/voxel-builder.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/builder.d.ts +3 -3
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/r6/builder.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/index.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/humanoid/templates/index.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/palette_tools.d.ts +4 -4
- package/node_modules/@playdrop/boxel-core/dist/src/palette_tools.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/serialization.d.ts +4 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/serialization.js +10 -10
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/serialization.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.d.ts +5 -5
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/infer-face.d.ts +2 -2
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/infer-face.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/layer-mode.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/layer-mode.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +2 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/slice.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/slice.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/slice.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/upscale.d.ts +3 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/upscale.js +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/upscale.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.d.ts +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.d.ts +3 -3
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.d.ts +10 -10
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.js +36 -36
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/validation.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/entity-utils.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.js +2 -2
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/layer-mode.test.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/test/palette-tools.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.js +6 -6
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/textures.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/types.test.js +1 -1
- package/node_modules/@playdrop/boxel-core/dist/test/types.test.js.map +1 -0
- package/node_modules/@playdrop/boxel-core/dist/test/upscale.test.js.map +1 -0
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.js +11 -11
- package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.js.map +1 -1
- package/node_modules/@playdrop/{entity-core → boxel-core}/package.json +2 -2
- package/node_modules/@playdrop/boxel-three/dist/src/animations.d.ts +4 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/animations.js +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/builders.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/builders.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/context.d.ts +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/glb.d.ts +9 -9
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/glb.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/image.d.ts +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/exporters/image.js +5 -5
- package/node_modules/@playdrop/boxel-three/dist/src/index.d.ts +17 -0
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +15 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/instantiate.d.ts +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/instantiate.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/nodes.d.ts +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.d.ts +7 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/overlays.js +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/scene.d.ts +3 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/scene.js +6 -6
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/skinned-mesh.d.ts +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/textures.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/textures.js +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/types.d.ts +15 -15
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/faces.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/mesher.d.ts +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/mesher.js +1 -1
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/export-image.playwright.test.js +4 -4
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.d.ts +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.js +10 -10
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/glb-skinned.test.js +5 -5
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +8 -0
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/instantiate.test.js +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/overlays.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-filter.test.js +5 -5
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-smoke.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/skinned-mesh.test.js +2 -2
- package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/textured-overlay.test.js +3 -3
- package/node_modules/@playdrop/{entity-three → boxel-three}/package.json +3 -3
- package/node_modules/@playdrop/config/client-meta.json +5 -5
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +155 -52
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +27 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts +1 -0
- package/node_modules/@playdrop/types/dist/asset-pack.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.d.ts +20 -4
- package/node_modules/@playdrop/types/dist/asset.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/asset.js +43 -37
- package/node_modules/@playdrop/types/dist/entity.d.ts +2 -2
- package/node_modules/@playdrop/types/dist/entity.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/entity.js +2 -2
- package/node_modules/@playdrop/types/dist/realtime.d.ts +1 -0
- package/node_modules/@playdrop/types/dist/realtime.d.ts.map +1 -1
- package/package.json +10 -7
- package/node_modules/@playdrop/entity-core/dist/src/entity-cleaner.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/entity-utils.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/textured-builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/types.d.ts +0 -6
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r15/voxel-builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/r6/builder.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/humanoid/templates/index.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/palette_tools.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/serialization.d.ts +0 -4
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/infer-face.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/layer-mode.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/merge-overlay.d.ts +0 -2
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/merge-overlay.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/textured-boxes/slice.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/src/transforms/upscale.d.ts +0 -3
- package/node_modules/@playdrop/entity-core/dist/test/entity-utils.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/layer-mode.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/palette-tools.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/textures.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/types.test.js.map +0 -1
- package/node_modules/@playdrop/entity-core/dist/test/upscale.test.js.map +0 -1
- package/node_modules/@playdrop/entity-three/dist/src/animations.d.ts +0 -4
- package/node_modules/@playdrop/entity-three/dist/src/index.d.ts +0 -17
- package/node_modules/@playdrop/entity-three/dist/src/index.js +0 -15
- package/node_modules/@playdrop/entity-three/dist/src/overlays.d.ts +0 -7
- package/node_modules/@playdrop/entity-three/dist/src/scene.d.ts +0 -3
- package/node_modules/@playdrop/entity-three/dist/test/index.test.js +0 -8
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.d.ts +0 -22
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.d.ts.map +0 -1
- package/node_modules/@playdrop/types/dist/profile-asset-semantics.js +0 -105
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-cleaner.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/entity-utils.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/format-utils.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/geometry.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/common.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/textured-builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/types.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/types.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r15/voxel-builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/builder.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/scanner.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/artifacts.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/r6/textures/face-map.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/humanoid_r15.json +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/humanoid_r6.json +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/humanoid/templates/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/index.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/materials.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/palette_tools.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/textures.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/infer-face.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/textured-boxes/merge-overlay.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/slice.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/transforms/voxels/textured-to-voxel.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/types.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels/greedy-mesher.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/src/voxels.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/entity-utils.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/entity-utils.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/greedy-mesher.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/humanoid/humanoid-builders.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/index.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/layer-mode.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/layer-mode.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/materials.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/palette-tools.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/palette-tools.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/serialization.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/textures.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/textures.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/types.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/upscale.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/upscale.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/validation.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.js +0 -0
- /package/node_modules/@playdrop/{entity-core → boxel-core}/dist/test/voxels.test.js.map +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/context.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/nodes.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/primitives.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/primitives.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/skinned-mesh.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/texture-atlas.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/texture-atlas.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/types.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/src/voxels/faces.js +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/export-image.playwright.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/glb-skinned.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/index.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/instantiate.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/overlays.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-filter.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/scene-smoke.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/skinned-mesh.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/textured-overlay.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/voxels.test.d.ts +0 -0
- /package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/voxels.test.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxelDefinition, Material, Primitive } from '@playdrop/boxel-core';
|
|
3
3
|
import type { TextureBundle } from './textures.js';
|
|
4
4
|
export interface BuilderSettings {
|
|
5
5
|
enableShadows: boolean;
|
|
@@ -7,13 +7,13 @@ export interface BuilderSettings {
|
|
|
7
7
|
export interface PrimitiveBuilderContext {
|
|
8
8
|
THREE: typeof THREEType;
|
|
9
9
|
settings: BuilderSettings;
|
|
10
|
-
entity:
|
|
10
|
+
entity: BoxelDefinition | null;
|
|
11
11
|
materialsById: Map<string, Material>;
|
|
12
12
|
primitivesById: Map<string, Primitive>;
|
|
13
13
|
textureCache: Map<string, TextureBundle>;
|
|
14
14
|
}
|
|
15
15
|
export interface BuilderUpdate {
|
|
16
|
-
entity?:
|
|
16
|
+
entity?: BoxelDefinition | null;
|
|
17
17
|
settings?: Partial<BuilderSettings>;
|
|
18
18
|
}
|
|
19
19
|
export declare function createBuilderContext(options: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
2
|
import type { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BoxelDefinition, Primitive, Material, Texture, Pattern } from '@playdrop/boxel-core';
|
|
4
4
|
import { type VoxelFacePatch } from '../voxels/faces.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BoxelSceneAnimation } from '../types.js';
|
|
6
6
|
interface TexturePixels {
|
|
7
7
|
id: string;
|
|
8
8
|
width: number;
|
|
@@ -32,20 +32,20 @@ export type ExportMode = 'hierarchical' | 'merged' | 'skinned';
|
|
|
32
32
|
interface ExportModelOptions {
|
|
33
33
|
THREE: typeof THREEType;
|
|
34
34
|
GLTFExporterCtor: new () => GLTFExporter;
|
|
35
|
-
model:
|
|
35
|
+
model: BoxelDefinition;
|
|
36
36
|
mode?: ExportMode;
|
|
37
37
|
binary?: boolean;
|
|
38
38
|
animationIds?: string[] | null;
|
|
39
39
|
}
|
|
40
40
|
export declare function exportModelToGLB(options: ExportModelOptions): Promise<Blob>;
|
|
41
|
-
export declare function
|
|
41
|
+
export declare function createBoxelSceneGraph(options: {
|
|
42
42
|
THREE: typeof THREEType;
|
|
43
|
-
model:
|
|
43
|
+
model: BoxelDefinition;
|
|
44
44
|
mode?: ExportMode;
|
|
45
45
|
}): SceneGraphResult;
|
|
46
46
|
interface ExportContext {
|
|
47
47
|
THREE: typeof THREEType;
|
|
48
|
-
model:
|
|
48
|
+
model: BoxelDefinition;
|
|
49
49
|
materialsById: Map<string, Material>;
|
|
50
50
|
primitivesById: Map<string, Primitive>;
|
|
51
51
|
texturesById: Map<string, Texture>;
|
|
@@ -54,7 +54,7 @@ interface ExportContext {
|
|
|
54
54
|
voxelSurfacesByPrimitive: Map<string, CachedVoxelPatch[]>;
|
|
55
55
|
plainMaterialCache: Map<string, THREEType.MeshStandardMaterial>;
|
|
56
56
|
}
|
|
57
|
-
declare function createExportContext(THREE: typeof THREEType, model:
|
|
57
|
+
declare function createExportContext(THREE: typeof THREEType, model: BoxelDefinition): ExportContext;
|
|
58
58
|
interface AtlasBuildOptions {
|
|
59
59
|
THREE: typeof THREEType;
|
|
60
60
|
materialsById: Map<string, Material>;
|
|
@@ -63,11 +63,11 @@ interface AtlasBuildOptions {
|
|
|
63
63
|
usedTextureIds: Set<string>;
|
|
64
64
|
}
|
|
65
65
|
declare function buildTextureAtlas(options: AtlasBuildOptions, extraEntries?: TexturePixels[]): TextureAtlas | null;
|
|
66
|
-
declare function collectUsedTextureIds(model:
|
|
66
|
+
declare function collectUsedTextureIds(model: BoxelDefinition, primitivesById: Map<string, Primitive>): Set<string>;
|
|
67
67
|
interface SceneGraphResult {
|
|
68
68
|
root: THREEType.Object3D;
|
|
69
69
|
nodeLookup: Map<string, THREEType.Object3D>;
|
|
70
|
-
animations:
|
|
70
|
+
animations: BoxelSceneAnimation[];
|
|
71
71
|
dispose: () => void;
|
|
72
72
|
}
|
|
73
73
|
declare function buildSceneGraph(context: ExportContext, mode: ExportMode): SceneGraphResult;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { generateVoxelFaceSurfaces, FACE_ORDER } from '../voxels/faces.js';
|
|
2
2
|
import { createBoxGeometry, collectGroupVertexIndices } from '../primitives.js';
|
|
3
|
-
import {
|
|
3
|
+
import { createBoxelScene } from '../scene.js';
|
|
4
4
|
import { buildEntitySkinnedMesh } from '../skinned-mesh.js';
|
|
5
5
|
import { buildAnimations } from '../animations.js';
|
|
6
6
|
const DEFAULT_COLOR = [59, 130, 246];
|
|
@@ -93,7 +93,7 @@ export async function exportModelToGLB(options) {
|
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
export function
|
|
96
|
+
export function createBoxelSceneGraph(options) {
|
|
97
97
|
const { THREE, model } = options;
|
|
98
98
|
const mode = options.mode ?? 'merged';
|
|
99
99
|
const context = createExportContext(THREE, model);
|
|
@@ -493,7 +493,7 @@ function collectUsedTextureIds(model, primitivesById) {
|
|
|
493
493
|
}
|
|
494
494
|
function buildSceneGraph(context, mode) {
|
|
495
495
|
if (mode === 'merged') {
|
|
496
|
-
const scene =
|
|
496
|
+
const scene = createBoxelScene({ THREE: context.THREE, entity: context.model });
|
|
497
497
|
const root = buildMergedGroupFromScene(context, scene);
|
|
498
498
|
scene.dispose();
|
|
499
499
|
const dispose = () => {
|
|
@@ -540,7 +540,7 @@ function buildSceneGraph(context, mode) {
|
|
|
540
540
|
dispose,
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
const scene =
|
|
543
|
+
const scene = createBoxelScene({ THREE: context.THREE, entity: context.model });
|
|
544
544
|
const nodeLookup = new Map();
|
|
545
545
|
scene.nodes.forEach(meta => {
|
|
546
546
|
nodeLookup.set(meta.id, meta.object);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxelDefinition } from '@playdrop/boxel-core';
|
|
3
3
|
import { type ExportMode } from './glb.js';
|
|
4
4
|
declare const DIRECTION_VECTORS: Record<string, [number, number, number]>;
|
|
5
|
-
export interface
|
|
5
|
+
export interface RenderBoxelImageOptions {
|
|
6
6
|
THREE: typeof THREEType;
|
|
7
7
|
renderer: THREEType.WebGLRenderer;
|
|
8
|
-
entity:
|
|
8
|
+
entity: BoxelDefinition;
|
|
9
9
|
mode?: ExportMode;
|
|
10
10
|
animationIds?: string[] | null;
|
|
11
11
|
animationId?: string | null;
|
|
@@ -14,5 +14,5 @@ export interface RenderEntityImageOptions {
|
|
|
14
14
|
direction?: keyof typeof DIRECTION_VECTORS;
|
|
15
15
|
background?: THREEType.ColorRepresentation | null;
|
|
16
16
|
}
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function renderBoxelToDataURL(options: RenderBoxelImageOptions): Promise<string>;
|
|
18
18
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createBoxelScene } from '../scene.js';
|
|
2
|
+
import { createBoxelSceneGraph } from './glb.js';
|
|
3
3
|
import { buildEntitySkinnedMesh } from '../skinned-mesh.js';
|
|
4
4
|
import { buildAnimations } from '../animations.js';
|
|
5
5
|
function findNodeById(root, id) {
|
|
@@ -41,7 +41,7 @@ const SHADOW_MAP_SIZE = 2048;
|
|
|
41
41
|
const SHADOW_BIAS = -0.00012;
|
|
42
42
|
const SHADOW_NORMAL_BIAS = 0.006;
|
|
43
43
|
const SUPER_SAMPLE_RATIO = 2;
|
|
44
|
-
export async function
|
|
44
|
+
export async function renderBoxelToDataURL(options) {
|
|
45
45
|
const { THREE: three, renderer, entity, mode = 'hierarchical', animationId, width, height, direction = 'preview', background = null, } = options;
|
|
46
46
|
const sizeTarget = new three.Vector2();
|
|
47
47
|
renderer.getSize(sizeTarget);
|
|
@@ -72,7 +72,7 @@ export async function renderEntityToDataURL(options) {
|
|
|
72
72
|
let animations = [];
|
|
73
73
|
let nodeLookup = null;
|
|
74
74
|
if (mode === 'hierarchical') {
|
|
75
|
-
const scene =
|
|
75
|
+
const scene = createBoxelScene({ THREE: three, entity });
|
|
76
76
|
disposeScene = scene.dispose;
|
|
77
77
|
root = scene.root;
|
|
78
78
|
animations = scene.animations;
|
|
@@ -94,7 +94,7 @@ export async function renderEntityToDataURL(options) {
|
|
|
94
94
|
animations = buildAnimations(three, entity, nodeLookup);
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
|
-
const sceneGraph =
|
|
97
|
+
const sceneGraph = createBoxelSceneGraph({ THREE: three, model: entity, mode });
|
|
98
98
|
disposeScene = sceneGraph.dispose;
|
|
99
99
|
root = sceneGraph.root;
|
|
100
100
|
animations = sceneGraph.animations;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { createBoxelScene, createBoxelNodeScene } from './scene.js';
|
|
3
|
+
export { attachBoxelOverlays } from './overlays.js';
|
|
4
|
+
export * from './primitives.js';
|
|
5
|
+
export * from './context.js';
|
|
6
|
+
export * from './textures.js';
|
|
7
|
+
export * from './builders.js';
|
|
8
|
+
export * from './voxels/mesher.js';
|
|
9
|
+
export * from './voxels/faces.js';
|
|
10
|
+
export { exportModelToGLB, createBoxelSceneGraph } from './exporters/glb.js';
|
|
11
|
+
export type { ExportMode } from './exporters/glb.js';
|
|
12
|
+
export { renderBoxelToDataURL } from './exporters/image.js';
|
|
13
|
+
export type { RenderBoxelImageOptions } from './exporters/image.js';
|
|
14
|
+
export { __testing as __boxelThreeTesting } from './exporters/glb.js';
|
|
15
|
+
export * from './texture-atlas.js';
|
|
16
|
+
export * from './skinned-mesh.js';
|
|
17
|
+
export * from './instantiate.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './types.js';
|
|
2
|
+
export { createBoxelScene, createBoxelNodeScene } from './scene.js';
|
|
3
|
+
export { attachBoxelOverlays } from './overlays.js';
|
|
4
|
+
export * from './primitives.js';
|
|
5
|
+
export * from './context.js';
|
|
6
|
+
export * from './textures.js';
|
|
7
|
+
export * from './builders.js';
|
|
8
|
+
export * from './voxels/mesher.js';
|
|
9
|
+
export * from './voxels/faces.js';
|
|
10
|
+
export { exportModelToGLB, createBoxelSceneGraph } from './exporters/glb.js';
|
|
11
|
+
export { renderBoxelToDataURL } from './exporters/image.js';
|
|
12
|
+
export { __testing as __boxelThreeTesting } from './exporters/glb.js';
|
|
13
|
+
export * from './texture-atlas.js';
|
|
14
|
+
export * from './skinned-mesh.js';
|
|
15
|
+
export * from './instantiate.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { BoxelDefinition } from '@playdrop/boxel-core';
|
|
3
|
+
import type { BoxelSceneResult } from './types.js';
|
|
4
4
|
import type { BuildSkinnedMeshResult } from './skinned-mesh.js';
|
|
5
5
|
export type InstantiateEntityObject3DMode = 'hierarchy' | 'merged' | 'skinned';
|
|
6
6
|
interface InstantiateBaseResult {
|
|
@@ -10,7 +10,7 @@ interface InstantiateBaseResult {
|
|
|
10
10
|
export interface InstantiateHierarchyResult extends InstantiateBaseResult {
|
|
11
11
|
mode: 'hierarchy';
|
|
12
12
|
object: THREEType.Group;
|
|
13
|
-
scene:
|
|
13
|
+
scene: BoxelSceneResult;
|
|
14
14
|
clips: THREEType.AnimationClip[];
|
|
15
15
|
findNode(nodeId: string): THREEType.Object3D | undefined;
|
|
16
16
|
forEachNode(visitor: (node: THREEType.Object3D, nodeId: string) => void): void;
|
|
@@ -33,7 +33,7 @@ export interface InstantiateSkinnedResult extends InstantiateBaseResult {
|
|
|
33
33
|
export type InstantiateEntityObject3DResult = InstantiateHierarchyResult | InstantiateMergedResult | InstantiateSkinnedResult;
|
|
34
34
|
export interface InstantiateEntityObject3DOptions {
|
|
35
35
|
THREE: typeof THREEType;
|
|
36
|
-
entity:
|
|
36
|
+
entity: BoxelDefinition;
|
|
37
37
|
mode?: InstantiateEntityObject3DMode;
|
|
38
38
|
}
|
|
39
39
|
export declare function instantiateEntityObject3D(options: InstantiateEntityObject3DOptions): InstantiateEntityObject3DResult;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createBoxelScene } from './scene.js';
|
|
2
|
+
import { createBoxelSceneGraph } from './exporters/glb.js';
|
|
3
3
|
import { buildEntitySkinnedMesh } from './skinned-mesh.js';
|
|
4
4
|
import { buildAnimations } from './animations.js';
|
|
5
5
|
function instantiateHierarchy(options) {
|
|
6
6
|
const { THREE, entity } = options;
|
|
7
|
-
const scene =
|
|
7
|
+
const scene = createBoxelScene({ THREE, entity });
|
|
8
8
|
const clips = scene.animations.map(animation => animation.clip);
|
|
9
9
|
return {
|
|
10
10
|
mode: 'hierarchy',
|
|
@@ -22,7 +22,7 @@ function instantiateHierarchy(options) {
|
|
|
22
22
|
}
|
|
23
23
|
function instantiateMerged(options) {
|
|
24
24
|
const { THREE, entity } = options;
|
|
25
|
-
const graph =
|
|
25
|
+
const graph = createBoxelSceneGraph({ THREE, model: entity, mode: 'merged' });
|
|
26
26
|
const { root } = graph;
|
|
27
27
|
return {
|
|
28
28
|
mode: 'merged',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type { Node } from '@playdrop/
|
|
2
|
+
import type { Node } from '@playdrop/boxel-core';
|
|
3
3
|
import type { PrimitiveBuilderContext } from './context.js';
|
|
4
4
|
export interface NodeBuildResult {
|
|
5
5
|
object: THREEType.Object3D;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as THREEType from 'three';
|
|
2
|
+
import type { BoxelOverlayOptions, BoxelOverlayHandles } from './types.js';
|
|
3
|
+
export interface CreateOverlayContext {
|
|
4
|
+
THREE: typeof THREEType;
|
|
5
|
+
target: THREEType.Object3D;
|
|
6
|
+
}
|
|
7
|
+
export declare function attachBoxelOverlays(context: CreateOverlayContext, options?: BoxelOverlayOptions): BoxelOverlayHandles;
|
|
@@ -53,7 +53,7 @@ function disposeObjectResources(object) {
|
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
export function
|
|
56
|
+
export function attachBoxelOverlays(context, options = {}) {
|
|
57
57
|
const { THREE, target } = context;
|
|
58
58
|
const overlays = {
|
|
59
59
|
dispose: () => {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BoxelThreeContext, BoxelSceneOptions, BoxelSceneResult } from './types.js';
|
|
2
|
+
export declare function createBoxelScene(context: BoxelThreeContext, options?: BoxelSceneOptions): BoxelSceneResult;
|
|
3
|
+
export declare function createBoxelNodeScene(context: BoxelThreeContext, nodeId: string, options?: BoxelSceneOptions): BoxelSceneResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createBuilderContext, updateBuilderContext } from './context.js';
|
|
2
2
|
import { buildNodeObject } from './nodes.js';
|
|
3
3
|
import { buildAnimations } from './animations.js';
|
|
4
|
-
import {
|
|
4
|
+
import { attachBoxelOverlays } from './overlays.js';
|
|
5
5
|
function normalizeNodeFilter(nodes) {
|
|
6
6
|
if (!nodes)
|
|
7
7
|
return null;
|
|
@@ -10,7 +10,7 @@ function normalizeNodeFilter(nodes) {
|
|
|
10
10
|
}
|
|
11
11
|
return new Set([nodes]);
|
|
12
12
|
}
|
|
13
|
-
export function
|
|
13
|
+
export function createBoxelScene(context, options = {}) {
|
|
14
14
|
const { THREE, entity } = context;
|
|
15
15
|
const nodeFilter = normalizeNodeFilter(options.nodes);
|
|
16
16
|
const builderContext = createBuilderContext({
|
|
@@ -35,7 +35,7 @@ export function createEntityScene(context, options = {}) {
|
|
|
35
35
|
return null;
|
|
36
36
|
})(entity.geometry.root);
|
|
37
37
|
if (!node) {
|
|
38
|
-
console.warn('[
|
|
38
|
+
console.warn('[boxel-three] node not found', nodeId);
|
|
39
39
|
return null;
|
|
40
40
|
}
|
|
41
41
|
const { object, nodes } = buildNodeObject(builderContext, node);
|
|
@@ -88,7 +88,7 @@ export function createEntityScene(context, options = {}) {
|
|
|
88
88
|
if (!request.origin && !request.bounds && !request.sockets) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const handles =
|
|
91
|
+
const handles = attachBoxelOverlays({ THREE, target: meta.object }, request);
|
|
92
92
|
overlayHandles.push(handles);
|
|
93
93
|
});
|
|
94
94
|
};
|
|
@@ -139,6 +139,6 @@ export function createEntityScene(context, options = {}) {
|
|
|
139
139
|
dispose,
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
export function
|
|
143
|
-
return
|
|
142
|
+
export function createBoxelNodeScene(context, nodeId, options = {}) {
|
|
143
|
+
return createBoxelScene(context, { ...options, nodes: nodeId });
|
|
144
144
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxelDefinition } from '@playdrop/boxel-core';
|
|
3
3
|
export interface BuildSkinnedMeshOptions {
|
|
4
4
|
THREE: typeof THREEType;
|
|
5
|
-
entity:
|
|
5
|
+
entity: BoxelDefinition;
|
|
6
6
|
}
|
|
7
7
|
export interface BuildSkinnedMeshResult {
|
|
8
8
|
mesh: THREEType.SkinnedMesh;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type { Material, Pattern, Texture } from '@playdrop/
|
|
2
|
+
import type { Material, Pattern, Texture } from '@playdrop/boxel-core';
|
|
3
3
|
import type { PrimitiveBuilderContext } from './context.js';
|
|
4
4
|
type TextureArray = Uint8Array<ArrayBuffer>;
|
|
5
5
|
export interface TextureBundle {
|
|
@@ -64,7 +64,7 @@ export function ensureTextureInstance(context, textureDef) {
|
|
|
64
64
|
}
|
|
65
65
|
const pattern = context.entity.patterns.find(entry => entry.id === textureDef.pattern);
|
|
66
66
|
if (!pattern) {
|
|
67
|
-
console.warn('[
|
|
67
|
+
console.warn('[boxel-three] pattern not found for texture', textureDef.id);
|
|
68
68
|
return null;
|
|
69
69
|
}
|
|
70
70
|
const { color, emissive } = buildTexturePixels(context, textureDef, pattern, context.materialsById);
|
|
@@ -149,7 +149,7 @@ export function createTextureMaterial(context, textureId) {
|
|
|
149
149
|
}
|
|
150
150
|
const textureDef = context.entity.textures.find(entry => entry.id === textureId);
|
|
151
151
|
if (!textureDef) {
|
|
152
|
-
console.warn('[
|
|
152
|
+
console.warn('[boxel-three] texture not found', textureId);
|
|
153
153
|
return new context.THREE.MeshStandardMaterial({
|
|
154
154
|
color: 0x3b82f6,
|
|
155
155
|
opacity: 0.45,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as THREEType from 'three';
|
|
2
|
-
import type { ConnectMode,
|
|
3
|
-
export type { ConnectMode } from '@playdrop/
|
|
4
|
-
export interface
|
|
2
|
+
import type { ConnectMode, BoxelDefinition } from '@playdrop/boxel-core';
|
|
3
|
+
export type { ConnectMode } from '@playdrop/boxel-core';
|
|
4
|
+
export interface BoxelThreeContext {
|
|
5
5
|
THREE: typeof THREEType;
|
|
6
|
-
entity:
|
|
6
|
+
entity: BoxelDefinition;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface BoxelSceneOptions {
|
|
9
9
|
/**
|
|
10
10
|
* Optional node identifier (or list of identifiers) to render instead of the full entity.
|
|
11
11
|
* When omitted, the entire entity geometry tree is emitted.
|
|
@@ -14,9 +14,9 @@ export interface EntitySceneOptions {
|
|
|
14
14
|
/**
|
|
15
15
|
* Configure optional overlay helpers (origin, bounds, sockets) to render alongside the scene.
|
|
16
16
|
*/
|
|
17
|
-
overlays?:
|
|
17
|
+
overlays?: BoxelOverlayOptions;
|
|
18
18
|
}
|
|
19
|
-
export interface
|
|
19
|
+
export interface BoxelSceneNodeMeta {
|
|
20
20
|
/**
|
|
21
21
|
* Original entity node identifier.
|
|
22
22
|
*/
|
|
@@ -34,18 +34,18 @@ export interface EntitySceneNodeMeta {
|
|
|
34
34
|
*/
|
|
35
35
|
connectMode: ConnectMode;
|
|
36
36
|
}
|
|
37
|
-
export interface
|
|
37
|
+
export interface BoxelSceneAnimationChannel {
|
|
38
38
|
nodeId: string;
|
|
39
39
|
property: 'position' | 'rotation' | 'scale';
|
|
40
40
|
track: THREEType.KeyframeTrack;
|
|
41
41
|
}
|
|
42
|
-
export interface
|
|
42
|
+
export interface BoxelSceneAnimation {
|
|
43
43
|
id: string;
|
|
44
44
|
duration: number;
|
|
45
|
-
channels:
|
|
45
|
+
channels: BoxelSceneAnimationChannel[];
|
|
46
46
|
clip: THREEType.AnimationClip;
|
|
47
47
|
}
|
|
48
|
-
export interface
|
|
48
|
+
export interface BoxelSceneResult {
|
|
49
49
|
/**
|
|
50
50
|
* Root object containing the full entity mesh hierarchy.
|
|
51
51
|
*/
|
|
@@ -53,11 +53,11 @@ export interface EntitySceneResult {
|
|
|
53
53
|
/**
|
|
54
54
|
* Lookup for every node emitted into the scene.
|
|
55
55
|
*/
|
|
56
|
-
nodes: Map<string,
|
|
56
|
+
nodes: Map<string, BoxelSceneNodeMeta>;
|
|
57
57
|
/**
|
|
58
58
|
* Animation payload pre-bound to Three.js tracks.
|
|
59
59
|
*/
|
|
60
|
-
animations:
|
|
60
|
+
animations: BoxelSceneAnimation[];
|
|
61
61
|
/**
|
|
62
62
|
* Ready-to-use AnimationClip objects derived from the animation payload.
|
|
63
63
|
*/
|
|
@@ -78,7 +78,7 @@ export interface EntitySceneResult {
|
|
|
78
78
|
/**
|
|
79
79
|
* Controls which overlay helpers should be rendered for a target along with basic styling hints.
|
|
80
80
|
*/
|
|
81
|
-
export interface
|
|
81
|
+
export interface BoxelOverlayOptions {
|
|
82
82
|
/**
|
|
83
83
|
* Render the entity/world origin helper.
|
|
84
84
|
*/
|
|
@@ -104,7 +104,7 @@ export interface EntityOverlayOptions {
|
|
|
104
104
|
*/
|
|
105
105
|
dashed?: boolean;
|
|
106
106
|
}
|
|
107
|
-
export interface
|
|
107
|
+
export interface BoxelOverlayHandles {
|
|
108
108
|
origin?: THREEType.Object3D;
|
|
109
109
|
bounds?: THREEType.Object3D[];
|
|
110
110
|
sockets?: THREEType.Object3D[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Material, VoxelBox } from '@playdrop/
|
|
1
|
+
import type { Material, VoxelBox } from '@playdrop/boxel-core';
|
|
2
2
|
export type FaceName = 'east' | 'west' | 'top' | 'bottom' | 'north' | 'south';
|
|
3
3
|
export declare const FACE_ORDER: ReadonlyArray<FaceName>;
|
|
4
4
|
export interface VoxelFaceGeometry {
|
|
@@ -37,7 +37,7 @@ function createPlaywrightLaunchError(tool, error) {
|
|
|
37
37
|
}
|
|
38
38
|
return error instanceof Error ? error : new Error(message);
|
|
39
39
|
}
|
|
40
|
-
test('
|
|
40
|
+
test('renderBoxelToDataURL produces a PNG data URL', async (t) => {
|
|
41
41
|
const { chromium } = await import('playwright-core');
|
|
42
42
|
const bundle = await bundleEntityWorker();
|
|
43
43
|
let browser = null;
|
|
@@ -45,7 +45,7 @@ test('renderEntityToDataURL produces a PNG data URL', async (t) => {
|
|
|
45
45
|
browser = await chromium.launch({ headless: true, args: ['--no-sandbox'], chromiumSandbox: false });
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
48
|
-
const launchError = createPlaywrightLaunchError('
|
|
48
|
+
const launchError = createPlaywrightLaunchError('boxel-three-test', error);
|
|
49
49
|
t.skip(launchError.message);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -62,7 +62,7 @@ test('renderEntityToDataURL produces a PNG data URL', async (t) => {
|
|
|
62
62
|
try {
|
|
63
63
|
await page.setContent('<canvas id="viewport"></canvas>', { waitUntil: 'domcontentloaded' });
|
|
64
64
|
await page.addScriptTag({ type: 'module', content: bundle });
|
|
65
|
-
await page.waitForFunction(() => typeof window.
|
|
65
|
+
await page.waitForFunction(() => typeof window.boxelExport !== 'undefined');
|
|
66
66
|
const minimalEntity = {
|
|
67
67
|
id: 'render-test',
|
|
68
68
|
geometry: {
|
|
@@ -93,7 +93,7 @@ test('renderEntityToDataURL produces a PNG data URL', async (t) => {
|
|
|
93
93
|
patterns: [],
|
|
94
94
|
animations: [],
|
|
95
95
|
};
|
|
96
|
-
const dataUrl = await page.evaluate(model => window.
|
|
96
|
+
const dataUrl = await page.evaluate(model => window.boxelExport.renderBoxel(model, {
|
|
97
97
|
mode: 'hierarchical',
|
|
98
98
|
width: 512,
|
|
99
99
|
height: 512,
|
package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.d.ts
RENAMED
|
@@ -11,9 +11,9 @@ interface RenderEntityOptions extends ExportEntityOptions {
|
|
|
11
11
|
}
|
|
12
12
|
declare global {
|
|
13
13
|
interface Window {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
boxelExport?: {
|
|
15
|
+
exportBoxel(modelJson: unknown, options?: ExportEntityOptions): Promise<string>;
|
|
16
|
+
renderBoxel(modelJson: unknown, options?: RenderEntityOptions): Promise<string>;
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
}
|
package/node_modules/@playdrop/{entity-three → boxel-three}/dist/test/fixtures/render-worker.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
|
|
3
|
-
import { exportModelToGLB,
|
|
4
|
-
import {
|
|
3
|
+
import { exportModelToGLB, renderBoxelToDataURL } from '../../src/index.js';
|
|
4
|
+
import { parseBoxel } from '@playdrop/boxel-core';
|
|
5
5
|
function arrayBufferToBase64(buffer) {
|
|
6
6
|
const bytes = new Uint8Array(buffer);
|
|
7
7
|
const chunkSize = 0x8000;
|
|
@@ -29,8 +29,8 @@ function getRenderer() {
|
|
|
29
29
|
});
|
|
30
30
|
return cachedRenderer;
|
|
31
31
|
}
|
|
32
|
-
async function
|
|
33
|
-
const model =
|
|
32
|
+
async function exportBoxel(modelJson, options) {
|
|
33
|
+
const model = parseBoxel(modelJson);
|
|
34
34
|
const blob = await exportModelToGLB({
|
|
35
35
|
THREE,
|
|
36
36
|
GLTFExporterCtor: GLTFExporter,
|
|
@@ -41,11 +41,11 @@ async function exportEntity(modelJson, options) {
|
|
|
41
41
|
const arrayBuffer = await blob.arrayBuffer();
|
|
42
42
|
return arrayBufferToBase64(arrayBuffer);
|
|
43
43
|
}
|
|
44
|
-
async function
|
|
45
|
-
const model =
|
|
44
|
+
async function renderBoxel(modelJson, options) {
|
|
45
|
+
const model = parseBoxel(modelJson);
|
|
46
46
|
const renderer = getRenderer();
|
|
47
47
|
renderer.setPixelRatio(1);
|
|
48
|
-
return
|
|
48
|
+
return renderBoxelToDataURL({
|
|
49
49
|
THREE,
|
|
50
50
|
renderer,
|
|
51
51
|
entity: model,
|
|
@@ -57,7 +57,7 @@ async function renderEntity(modelJson, options) {
|
|
|
57
57
|
background: options?.background ?? null,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
window.
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
window.boxelExport = {
|
|
61
|
+
exportBoxel,
|
|
62
|
+
renderBoxel,
|
|
63
63
|
};
|
|
@@ -5,9 +5,9 @@ import * as THREE from 'three';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { readFile } from 'node:fs/promises';
|
|
8
|
-
import {
|
|
8
|
+
import { parseBoxel } from '@playdrop/boxel-core';
|
|
9
9
|
import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';
|
|
10
|
-
import {
|
|
10
|
+
import { createBoxelSceneGraph, exportModelToGLB } from '../src/exporters/glb.js';
|
|
11
11
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
const fixture = (...segments) => path.resolve(HERE, '../../test/fixtures', ...segments);
|
|
13
13
|
if (typeof globalThis.FileReader === 'undefined') {
|
|
@@ -55,11 +55,11 @@ if (typeof globalThis.FileReader === 'undefined') {
|
|
|
55
55
|
}
|
|
56
56
|
async function loadEntity(relativePath) {
|
|
57
57
|
const raw = await readFile(fixture(relativePath), 'utf-8');
|
|
58
|
-
return
|
|
58
|
+
return parseBoxel(JSON.parse(raw));
|
|
59
59
|
}
|
|
60
|
-
test('
|
|
60
|
+
test('createBoxelSceneGraph skinned mode exposes skinned mesh and bones', async () => {
|
|
61
61
|
const entity = await loadEntity('entity-connect.json');
|
|
62
|
-
const graph =
|
|
62
|
+
const graph = createBoxelSceneGraph({ THREE, model: entity, mode: 'skinned' });
|
|
63
63
|
try {
|
|
64
64
|
assert.ok(graph.root instanceof THREE.Object3D, 'root should be Object3D');
|
|
65
65
|
const skinnedMesh = graph.root.children.find(child => child instanceof THREE.SkinnedMesh);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createBoxelScene, createBoxelNodeScene, attachBoxelOverlays, } from '../src/index.js';
|
|
4
|
+
test('boxel-three exposes renderer entry points', () => {
|
|
5
|
+
assert.equal(typeof createBoxelScene, 'function');
|
|
6
|
+
assert.equal(typeof createBoxelNodeScene, 'function');
|
|
7
|
+
assert.equal(typeof attachBoxelOverlays, 'function');
|
|
8
|
+
});
|
|
@@ -5,13 +5,13 @@ import * as THREE from 'three';
|
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
7
|
import { readFile } from 'node:fs/promises';
|
|
8
|
-
import {
|
|
8
|
+
import { parseBoxel } from '@playdrop/boxel-core';
|
|
9
9
|
import { instantiateEntityObject3D, } from '../src/instantiate.js';
|
|
10
10
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
const fixture = (...segments) => path.resolve(HERE, '../../test/fixtures', ...segments);
|
|
12
12
|
async function loadEntity(relativePath) {
|
|
13
13
|
const raw = await readFile(fixture(relativePath), 'utf-8');
|
|
14
|
-
return
|
|
14
|
+
return parseBoxel(JSON.parse(raw));
|
|
15
15
|
}
|
|
16
16
|
function dispose(result) {
|
|
17
17
|
result.dispose();
|