@fps-games/editor 0.1.6-beta.1 → 0.1.7-beta.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/dist/agent-bridge/capabilities/assets.d.ts +8 -0
- package/dist/agent-bridge/capabilities/assets.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/assets.js +226 -0
- package/dist/agent-bridge/capabilities/assets.js.map +1 -0
- package/dist/agent-bridge/capabilities/editor-state.d.ts +5 -0
- package/dist/agent-bridge/capabilities/editor-state.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/editor-state.js +72 -0
- package/dist/agent-bridge/capabilities/editor-state.js.map +1 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts +4 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.js +87 -0
- package/dist/agent-bridge/capabilities/host-lifecycle.js.map +1 -0
- package/dist/agent-bridge/capabilities/prefabs.d.ts +5 -0
- package/dist/agent-bridge/capabilities/prefabs.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/prefabs.js +735 -0
- package/dist/agent-bridge/capabilities/prefabs.js.map +1 -0
- package/dist/agent-bridge/capabilities/scene-objects.d.ts +9 -0
- package/dist/agent-bridge/capabilities/scene-objects.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/scene-objects.js +394 -0
- package/dist/agent-bridge/capabilities/scene-objects.js.map +1 -0
- package/dist/agent-bridge/capabilities/selection.d.ts +5 -0
- package/dist/agent-bridge/capabilities/selection.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/selection.js +57 -0
- package/dist/agent-bridge/capabilities/selection.js.map +1 -0
- package/dist/agent-bridge/capabilities/shadows.d.ts +5 -0
- package/dist/agent-bridge/capabilities/shadows.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/shadows.js +1876 -0
- package/dist/agent-bridge/capabilities/shadows.js.map +1 -0
- package/dist/agent-bridge/capabilities/transform.d.ts +5 -0
- package/dist/agent-bridge/capabilities/transform.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/transform.js +162 -0
- package/dist/agent-bridge/capabilities/transform.js.map +1 -0
- package/dist/agent-bridge/capabilities/ui-regions.d.ts +4 -0
- package/dist/agent-bridge/capabilities/ui-regions.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/ui-regions.js +168 -0
- package/dist/agent-bridge/capabilities/ui-regions.js.map +1 -0
- package/dist/agent-bridge/capabilities/viewport.d.ts +5 -0
- package/dist/agent-bridge/capabilities/viewport.d.ts.map +1 -0
- package/dist/agent-bridge/capabilities/viewport.js +407 -0
- package/dist/agent-bridge/capabilities/viewport.js.map +1 -0
- package/dist/agent-bridge/capability-sources.d.ts +6 -0
- package/dist/agent-bridge/capability-sources.d.ts.map +1 -0
- package/dist/agent-bridge/capability-sources.js +26 -0
- package/dist/agent-bridge/capability-sources.js.map +1 -0
- package/dist/agent-bridge/diagnostics.d.ts +12 -0
- package/dist/agent-bridge/diagnostics.d.ts.map +1 -0
- package/dist/agent-bridge/diagnostics.js +45 -0
- package/dist/agent-bridge/diagnostics.js.map +1 -0
- package/dist/agent-bridge/index.d.ts +5 -0
- package/dist/agent-bridge/index.d.ts.map +1 -0
- package/dist/agent-bridge/index.js +5 -0
- package/dist/agent-bridge/index.js.map +1 -0
- package/dist/agent-bridge/register.d.ts +4 -0
- package/dist/agent-bridge/register.d.ts.map +1 -0
- package/dist/agent-bridge/register.js +908 -0
- package/dist/agent-bridge/register.js.map +1 -0
- package/dist/agent-bridge/shared.d.ts +189 -0
- package/dist/agent-bridge/shared.d.ts.map +1 -0
- package/dist/agent-bridge/shared.js +39 -0
- package/dist/agent-bridge/shared.js.map +1 -0
- package/dist/agent-bridge/source-types.d.ts +90 -0
- package/dist/agent-bridge/source-types.d.ts.map +1 -0
- package/dist/agent-bridge/source-types.js +2 -0
- package/dist/agent-bridge/source-types.js.map +1 -0
- package/dist/build-info.json +17 -17
- package/dist/local-editor-agent-bridge-transport.d.ts +95 -0
- package/dist/local-editor-agent-bridge-transport.d.ts.map +1 -0
- package/dist/local-editor-agent-bridge-transport.js +340 -0
- package/dist/local-editor-agent-bridge-transport.js.map +1 -0
- package/dist/local-editor-agent-bridge.d.ts +2 -0
- package/dist/local-editor-agent-bridge.d.ts.map +1 -0
- package/dist/local-editor-agent-bridge.js +2 -0
- package/dist/local-editor-agent-bridge.js.map +1 -0
- package/dist/local-editor-harness.d.ts +26 -2
- package/dist/local-editor-harness.d.ts.map +1 -1
- package/dist/local-editor-harness.js +773 -75
- package/dist/local-editor-harness.js.map +1 -1
- package/dist/playable-babylon-rendering.js +20 -0
- package/dist/playable-babylon-rendering.js.map +1 -1
- package/dist/playable-local-editor-host.d.ts +5 -0
- package/dist/playable-local-editor-host.d.ts.map +1 -1
- package/dist/playable-local-editor-host.js +2 -0
- package/dist/playable-local-editor-host.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js +6 -4
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/blob-shadow-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js +103 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-shaders.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js +330 -27
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/planar-shadow-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js +159 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-artifact-system.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js +8 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/static-projected-shadow-baker.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts +53 -2
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.d.ts.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js +1 -0
- package/node_modules/@fps-games/babylon-renderer/dist/shadows/types.js.map +1 -1
- package/node_modules/@fps-games/babylon-renderer/package.json +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts +30 -0
- package/node_modules/@fps-games/editor-babylon/dist/projection.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/projection.js +346 -11
- package/node_modules/@fps-games/editor-babylon/dist/projection.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts +11 -0
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js +113 -29
- package/node_modules/@fps-games/editor-babylon/dist/scene-view-camera-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts +13 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js +543 -3
- package/node_modules/@fps-games/editor-babylon/dist/shadow-preview-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-babylon/package.json +5 -5
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts +5 -2
- package/node_modules/@fps-games/editor-browser/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js +3 -1
- package/node_modules/@fps-games/editor-browser/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-context-menu.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js +7 -9
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-actions.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js +2 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-attach-dialog.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts +21 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js +75 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-command-adapter.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js +288 -71
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-controller.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts +5 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js +92 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-scope.js.map +1 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts +3 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js +22 -7
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-tree.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts +4 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js +21 -14
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-hierarchy-view.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts +19 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js +79 -39
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-prefab-stage.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js +2 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-primitives.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts +68 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts +2 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js +10 -0
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui-workbench.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts +3 -2
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js +401 -241
- package/node_modules/@fps-games/editor-browser/dist/local-editor-ui.js.map +1 -1
- package/node_modules/@fps-games/editor-browser/package.json +3 -3
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts +18 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js +102 -0
- package/node_modules/@fps-games/editor-core/dist/agent-bridge.js.map +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.d.ts +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/index.js +1 -0
- package/node_modules/@fps-games/editor-core/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-core/dist/viewport-tools.js.map +1 -1
- package/node_modules/@fps-games/editor-core/package.json +2 -2
- package/node_modules/@fps-games/editor-forge-play/package.json +2 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js +9 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/config.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js +89 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/generated-module.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts +18 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js +121 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/identity.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts +27 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js +782 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/metadata.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/node.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts +80 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js +600 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/registry.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts +51 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-database/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts +0 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js +4 -42
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/document.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js +2 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/placement.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/asset-placement/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts +42 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js +612 -8
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/helpers.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts +42 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/document/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js +16 -9
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/schema.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js +28 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/field-schema/validators.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts +82 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js +396 -22
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/document-sections.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js +0 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/inspector/validation.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts +29 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js +143 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/lighting-debug/math.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js +99 -11
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/field-patch.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js +4 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/reducer.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js +19 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/mutation/transform.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js +19 -3
- package/node_modules/@fps-games/editor-playable-sdk/dist/rendering-profile/panel.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts +1 -2
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js +0 -14
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/assets.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts +1 -7
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js +3 -32
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/import-plan.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js +16 -32
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/nodes.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts +5 -22
- package/node_modules/@fps-games/editor-playable-sdk/dist/runtime-preview/types.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js +996 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/compiler.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts +152 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js +2 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-compiler/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js +4 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/scene-source/protocol.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js +224 -12
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/descriptors.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js +158 -50
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/inspector.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js +45 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/serialized-property/patch.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/index.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts +21 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js +158 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/legacy.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts +5 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js +83 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/quality.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts +35 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js +363 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/resolver.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts +105 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js +6 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/shadow-system/types.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js +44 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/static-shadows/artifact.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts +26 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js +105 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/asset-authoring.js.map +1 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js +3 -0
- package/node_modules/@fps-games/editor-playable-sdk/dist/vite/index.js.map +1 -1
- package/node_modules/@fps-games/editor-playable-sdk/package.json +3 -3
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts +1127 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js +2180 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-bridge.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts +68 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.d.ts.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js +23 -0
- package/node_modules/@fps-games/editor-protocol/dist/agent-trace.js.map +1 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts +2 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@fps-games/editor-protocol/dist/index.js +2 -0
- package/node_modules/@fps-games/editor-protocol/dist/index.js.map +1 -1
- package/node_modules/@fps-games/editor-protocol/package.json +1 -1
- package/package.json +8 -8
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createEditorSession, createInspectorRegistry, DEFAULT_EDITOR_TRANSFORM_OPERATION_SETTINGS, DEFAULT_EDITOR_VIEWPORT_TOOL_STATE, createEmptyEditorViewportSpatialOverlayState, cloneEditorTransformSnapshot as cloneCoreEditorTransformSnapshot, composeEditorTransformMatrix, editorTransformMatricesAlmostEqual, cloneEditorViewportToolState, cloneEditorViewportSpatialOverlayState, aggregateInspectorObjectsToMultiObject, createInspectorEditPayload, compareInspectorSections, computeEditorTransformActionTargets, mergeInspectorSections, isEditorTransformTrsSnapshot, normalizeEditorTransformConstraint, readEditorTransformPosition, resolveEditorSelectionCommand, serializedMultiObjectToInspectorObject, serializedObjectToInspectorObject, validateSceneGraphDelete, validateSceneGraphDrop, validateSceneGraphGroupSelection, validateSceneGraphMove, validateSceneGraphRename, } from '@fps-games/editor-core';
|
|
1
|
+
import { createEditorSession, createEditorAgentBridge, createInspectorRegistry, DEFAULT_EDITOR_TRANSFORM_OPERATION_SETTINGS, DEFAULT_EDITOR_VIEWPORT_TOOL_STATE, createEmptyEditorViewportSpatialOverlayState, cloneEditorTransformSnapshot as cloneCoreEditorTransformSnapshot, composeEditorTransformMatrix, editorTransformMatricesAlmostEqual, cloneEditorViewportToolState, cloneEditorViewportSpatialOverlayState, aggregateInspectorObjectsToMultiObject, createInspectorEditPayload, compareInspectorSections, computeEditorTransformActionTargets, mergeInspectorSections, isEditorTransformTrsSnapshot, normalizeEditorTransformConstraint, readEditorTransformPosition, resolveEditorSelectionCommand, serializedMultiObjectToInspectorObject, serializedObjectToInspectorObject, validateSceneGraphDelete, validateSceneGraphDrop, validateSceneGraphGroupSelection, validateSceneGraphMove, validateSceneGraphRename, } from '@fps-games/editor-core';
|
|
2
|
+
import {} from '@fps-games/editor-protocol';
|
|
2
3
|
import { createLocalEditorBrowserUi, toTransformOperationPolicyStatusLabel, } from '@fps-games/editor-browser';
|
|
3
4
|
import { createBabylonEnvironmentTextureController, createBabylonDefaultPostProcessPipelineController, } from '@fps-games/babylon-renderer';
|
|
4
5
|
import { createBabylonEditorProjection, createBabylonEditorMarkerOverlayController, createBabylonMarkerOverlayProjectionAdapter, createBabylonEditorWorld, createBabylonPrefabComparisonPreviewController, createBabylonProjectionSelectionController, createBabylonSceneCameraPreviewController, createBabylonSceneViewCameraController, createBabylonSceneViewInputController, createBabylonSceneViewMeasurementController, createBabylonSceneViewSpatialOverlayController, createBabylonEditorShadowPreviewController, createBabylonTransformGizmoController, createBabylonEditorPerformanceMonitor, focusEditorViewportSelection, } from '@fps-games/editor-babylon';
|
|
@@ -7,6 +8,9 @@ import { createPlayableBabylonOutlineInspectorSection, createPlayableBabylonOutl
|
|
|
7
8
|
import { createLocalEditorViewportRenderCoordinator, } from './local-editor-viewport-render-coordinator.js';
|
|
8
9
|
import { createLocalEditorSceneViewInteractionRuntime, } from './local-editor-scene-view-interaction-runtime.js';
|
|
9
10
|
import { cloneLocalEditorPerformanceStats, countLocalEditorAuthoredObjects, createLocalEditorPerformanceStats, LOCAL_EDITOR_PERFORMANCE_MONITOR_REASON, } from './local-editor-performance-stats.js';
|
|
11
|
+
import { registerLocalEditorAgentBridgeCapabilities } from './local-editor-agent-bridge.js';
|
|
12
|
+
import { createLocalEditorAgentBridgeCapabilitySources, } from './agent-bridge/capability-sources.js';
|
|
13
|
+
import { createDisabledLocalEditorAgentBridgeTransportStatus, createLocalEditorAgentBridgeWebSocketTransportFromQuery, } from './local-editor-agent-bridge-transport.js';
|
|
10
14
|
import { createMarkerGraphHierarchyItems, createMarkerGraphInspectorObject, createMarkerGraphRootInspectorObject, createMarkerPanelState, createMarkerRelationCommand, createMarkerRelationCreateManyCommand, createMarkerRelationDeleteConnectedCommand, createMarkerRelationReverseCommand, createMarkerGraphPatchFromInspectorEdit, findSpatialMarkerById, getSpatialMarkerDirectRelations, isMarkerGraphHierarchyId, isMarkerGraphHierarchyRootRowId, isSpatialMarkerBackedByHierarchyRow, isSpatialMarkerHierarchyVisible, readMarkerGraphHierarchyMarkerIdForGraph, readSpatialMarkerIdFromHierarchySelection, } from './local-editor-marker-graph.js';
|
|
11
15
|
const BATCH_EDIT_REQUIRES_MULTI_PATCH_REASON = 'Batch edit requires multi-property patch support.';
|
|
12
16
|
const LARGE_SELECTION_THRESHOLD = 200;
|
|
@@ -74,6 +78,10 @@ export function createLocalEditorHarness(options) {
|
|
|
74
78
|
grid: null,
|
|
75
79
|
gridVisible: true,
|
|
76
80
|
projection: null,
|
|
81
|
+
previewVisibility: {
|
|
82
|
+
overrides: {},
|
|
83
|
+
isolatedObjectIds: [],
|
|
84
|
+
},
|
|
77
85
|
markerOverlay: null,
|
|
78
86
|
markerGraphVisibility: createDefaultMarkerGraphVisibilityState(),
|
|
79
87
|
activeMarkerRelationId: null,
|
|
@@ -123,6 +131,10 @@ export function createLocalEditorHarness(options) {
|
|
|
123
131
|
statusDetails: '',
|
|
124
132
|
renderingAction: null,
|
|
125
133
|
summary: '',
|
|
134
|
+
agentBridge: createEditorAgentBridge(),
|
|
135
|
+
unregisterAgentBridgeCapabilities: null,
|
|
136
|
+
agentBridgeTransport: null,
|
|
137
|
+
agentBridgeStatus: createDisabledLocalEditorAgentBridgeTransportStatus(),
|
|
126
138
|
};
|
|
127
139
|
let harness;
|
|
128
140
|
const ui = createLocalEditorBrowserUi({
|
|
@@ -172,7 +184,7 @@ export function createLocalEditorHarness(options) {
|
|
|
172
184
|
harness.render();
|
|
173
185
|
},
|
|
174
186
|
onSelectPrefabStageItem: (itemId) => {
|
|
175
|
-
if (
|
|
187
|
+
if (selectPrefabStageItemWithPreviewSync(state, options, itemId))
|
|
176
188
|
harness.render();
|
|
177
189
|
},
|
|
178
190
|
onSelectHierarchyItem: (input) => {
|
|
@@ -347,7 +359,7 @@ export function createLocalEditorHarness(options) {
|
|
|
347
359
|
harness.render();
|
|
348
360
|
},
|
|
349
361
|
onViewportViewPresetChange: (preset) => {
|
|
350
|
-
if (setViewportViewPreset(state, preset))
|
|
362
|
+
if (setViewportViewPreset(state, options, preset))
|
|
351
363
|
harness.render();
|
|
352
364
|
},
|
|
353
365
|
onViewportProjectionModeChange: (mode) => {
|
|
@@ -395,7 +407,7 @@ export function createLocalEditorHarness(options) {
|
|
|
395
407
|
},
|
|
396
408
|
},
|
|
397
409
|
onFocusSelection: () => {
|
|
398
|
-
if (focusSelectedProjection(state))
|
|
410
|
+
if (focusSelectedProjection(state, options))
|
|
399
411
|
harness.render();
|
|
400
412
|
},
|
|
401
413
|
onCancelEditorIntent: () => {
|
|
@@ -428,7 +440,7 @@ export function createLocalEditorHarness(options) {
|
|
|
428
440
|
render() {
|
|
429
441
|
syncViewportCameraState(state);
|
|
430
442
|
syncViewportMeasurementState(state);
|
|
431
|
-
syncViewportSpatialOverlay(state);
|
|
443
|
+
syncViewportSpatialOverlay(state, options);
|
|
432
444
|
ui.update(createUiState(state, options));
|
|
433
445
|
syncPrefabComparisonPreviewSurfaces(state, ui);
|
|
434
446
|
syncSceneCameraPreview(state, options);
|
|
@@ -445,6 +457,9 @@ export function createLocalEditorHarness(options) {
|
|
|
445
457
|
getHostServices() {
|
|
446
458
|
return options.hostServices ?? null;
|
|
447
459
|
},
|
|
460
|
+
getAgentBridge() {
|
|
461
|
+
return state.agentBridge;
|
|
462
|
+
},
|
|
448
463
|
getWorkingDocument() {
|
|
449
464
|
return state.session?.getState().workingDocument ?? null;
|
|
450
465
|
},
|
|
@@ -598,11 +613,102 @@ export function createLocalEditorHarness(options) {
|
|
|
598
613
|
await runGameFromEditor('discard');
|
|
599
614
|
},
|
|
600
615
|
dispose() {
|
|
616
|
+
state.agentBridgeTransport?.dispose();
|
|
617
|
+
state.agentBridgeTransport = null;
|
|
618
|
+
state.unregisterAgentBridgeCapabilities?.();
|
|
619
|
+
state.unregisterAgentBridgeCapabilities = null;
|
|
601
620
|
disposeEditorWorld(state);
|
|
602
621
|
state.session = null;
|
|
603
622
|
ui.dispose();
|
|
604
623
|
},
|
|
605
624
|
};
|
|
625
|
+
const agentBridgeCapabilitySourceOperations = {
|
|
626
|
+
createAssetFromAssetId: (assetId, createOptions) => harness.createAssetFromAssetId(assetId, createOptions),
|
|
627
|
+
getPrefabStage: () => summarizeAgentBridgePrefabStage(state, options),
|
|
628
|
+
getPrefabStageDetails: () => summarizeAgentBridgePrefabStageDetails(state, options),
|
|
629
|
+
openPrefabStage: (input) => {
|
|
630
|
+
const previousStage = summarizeAgentBridgePrefabStage(state, options);
|
|
631
|
+
const opened = enterPrefabStage(state, options, {
|
|
632
|
+
actionId: 'asset.edit-prefab',
|
|
633
|
+
assetId: input.assetId,
|
|
634
|
+
browserAssetId: input.browserAssetId,
|
|
635
|
+
assetKind: 'prefab',
|
|
636
|
+
});
|
|
637
|
+
const stage = summarizeAgentBridgePrefabStage(state, options);
|
|
638
|
+
if (!opened || !stage)
|
|
639
|
+
return null;
|
|
640
|
+
const alreadyOpen = isSameAgentBridgePrefabStage(previousStage, stage);
|
|
641
|
+
return {
|
|
642
|
+
opened: !alreadyOpen,
|
|
643
|
+
alreadyOpen,
|
|
644
|
+
prefab: createAgentBridgePrefabSummaryFromStage(stage),
|
|
645
|
+
stage,
|
|
646
|
+
status: state.status,
|
|
647
|
+
};
|
|
648
|
+
},
|
|
649
|
+
exitPrefabStage: () => {
|
|
650
|
+
const previousStage = summarizeAgentBridgePrefabStage(state, options);
|
|
651
|
+
const exited = exitPrefabStage(state, options);
|
|
652
|
+
return {
|
|
653
|
+
exited,
|
|
654
|
+
wasOpen: !!previousStage,
|
|
655
|
+
...(previousStage ? { previousStage } : {}),
|
|
656
|
+
status: exited ? state.status : 'No Prefab stage is open.',
|
|
657
|
+
};
|
|
658
|
+
},
|
|
659
|
+
selectPrefabStageItem: itemId => selectPrefabStageItemWithPreviewSync(state, options, itemId),
|
|
660
|
+
runPrefabStageAssetAction: input => patchBrowserAssetAction(state, options, input),
|
|
661
|
+
getHierarchy: () => createUiState(state, options).hierarchy,
|
|
662
|
+
dispatchSelectionCommand: (command, shouldRenderUi = false) => dispatchSelectionCommand(state, options, command, shouldRenderUi ? () => harness.render() : undefined),
|
|
663
|
+
focusProjectionNode: objectId => frameViewportProjectionNode(state, objectId),
|
|
664
|
+
focusSelectedProjection: () => frameSelectedViewportProjection(state, options),
|
|
665
|
+
syncViewportCameraState: () => syncViewportCameraState(state),
|
|
666
|
+
requestSceneFrame: reason => requestEditorSceneFrame(state, reason),
|
|
667
|
+
cloneTransformSnapshot: transform => cloneEditorTransformSnapshot(transform),
|
|
668
|
+
cancelActiveOperation: () => cancelActiveOperation(state),
|
|
669
|
+
withProjectionImpact,
|
|
670
|
+
resolveProjectionImpact,
|
|
671
|
+
createReprojectProjectionImpact,
|
|
672
|
+
createTransformProjectionImpact,
|
|
673
|
+
createKnownCreatedReprojectProjectionImpact,
|
|
674
|
+
createDeletedNodeProjectionImpact,
|
|
675
|
+
reprojectProjectionForChangedIds: (document, changedIds) => reprojectProjectionForChangedIds(state, options, document, changedIds),
|
|
676
|
+
syncProjectionForChangedIds: (document, changedIds) => syncProjectionForChangedIds(state, options, document, changedIds),
|
|
677
|
+
rebuildProjectionFromDocument: (document, selection) => rebuildProjectionFromDocument(state, options, document, selection),
|
|
678
|
+
sanitizeSelection: (document, selection) => sanitizeSelection(state, options, document, selection),
|
|
679
|
+
summarizeDocument: (document, source) => summarizeDocument(options, document, source),
|
|
680
|
+
invalidateStaticShadowArtifact: () => {
|
|
681
|
+
if (!state.shadowPreview?.invalidateStaticProjectedArtifact)
|
|
682
|
+
return false;
|
|
683
|
+
state.shadowPreview.invalidateStaticProjectedArtifact();
|
|
684
|
+
requestEditorSceneFrame(state, 'agent-shadow-static-invalidate');
|
|
685
|
+
return true;
|
|
686
|
+
},
|
|
687
|
+
getShadowPreviewDebugInfo: () => state.shadowPreview?.getDebugInfo?.() ?? null,
|
|
688
|
+
setShadowDebugOverlay: (items) => {
|
|
689
|
+
const overlayIds = state.projection?.setShadowDebugOverlay?.(items) ?? [];
|
|
690
|
+
requestEditorSceneFrame(state, 'agent-shadow-debug-overlay-set');
|
|
691
|
+
return overlayIds;
|
|
692
|
+
},
|
|
693
|
+
clearShadowDebugOverlay: () => {
|
|
694
|
+
const cleared = state.projection?.clearShadowDebugOverlay?.() ?? false;
|
|
695
|
+
if (cleared)
|
|
696
|
+
requestEditorSceneFrame(state, 'agent-shadow-debug-overlay-clear');
|
|
697
|
+
return cleared;
|
|
698
|
+
},
|
|
699
|
+
resolvePrefabStageProjectionNodeId: (nodeId) => {
|
|
700
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument;
|
|
701
|
+
return document ? resolvePrefabStageProjectionNodeIdForNode(state, options, document, nodeId) : null;
|
|
702
|
+
},
|
|
703
|
+
runRenderingAction: actionId => applyRenderingAction(state, options, { actionId }, () => harness.render()),
|
|
704
|
+
};
|
|
705
|
+
state.unregisterAgentBridgeCapabilities = registerLocalEditorAgentBridgeCapabilities(state.agentBridge, createLocalEditorAgentBridgeCapabilitySources(state, options, () => harness.render(), () => runExclusive(state, harness.render, () => harness.enterEditor()), agentBridgeCapabilitySourceOperations));
|
|
706
|
+
state.agentBridgeTransport = createLocalEditorAgentBridgeWebSocketTransportFromQuery(state.agentBridge, {
|
|
707
|
+
onStatusChange: agentBridgeStatus => {
|
|
708
|
+
state.agentBridgeStatus = agentBridgeStatus;
|
|
709
|
+
harness.render();
|
|
710
|
+
},
|
|
711
|
+
});
|
|
606
712
|
harness.render();
|
|
607
713
|
return harness;
|
|
608
714
|
}
|
|
@@ -632,6 +738,13 @@ export function mergeLocalEditorHarnessInspectorComponentSections(input) {
|
|
|
632
738
|
}),
|
|
633
739
|
};
|
|
634
740
|
}
|
|
741
|
+
function isAgentBridgeObjectSelectable(options, document, objectId, hierarchyItems) {
|
|
742
|
+
const inHierarchy = hierarchyItems.some(item => item.id === objectId);
|
|
743
|
+
const hasProjectionNode = !!options.documentAdapter.getProjectionNode(document, objectId);
|
|
744
|
+
if (!inHierarchy && !hasProjectionNode)
|
|
745
|
+
return false;
|
|
746
|
+
return isNodeSelectableInDocument(options, document, objectId);
|
|
747
|
+
}
|
|
635
748
|
function normalizeTransformConstraint(tool, constraint) {
|
|
636
749
|
return normalizeEditorTransformConstraint(tool, constraint) ?? 'axis';
|
|
637
750
|
}
|
|
@@ -667,7 +780,16 @@ function normalizePlacementMode(mode) {
|
|
|
667
780
|
return mode === 'ground' || mode === 'surface' ? mode : 'off';
|
|
668
781
|
}
|
|
669
782
|
function normalizeViewportViewPreset(preset) {
|
|
670
|
-
return preset === 'top'
|
|
783
|
+
return preset === 'top'
|
|
784
|
+
|| preset === 'bottom'
|
|
785
|
+
|| preset === 'front'
|
|
786
|
+
|| preset === 'back'
|
|
787
|
+
|| preset === 'left'
|
|
788
|
+
|| preset === 'right'
|
|
789
|
+
|| preset === 'iso'
|
|
790
|
+
|| preset === 'threeQuarterTop'
|
|
791
|
+
? preset
|
|
792
|
+
: 'perspective';
|
|
671
793
|
}
|
|
672
794
|
function normalizeViewportProjectionMode(mode) {
|
|
673
795
|
return mode === 'orthographic' ? 'orthographic' : 'perspective';
|
|
@@ -698,7 +820,7 @@ function cloneViewportMeasurement(measurement) {
|
|
|
698
820
|
label: measurement.label ? { ...measurement.label } : null,
|
|
699
821
|
};
|
|
700
822
|
}
|
|
701
|
-
function setViewportViewPreset(state, preset) {
|
|
823
|
+
function setViewportViewPreset(state, options, preset) {
|
|
702
824
|
if (state.sceneCameraPreviewEnabled) {
|
|
703
825
|
state.status = 'Viewport view unavailable during Scene Camera preview';
|
|
704
826
|
state.statusTone = 'warning';
|
|
@@ -707,8 +829,8 @@ function setViewportViewPreset(state, preset) {
|
|
|
707
829
|
return true;
|
|
708
830
|
}
|
|
709
831
|
const nextPreset = normalizeViewportViewPreset(preset);
|
|
710
|
-
const target = resolveViewportPresetTarget(state);
|
|
711
|
-
const radius = resolveViewportPresetRadius(state);
|
|
832
|
+
const target = resolveViewportPresetTarget(state, options);
|
|
833
|
+
const radius = resolveViewportPresetRadius(state, options);
|
|
712
834
|
const changed = state.sceneViewCamera?.setViewPreset(nextPreset, { target, radius }) ?? false;
|
|
713
835
|
if (!changed)
|
|
714
836
|
return false;
|
|
@@ -887,18 +1009,18 @@ function formatViewportMeasurementDistance(value) {
|
|
|
887
1009
|
const rounded = Math.abs(value) < 0.005 ? 0 : value;
|
|
888
1010
|
return rounded.toFixed(2).replace(/\.?0+$/, '');
|
|
889
1011
|
}
|
|
890
|
-
function resolveViewportPresetTarget(state) {
|
|
891
|
-
const selection = state
|
|
892
|
-
const activeId = selection
|
|
893
|
-
if (!activeId || selection
|
|
1012
|
+
function resolveViewportPresetTarget(state, options) {
|
|
1013
|
+
const selection = getCurrentPreviewSelection(state, options);
|
|
1014
|
+
const activeId = selection.activeId;
|
|
1015
|
+
if (!activeId || selection.selectedIds.length !== 1)
|
|
894
1016
|
return null;
|
|
895
1017
|
const bounds = state.projection?.getSelectionBounds([activeId]) ?? null;
|
|
896
1018
|
return bounds?.center ?? null;
|
|
897
1019
|
}
|
|
898
|
-
function resolveViewportPresetRadius(state) {
|
|
899
|
-
const selection = state
|
|
900
|
-
const activeId = selection
|
|
901
|
-
if (!activeId || selection
|
|
1020
|
+
function resolveViewportPresetRadius(state, options) {
|
|
1021
|
+
const selection = getCurrentPreviewSelection(state, options);
|
|
1022
|
+
const activeId = selection.activeId;
|
|
1023
|
+
if (!activeId || selection.selectedIds.length !== 1)
|
|
902
1024
|
return undefined;
|
|
903
1025
|
const bounds = state.projection?.getSelectionBounds([activeId]) ?? null;
|
|
904
1026
|
if (!bounds)
|
|
@@ -988,7 +1110,7 @@ async function createEditorWorld(state, options, renderUi, renderPreviewUi, upda
|
|
|
988
1110
|
logger: console,
|
|
989
1111
|
onProjectionReady(event) {
|
|
990
1112
|
if (state.prefabStage) {
|
|
991
|
-
|
|
1113
|
+
syncPrefabStageSelectionToProjection(state, options, `prefab-stage-projection-${event.nodeId}-ready-selection`);
|
|
992
1114
|
focusPrefabStagePreviewProjection(state, `prefab-stage-projection-${event.nodeId}-ready-focus`);
|
|
993
1115
|
scheduleProjectionShadowPreviewRebuild(state, `prefab-stage-projection-${event.nodeId}-ready-shadow`);
|
|
994
1116
|
viewportRenderCoordinator.invalidateScene(`prefab-stage-projection-${event.nodeId}-ready`);
|
|
@@ -1001,7 +1123,7 @@ async function createEditorWorld(state, options, renderUi, renderPreviewUi, upda
|
|
|
1001
1123
|
},
|
|
1002
1124
|
onProjectionBatchSettled(event) {
|
|
1003
1125
|
if (state.prefabStage) {
|
|
1004
|
-
|
|
1126
|
+
syncPrefabStageSelectionToProjection(state, options, `prefab-stage-projection-batch-${event.batchId}-settled-selection`);
|
|
1005
1127
|
focusPrefabStagePreviewProjection(state, `prefab-stage-projection-batch-${event.batchId}-settled-focus`);
|
|
1006
1128
|
scheduleProjectionShadowPreviewRebuild(state, `prefab-stage-projection-batch-${event.batchId}-settled`);
|
|
1007
1129
|
renderUi();
|
|
@@ -1080,26 +1202,48 @@ async function createEditorWorld(state, options, renderUi, renderPreviewUi, upda
|
|
|
1080
1202
|
renderUi();
|
|
1081
1203
|
},
|
|
1082
1204
|
onDuplicateDragStart(input) {
|
|
1205
|
+
if (state.prefabStage) {
|
|
1206
|
+
state.status = 'Duplicate drag is not available in Prefab Stage';
|
|
1207
|
+
state.statusTone = 'warning';
|
|
1208
|
+
state.statusToneStatus = state.status;
|
|
1209
|
+
state.statusDetails = 'Use prefab.node.createFromAsset or prefab.node.createPrimitive to add prefab nodes.';
|
|
1210
|
+
renderUi();
|
|
1211
|
+
return null;
|
|
1212
|
+
}
|
|
1083
1213
|
return beginDuplicateDrag(state, options, input);
|
|
1084
1214
|
},
|
|
1085
1215
|
});
|
|
1086
|
-
gizmo.setOperationSettings(state
|
|
1216
|
+
gizmo.setOperationSettings(getScopedTransformOperationSettings(state));
|
|
1087
1217
|
gizmo.setConstraint(state.transformConstraint);
|
|
1088
1218
|
const selectionController = createBabylonProjectionSelectionController({
|
|
1089
1219
|
scene: world.scene,
|
|
1090
1220
|
canvas,
|
|
1091
1221
|
projection: markerAwareProjection,
|
|
1092
1222
|
getTool: () => state.transformTool,
|
|
1093
|
-
getSelection: () => state.prefabStage
|
|
1094
|
-
|
|
1095
|
-
|
|
1223
|
+
getSelection: () => state.prefabStage
|
|
1224
|
+
? getCurrentPrefabStageProjectionSelection(state, options)
|
|
1225
|
+
: state.session?.getSelection() ?? EMPTY_EDITOR_SELECTION,
|
|
1226
|
+
isSelectable: (nodeId) => state.prefabStage
|
|
1227
|
+
? isPrefabStageProjectionSelectable(state, options, nodeId)
|
|
1228
|
+
: isDocumentNodeSelectable(state, options, nodeId),
|
|
1229
|
+
isLocked: (nodeId) => state.prefabStage
|
|
1230
|
+
? !isPrefabStageProjectionSelectable(state, options, nodeId)
|
|
1231
|
+
: isDocumentNodeLocked(state, options, nodeId),
|
|
1096
1232
|
isOperationBlocked: () => state.gizmo?.getState().dragPhase === 'dragging',
|
|
1097
1233
|
onSelectionCommand(command) {
|
|
1098
|
-
if (state.prefabStage)
|
|
1234
|
+
if (state.prefabStage) {
|
|
1235
|
+
if (dispatchPrefabStageProjectionSelectionCommand(state, options, command))
|
|
1236
|
+
render();
|
|
1099
1237
|
return;
|
|
1238
|
+
}
|
|
1100
1239
|
dispatchSelectionCommand(state, options, command, render);
|
|
1101
1240
|
},
|
|
1102
1241
|
onFocusIntent(nodeId) {
|
|
1242
|
+
if (state.prefabStage) {
|
|
1243
|
+
if (focusPrefabStageProjectionNode(state, options, nodeId, 'prefab-stage-preview-focus-intent'))
|
|
1244
|
+
render();
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1103
1247
|
if (focusProjectionNode(state, nodeId))
|
|
1104
1248
|
render();
|
|
1105
1249
|
},
|
|
@@ -1285,6 +1429,7 @@ async function createEditorWorld(state, options, renderUi, renderPreviewUi, upda
|
|
|
1285
1429
|
state.resizeHandler = resize;
|
|
1286
1430
|
if (document) {
|
|
1287
1431
|
projection.projectNodes(resolveCurrentEditorProjectionNodes(state, options, document));
|
|
1432
|
+
applyPreviewVisibilityStateToProjection(state);
|
|
1288
1433
|
scheduleProjectionShadowPreviewRebuild(state, 'editor-world-initial-projection-shadow');
|
|
1289
1434
|
}
|
|
1290
1435
|
syncCurrentSelectionToSceneArtifacts(state, options, 'editor-world-initial-selection');
|
|
@@ -1440,7 +1585,7 @@ function requestEditorSceneFrame(state, reason) {
|
|
|
1440
1585
|
function requestEditorPreviewFrame(state, options, renderPreviewUi, reason) {
|
|
1441
1586
|
syncViewportCameraState(state);
|
|
1442
1587
|
syncViewportMeasurementState(state);
|
|
1443
|
-
syncViewportSpatialOverlay(state);
|
|
1588
|
+
syncViewportSpatialOverlay(state, options);
|
|
1444
1589
|
renderPreviewUi(createUiPreviewState(state, options));
|
|
1445
1590
|
requestEditorSceneFrame(state, reason);
|
|
1446
1591
|
}
|
|
@@ -1744,7 +1889,7 @@ function handleContextAction(state, options, action) {
|
|
|
1744
1889
|
label: 'Select Context Target',
|
|
1745
1890
|
})
|
|
1746
1891
|
: false;
|
|
1747
|
-
return focusSelectedProjection(state) || selectionChanged;
|
|
1892
|
+
return focusSelectedProjection(state, options) || selectionChanged;
|
|
1748
1893
|
}
|
|
1749
1894
|
if (action.action === 'rename')
|
|
1750
1895
|
return false;
|
|
@@ -2450,7 +2595,12 @@ function groupSceneGraphSelection(state, options, intent) {
|
|
|
2450
2595
|
return true;
|
|
2451
2596
|
}
|
|
2452
2597
|
function sanitizeSelection(state, options, document, selection) {
|
|
2453
|
-
const
|
|
2598
|
+
const documentHierarchy = options.documentAdapter.getHierarchyItems(document);
|
|
2599
|
+
const graph = options.documentAdapter.getMarkerGraph?.(document) ?? null;
|
|
2600
|
+
const hierarchy = graph
|
|
2601
|
+
? createMarkerGraphHierarchyItems(documentHierarchy, graph, createMarkerGraphHierarchyVisibility(state))
|
|
2602
|
+
: documentHierarchy;
|
|
2603
|
+
const selectedIds = selection.selectedIds.filter(id => isAgentBridgeObjectSelectable(options, document, id, hierarchy));
|
|
2454
2604
|
const activeId = selection.activeId && selectedIds.includes(selection.activeId)
|
|
2455
2605
|
? selection.activeId
|
|
2456
2606
|
: selectedIds[selectedIds.length - 1] ?? null;
|
|
@@ -2782,9 +2932,20 @@ function syncTransformGizmoToSceneArtifacts(state, reason, revision = state.edit
|
|
|
2782
2932
|
function syncTransformOperationSettingsToSceneArtifacts(state, reason, revision = state.editorStateRevision) {
|
|
2783
2933
|
if (!beginSceneArtifactSync(state, reason, revision))
|
|
2784
2934
|
return;
|
|
2785
|
-
state.gizmo?.setOperationSettings(state
|
|
2935
|
+
state.gizmo?.setOperationSettings(getScopedTransformOperationSettings(state));
|
|
2786
2936
|
requestEditorSceneFrame(state, reason);
|
|
2787
2937
|
}
|
|
2938
|
+
function getScopedTransformOperationSettings(state) {
|
|
2939
|
+
if (!state.prefabStage)
|
|
2940
|
+
return state.transformOperationSettings;
|
|
2941
|
+
return updateTransformOperationSettings(state.transformOperationSettings, {
|
|
2942
|
+
snap: {
|
|
2943
|
+
...state.transformOperationSettings.snap,
|
|
2944
|
+
enabled: false,
|
|
2945
|
+
},
|
|
2946
|
+
placementMode: 'off',
|
|
2947
|
+
});
|
|
2948
|
+
}
|
|
2788
2949
|
function beginSceneArtifactSync(state, reason, revision) {
|
|
2789
2950
|
if (revision < state.sceneArtifactRevision) {
|
|
2790
2951
|
return false;
|
|
@@ -3021,8 +3182,15 @@ function handleBrowserAssetAction(state, options, input) {
|
|
|
3021
3182
|
return true;
|
|
3022
3183
|
}
|
|
3023
3184
|
function handleInspectorAction(state, options, input) {
|
|
3024
|
-
if (!input.actionId.startsWith('prefab.'))
|
|
3025
|
-
|
|
3185
|
+
if (!input.actionId.startsWith('prefab.')) {
|
|
3186
|
+
const activeId = input.targetId ?? state.session?.getState().selection.activeId ?? null;
|
|
3187
|
+
const selectedIds = input.targetIds ?? (activeId ? [activeId] : []);
|
|
3188
|
+
return patchBrowserAssetAction(state, options, {
|
|
3189
|
+
actionId: input.actionId,
|
|
3190
|
+
fieldPath: input.path,
|
|
3191
|
+
value: input.params,
|
|
3192
|
+
}, { activeId, selectedIds });
|
|
3193
|
+
}
|
|
3026
3194
|
const assetId = readInspectorActionParamString(input, 'assetId');
|
|
3027
3195
|
const browserAssetId = readInspectorActionParamString(input, 'browserAssetId')
|
|
3028
3196
|
?? (assetId ? resolveBrowserAssetItemId(state, options, assetId) : null)
|
|
@@ -3083,7 +3251,8 @@ function enterPrefabStage(state, options, input) {
|
|
|
3083
3251
|
cancelActiveOperation(state);
|
|
3084
3252
|
const previousPrefabStage = state.prefabStage;
|
|
3085
3253
|
const asset = findAssetByResolvedId(state, options, assetId);
|
|
3086
|
-
const browserItem = findBrowserAssetItemByResolvedId(state, options, document, input.browserAssetId ?? assetId)
|
|
3254
|
+
const browserItem = findBrowserAssetItemByResolvedId(state, options, document, input.browserAssetId ?? assetId)
|
|
3255
|
+
?? (input.browserAssetId ? findBrowserAssetItemByResolvedId(state, options, document, assetId) : null);
|
|
3087
3256
|
const descriptor = options.documentAdapter.getPrefabStageDescriptor?.(document, {
|
|
3088
3257
|
assetId,
|
|
3089
3258
|
browserAssetId: input.browserAssetId,
|
|
@@ -3112,6 +3281,7 @@ function enterPrefabStage(state, options, input) {
|
|
|
3112
3281
|
state.statusToneStatus = state.status;
|
|
3113
3282
|
state.statusDetails = '';
|
|
3114
3283
|
rebuildProjectionFromDocument(state, options, document, EMPTY_EDITOR_SELECTION);
|
|
3284
|
+
syncTransformOperationSettingsToSceneArtifacts(state, 'prefab-stage-enter-operation-settings');
|
|
3115
3285
|
return true;
|
|
3116
3286
|
}
|
|
3117
3287
|
function exitPrefabStage(state, options) {
|
|
@@ -3128,6 +3298,7 @@ function exitPrefabStage(state, options) {
|
|
|
3128
3298
|
if (sessionState?.workingDocument) {
|
|
3129
3299
|
rebuildProjectionFromDocument(state, options, sessionState.workingDocument, sessionState.selection);
|
|
3130
3300
|
}
|
|
3301
|
+
syncTransformOperationSettingsToSceneArtifacts(state, 'prefab-stage-exit-operation-settings');
|
|
3131
3302
|
state.sceneCameraPreviewEnabled = restoreSceneCameraPreviewEnabled;
|
|
3132
3303
|
if (restoreSceneCameraPreviewEnabled)
|
|
3133
3304
|
syncSceneCameraPreview(state, options);
|
|
@@ -3148,6 +3319,168 @@ function selectPrefabStageItem(state, itemId) {
|
|
|
3148
3319
|
};
|
|
3149
3320
|
return true;
|
|
3150
3321
|
}
|
|
3322
|
+
function selectPrefabStageItemWithPreviewSync(state, options, itemId) {
|
|
3323
|
+
const changed = selectPrefabStageItem(state, itemId);
|
|
3324
|
+
if (changed)
|
|
3325
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection');
|
|
3326
|
+
return changed;
|
|
3327
|
+
}
|
|
3328
|
+
function getCurrentPrefabStageProjectionSelection(state, options) {
|
|
3329
|
+
const stage = state.prefabStage;
|
|
3330
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
3331
|
+
if (!stage || !document || !stage.selectedItemId)
|
|
3332
|
+
return EMPTY_EDITOR_SELECTION;
|
|
3333
|
+
const descriptor = resolvePrefabStageDescriptorForDocument(state, options, document) ?? stage.descriptor;
|
|
3334
|
+
const context = createPrefabStageContext(state, descriptor);
|
|
3335
|
+
const item = findPrefabStageStructureItemById(options.documentAdapter.getPrefabStageStructure?.(document, descriptor, context) ?? createFallbackPrefabStageStructure(descriptor), stage.selectedItemId);
|
|
3336
|
+
if (!item?.nodeId)
|
|
3337
|
+
return EMPTY_EDITOR_SELECTION;
|
|
3338
|
+
const projectionNodeId = resolvePrefabStageProjectionNodeIdForNode(state, options, document, item.nodeId);
|
|
3339
|
+
if (!projectionNodeId)
|
|
3340
|
+
return EMPTY_EDITOR_SELECTION;
|
|
3341
|
+
const target = resolvePrefabStagePreviewTarget(state, options, document, projectionNodeId);
|
|
3342
|
+
if (!target?.selectable)
|
|
3343
|
+
return EMPTY_EDITOR_SELECTION;
|
|
3344
|
+
return {
|
|
3345
|
+
selectedIds: [projectionNodeId],
|
|
3346
|
+
activeId: projectionNodeId,
|
|
3347
|
+
};
|
|
3348
|
+
}
|
|
3349
|
+
function syncPrefabStageSelectionToProjection(state, options, reason = 'prefab-stage-projection-selection', revision = state.editorStateRevision) {
|
|
3350
|
+
if (!state.prefabStage)
|
|
3351
|
+
return;
|
|
3352
|
+
if (!beginSceneArtifactSync(state, reason, revision))
|
|
3353
|
+
return;
|
|
3354
|
+
const projectionSelection = getCurrentPrefabStageProjectionSelection(state, options);
|
|
3355
|
+
state.projection?.syncSelection(projectionSelection);
|
|
3356
|
+
state.gizmo?.setSelection(getCurrentPrefabStageTransformGizmoSelection(state, options, projectionSelection));
|
|
3357
|
+
syncTransformGizmoToSceneArtifacts(state, reason, revision, false);
|
|
3358
|
+
}
|
|
3359
|
+
function getCurrentPrefabStageTransformGizmoSelection(state, options, selection = getCurrentPrefabStageProjectionSelection(state, options)) {
|
|
3360
|
+
const activeId = selection.activeId;
|
|
3361
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
3362
|
+
if (!activeId || !state.prefabStage || !document)
|
|
3363
|
+
return EMPTY_EDITOR_SELECTION;
|
|
3364
|
+
const target = resolvePrefabStagePreviewTarget(state, options, document, activeId);
|
|
3365
|
+
return target?.transformable ? selection : EMPTY_EDITOR_SELECTION;
|
|
3366
|
+
}
|
|
3367
|
+
function isPrefabStageProjectionSelectable(state, options, projectionNodeId) {
|
|
3368
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
3369
|
+
if (!state.prefabStage || !document)
|
|
3370
|
+
return false;
|
|
3371
|
+
return resolvePrefabStagePreviewTarget(state, options, document, projectionNodeId)?.selectable === true;
|
|
3372
|
+
}
|
|
3373
|
+
function dispatchPrefabStageProjectionSelectionCommand(state, options, command) {
|
|
3374
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
3375
|
+
if (!state.prefabStage || !document)
|
|
3376
|
+
return false;
|
|
3377
|
+
const currentProjectionSelection = getCurrentPrefabStageProjectionSelection(state, options);
|
|
3378
|
+
if (command.type === 'selection.clear') {
|
|
3379
|
+
if (state.prefabStage.selectedItemId === null)
|
|
3380
|
+
return false;
|
|
3381
|
+
state.prefabStage = { ...state.prefabStage, selectedItemId: null };
|
|
3382
|
+
state.editorStateRevision += 1;
|
|
3383
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-clear', state.editorStateRevision);
|
|
3384
|
+
return true;
|
|
3385
|
+
}
|
|
3386
|
+
const candidateId = ('activeId' in command ? command.activeId : null)
|
|
3387
|
+
?? command.selectedIds[command.selectedIds.length - 1]
|
|
3388
|
+
?? null;
|
|
3389
|
+
if (!candidateId)
|
|
3390
|
+
return false;
|
|
3391
|
+
const target = resolvePrefabStagePreviewTarget(state, options, document, candidateId);
|
|
3392
|
+
if (!target?.selectable)
|
|
3393
|
+
return false;
|
|
3394
|
+
const currentlySelected = currentProjectionSelection.selectedIds.includes(candidateId);
|
|
3395
|
+
if ((command.type === 'selection.toggle' && currentlySelected)
|
|
3396
|
+
|| (command.type === 'selection.remove' && currentlySelected)) {
|
|
3397
|
+
state.prefabStage = { ...state.prefabStage, selectedItemId: null };
|
|
3398
|
+
state.editorStateRevision += 1;
|
|
3399
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-remove', state.editorStateRevision);
|
|
3400
|
+
return true;
|
|
3401
|
+
}
|
|
3402
|
+
if (command.type === 'selection.remove')
|
|
3403
|
+
return false;
|
|
3404
|
+
const nextItemId = target.itemId ?? `prefab-node:${target.targetId}`;
|
|
3405
|
+
if (state.prefabStage.selectedItemId === nextItemId)
|
|
3406
|
+
return false;
|
|
3407
|
+
state.prefabStage = { ...state.prefabStage, selectedItemId: nextItemId };
|
|
3408
|
+
state.editorStateRevision += 1;
|
|
3409
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-command', state.editorStateRevision);
|
|
3410
|
+
return true;
|
|
3411
|
+
}
|
|
3412
|
+
function resolvePrefabStagePreviewTarget(state, options, document, projectionNodeId) {
|
|
3413
|
+
const stage = state.prefabStage;
|
|
3414
|
+
if (!stage)
|
|
3415
|
+
return null;
|
|
3416
|
+
const descriptor = resolvePrefabStageDescriptorForDocument(state, options, document) ?? stage.descriptor;
|
|
3417
|
+
const context = createPrefabStageContext(state, descriptor);
|
|
3418
|
+
const adapterTarget = options.documentAdapter.resolvePrefabStagePreviewTarget?.(document, descriptor, projectionNodeId, context);
|
|
3419
|
+
if (adapterTarget)
|
|
3420
|
+
return adapterTarget;
|
|
3421
|
+
return resolvePrefabStagePreviewTargetFromStructure(descriptor, projectionNodeId, options.documentAdapter.getPrefabStageStructure?.(document, descriptor, context) ?? createFallbackPrefabStageStructure(descriptor));
|
|
3422
|
+
}
|
|
3423
|
+
function resolvePrefabStageProjectionNodeIdForNode(state, options, document, nodeId) {
|
|
3424
|
+
const stage = state.prefabStage;
|
|
3425
|
+
if (!stage)
|
|
3426
|
+
return null;
|
|
3427
|
+
const descriptor = resolvePrefabStageDescriptorForDocument(state, options, document) ?? stage.descriptor;
|
|
3428
|
+
const context = createPrefabStageContext(state, descriptor);
|
|
3429
|
+
const adapterProjectionNodeId = options.documentAdapter.getPrefabStageProjectionNodeId?.(document, descriptor, nodeId, context);
|
|
3430
|
+
if (adapterProjectionNodeId)
|
|
3431
|
+
return adapterProjectionNodeId;
|
|
3432
|
+
const target = findPrefabStageStructureNodeByNodeId(options.documentAdapter.getPrefabStageStructure?.(document, descriptor, context) ?? createFallbackPrefabStageStructure(descriptor), nodeId);
|
|
3433
|
+
return target?.nodeId ? createFallbackPrefabStageProjectionNodeId(descriptor, target.nodeId) : null;
|
|
3434
|
+
}
|
|
3435
|
+
function resolvePrefabStagePreviewTargetFromStructure(descriptor, projectionNodeId, items) {
|
|
3436
|
+
const prefix = descriptor.previewNodeId;
|
|
3437
|
+
if (!prefix || projectionNodeId.includes(':compare-'))
|
|
3438
|
+
return null;
|
|
3439
|
+
for (const item of flattenPrefabStageStructureNodes(items)) {
|
|
3440
|
+
if (!item.nodeId)
|
|
3441
|
+
continue;
|
|
3442
|
+
const expectedProjectionNodeId = createFallbackPrefabStageProjectionNodeId(descriptor, item.nodeId);
|
|
3443
|
+
if (expectedProjectionNodeId !== projectionNodeId)
|
|
3444
|
+
continue;
|
|
3445
|
+
const readonly = descriptor.readonly === true || item.readonly === true;
|
|
3446
|
+
const isRoot = item.kind === 'root';
|
|
3447
|
+
return {
|
|
3448
|
+
scopeId: `prefab-stage:${descriptor.assetId}`,
|
|
3449
|
+
scopeKind: 'prefab-stage',
|
|
3450
|
+
projectionNodeId,
|
|
3451
|
+
targetId: item.nodeId,
|
|
3452
|
+
itemId: item.id,
|
|
3453
|
+
label: item.label,
|
|
3454
|
+
kind: item.kind,
|
|
3455
|
+
selectable: true,
|
|
3456
|
+
transformable: !readonly && !isRoot,
|
|
3457
|
+
readonly,
|
|
3458
|
+
...(!readonly && !isRoot ? {} : { disabledReason: readonly ? 'Prefab stage is readonly.' : 'Prefab root cannot be transformed from Preview.' }),
|
|
3459
|
+
};
|
|
3460
|
+
}
|
|
3461
|
+
return null;
|
|
3462
|
+
}
|
|
3463
|
+
function createFallbackPrefabStageProjectionNodeId(descriptor, nodeId) {
|
|
3464
|
+
const prefix = descriptor.previewNodeId;
|
|
3465
|
+
if (!prefix)
|
|
3466
|
+
return null;
|
|
3467
|
+
return nodeId === 'prefab-root' ? prefix : `${prefix}:${nodeId}`;
|
|
3468
|
+
}
|
|
3469
|
+
function findPrefabStageStructureNodeByNodeId(items, nodeId) {
|
|
3470
|
+
return flattenPrefabStageStructureNodes(items).find(item => item.nodeId === nodeId) ?? null;
|
|
3471
|
+
}
|
|
3472
|
+
function findPrefabStageStructureItemById(items, itemId) {
|
|
3473
|
+
return flattenPrefabStageStructureNodes(items).find(item => item.id === itemId) ?? null;
|
|
3474
|
+
}
|
|
3475
|
+
function flattenPrefabStageStructureNodes(items) {
|
|
3476
|
+
const flattened = [];
|
|
3477
|
+
for (const item of items) {
|
|
3478
|
+
if (item.itemType === 'prefab-node' && item.nodeId)
|
|
3479
|
+
flattened.push(item);
|
|
3480
|
+
flattened.push(...flattenPrefabStageStructureNodes(item.children ?? []));
|
|
3481
|
+
}
|
|
3482
|
+
return flattened;
|
|
3483
|
+
}
|
|
3151
3484
|
function createFallbackPrefabStageDescriptor(assetId, browserAssetId, item) {
|
|
3152
3485
|
if (!item?.prefab)
|
|
3153
3486
|
return null;
|
|
@@ -3180,7 +3513,8 @@ function resolvePrefabStageDescriptorForDocument(state, options, document) {
|
|
|
3180
3513
|
previewNodeId: descriptor.previewNodeId ?? stage.descriptor.previewNodeId,
|
|
3181
3514
|
};
|
|
3182
3515
|
}
|
|
3183
|
-
const browserItem = findBrowserAssetItemByResolvedId(state, options, document, browserAssetId ?? assetId)
|
|
3516
|
+
const browserItem = findBrowserAssetItemByResolvedId(state, options, document, browserAssetId ?? assetId)
|
|
3517
|
+
?? (browserAssetId ? findBrowserAssetItemByResolvedId(state, options, document, assetId) : null);
|
|
3184
3518
|
return createFallbackPrefabStageDescriptor(assetId, browserAssetId, browserItem) ?? stage.descriptor;
|
|
3185
3519
|
}
|
|
3186
3520
|
function patchBrowserAssetAction(state, options, input, selectionOverride) {
|
|
@@ -3221,12 +3555,49 @@ function patchBrowserAssetAction(state, options, input, selectionOverride) {
|
|
|
3221
3555
|
else if (state.prefabStage && result.documentChanged) {
|
|
3222
3556
|
rebuildProjectionFromDocument(state, options, result.workingDocument, EMPTY_EDITOR_SELECTION);
|
|
3223
3557
|
}
|
|
3558
|
+
if (result.documentChanged && isPrefabStageShadowAssetAction(input)) {
|
|
3559
|
+
state.shadowPreview?.invalidateStaticProjectedArtifact?.();
|
|
3560
|
+
scheduleProjectionShadowPreviewRefresh(state, 'prefab-stage-shadow-policy-action');
|
|
3561
|
+
}
|
|
3562
|
+
syncPrefabStageSelectionFromAssetAction(state, options, input, patch.createdId ?? patch.changedId ?? null);
|
|
3224
3563
|
if (input.actionId === 'asset.delete-material' && input.browserAssetId && state.selectedAssetId === input.browserAssetId) {
|
|
3225
3564
|
state.selectedAssetId = null;
|
|
3226
3565
|
}
|
|
3227
3566
|
selectCreatedBrowserAssetFromPatch(state, options, patch.createdId ?? null, input);
|
|
3228
3567
|
return true;
|
|
3229
3568
|
}
|
|
3569
|
+
function isPrefabStageShadowAssetAction(input) {
|
|
3570
|
+
if (input.actionId === 'prefab.node.setShadow')
|
|
3571
|
+
return true;
|
|
3572
|
+
if (input.actionId !== 'asset.edit-prefab-field')
|
|
3573
|
+
return false;
|
|
3574
|
+
const fieldPath = typeof input.fieldPath === 'string' ? input.fieldPath.trim() : '';
|
|
3575
|
+
return fieldPath === 'prefab.defaults.shadowMode' || fieldPath.startsWith('prefab.defaults.shadow.');
|
|
3576
|
+
}
|
|
3577
|
+
function syncPrefabStageSelectionFromAssetAction(state, options, input, nodeId) {
|
|
3578
|
+
if (!state.prefabStage)
|
|
3579
|
+
return;
|
|
3580
|
+
const isPrefabNodeAction = input.actionId.startsWith('prefab.node.')
|
|
3581
|
+
|| input.actionId === 'asset.add-to-current-prefab';
|
|
3582
|
+
if (!isPrefabNodeAction)
|
|
3583
|
+
return;
|
|
3584
|
+
if (input.actionId === 'prefab.node.delete') {
|
|
3585
|
+
const rootId = typeof nodeId === 'string' && nodeId ? nodeId : 'prefab-root';
|
|
3586
|
+
state.prefabStage = {
|
|
3587
|
+
...state.prefabStage,
|
|
3588
|
+
selectedItemId: `prefab-node:${rootId}`,
|
|
3589
|
+
};
|
|
3590
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-delete');
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
if (!nodeId)
|
|
3594
|
+
return;
|
|
3595
|
+
state.prefabStage = {
|
|
3596
|
+
...state.prefabStage,
|
|
3597
|
+
selectedItemId: `prefab-node:${nodeId}`,
|
|
3598
|
+
};
|
|
3599
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-asset-action');
|
|
3600
|
+
}
|
|
3230
3601
|
function selectCreatedBrowserAssetFromPatch(state, options, createdId, input) {
|
|
3231
3602
|
if (!createdId)
|
|
3232
3603
|
return;
|
|
@@ -3359,6 +3730,7 @@ function addAssetToDocument(state, options, assetId, createOptions = {}) {
|
|
|
3359
3730
|
document: beforeDocument,
|
|
3360
3731
|
asset,
|
|
3361
3732
|
assetId,
|
|
3733
|
+
name: createOptions.name,
|
|
3362
3734
|
placement: createOptions.placement,
|
|
3363
3735
|
});
|
|
3364
3736
|
const result = session.dispatch({
|
|
@@ -3374,7 +3746,7 @@ function addAssetToDocument(state, options, assetId, createOptions = {}) {
|
|
|
3374
3746
|
?? options.documentAdapter.findCreatedId?.(beforeDocument, result.workingDocument)
|
|
3375
3747
|
?? null;
|
|
3376
3748
|
let selectionResult = null;
|
|
3377
|
-
if (createdId) {
|
|
3749
|
+
if (createdId && createOptions.select !== false) {
|
|
3378
3750
|
selectionResult = session.dispatch({
|
|
3379
3751
|
type: 'selection.replace',
|
|
3380
3752
|
selectedIds: [createdId],
|
|
@@ -3443,9 +3815,11 @@ function patchSerializedProperty(state, options, input) {
|
|
|
3443
3815
|
return false;
|
|
3444
3816
|
const changedIds = patch.changedIds ?? targetIds;
|
|
3445
3817
|
const projectionMetadataPatch = isSerializedProjectionMetadataPath(payload.path);
|
|
3818
|
+
const shadowTopologyMetadataPatch = isSerializedShadowTopologyMetadataPath(payload.path);
|
|
3446
3819
|
const largeProjectionMetadataPatch = projectionMetadataPatch
|
|
3820
|
+
&& !shadowTopologyMetadataPatch
|
|
3447
3821
|
&& changedIds.length >= LARGE_SHADOW_MODE_BATCH_THRESHOLD;
|
|
3448
|
-
const invalidateStaticShadowArtifact = projectionMetadataPatch && payload.path
|
|
3822
|
+
const invalidateStaticShadowArtifact = projectionMetadataPatch && isSerializedShadowMetadataPath(payload.path);
|
|
3449
3823
|
const result = state.session.dispatch({
|
|
3450
3824
|
type: 'document.patch',
|
|
3451
3825
|
label: patch.label ?? `Patch ${payload.path} on ${targetIds.length} objects`,
|
|
@@ -3474,6 +3848,9 @@ function patchSerializedProperty(state, options, input) {
|
|
|
3474
3848
|
reprojectProjectionForChangedIds(state, options, workingDocument, patch.reprojectIds);
|
|
3475
3849
|
else if (shouldReprojectInspectorEdit)
|
|
3476
3850
|
reprojectProjectionForChangedIds(state, options, workingDocument, changedIds);
|
|
3851
|
+
else if (shadowTopologyMetadataPatch) {
|
|
3852
|
+
rebuildProjectionAfterShadowTopologyMetadataPatch(state, options, workingDocument, sessionState.selection);
|
|
3853
|
+
}
|
|
3477
3854
|
else if (isSerializedProjectionMetadataPath(payload.path)) {
|
|
3478
3855
|
syncProjectionMetadataForChangedIds(state, options, workingDocument, projectionSyncIds, {
|
|
3479
3856
|
deferShadowPreviewRefresh: largeProjectionMetadataPatch,
|
|
@@ -3521,9 +3898,13 @@ function patchSerializedProperty(state, options, input) {
|
|
|
3521
3898
|
else if (shouldReprojectInspectorEdit) {
|
|
3522
3899
|
reprojectProjectionForChangedIds(state, options, result.workingDocument, patch.changedIds ?? [patch.changedId ?? payload.targetId]);
|
|
3523
3900
|
}
|
|
3901
|
+
else if (isSerializedShadowTopologyMetadataPath(payload.path)) {
|
|
3902
|
+
const selection = state.session?.getState({ cloneDocuments: false }).selection ?? EMPTY_EDITOR_SELECTION;
|
|
3903
|
+
rebuildProjectionAfterShadowTopologyMetadataPatch(state, options, result.workingDocument, selection);
|
|
3904
|
+
}
|
|
3524
3905
|
else if (isSerializedProjectionMetadataPath(payload.path)) {
|
|
3525
3906
|
syncProjectionMetadataForChangedIds(state, options, result.workingDocument, patch.changedIds ?? [patch.changedId ?? payload.targetId], {
|
|
3526
|
-
invalidateStaticShadowArtifact: payload.path
|
|
3907
|
+
invalidateStaticShadowArtifact: isSerializedShadowMetadataPath(payload.path),
|
|
3527
3908
|
});
|
|
3528
3909
|
}
|
|
3529
3910
|
else if (isSerializedTransformPath(payload.path))
|
|
@@ -3952,17 +4333,26 @@ async function applyRenderingPropertyChange(state, options, input) {
|
|
|
3952
4333
|
}
|
|
3953
4334
|
}
|
|
3954
4335
|
async function applyRenderingAction(state, options, input, render) {
|
|
3955
|
-
if (state.mode !== 'editor')
|
|
3956
|
-
return false;
|
|
3957
|
-
|
|
3958
|
-
|
|
4336
|
+
if (state.mode !== 'editor') {
|
|
4337
|
+
return { ok: false, changed: false, rendered: false, status: 'Editor is not in edit mode.', statusTone: 'warning' };
|
|
4338
|
+
}
|
|
4339
|
+
if (!state.session || !options.documentAdapter.onRenderingAction) {
|
|
4340
|
+
return { ok: false, changed: false, rendered: false, status: 'Rendering action pipeline is unavailable.', statusTone: 'warning' };
|
|
4341
|
+
}
|
|
3959
4342
|
if (state.renderingAction) {
|
|
3960
4343
|
state.status = state.renderingAction.status ?? `Rendering action already running: ${state.renderingAction.actionId}`;
|
|
3961
4344
|
state.statusTone = state.renderingAction.statusTone ?? 'default';
|
|
3962
4345
|
state.statusToneStatus = state.status;
|
|
3963
4346
|
state.statusDetails = state.renderingAction.statusDetails ?? '';
|
|
3964
4347
|
render();
|
|
3965
|
-
return
|
|
4348
|
+
return {
|
|
4349
|
+
ok: false,
|
|
4350
|
+
changed: false,
|
|
4351
|
+
rendered: true,
|
|
4352
|
+
status: state.status,
|
|
4353
|
+
statusTone: state.statusTone,
|
|
4354
|
+
...(state.statusDetails ? { statusDetails: state.statusDetails } : {}),
|
|
4355
|
+
};
|
|
3966
4356
|
}
|
|
3967
4357
|
const document = state.session.getState().workingDocument;
|
|
3968
4358
|
const progressStartedAt = Date.now();
|
|
@@ -4011,6 +4401,7 @@ async function applyRenderingAction(state, options, input, render) {
|
|
|
4011
4401
|
|| resultObject?.changed === true
|
|
4012
4402
|
|| resultObject?.refreshWorldRendering === true
|
|
4013
4403
|
|| documentPatchResult?.changed === true;
|
|
4404
|
+
const rendered = changed || !!resultObject?.status;
|
|
4014
4405
|
if (resultObject?.status) {
|
|
4015
4406
|
state.status = resultObject.status;
|
|
4016
4407
|
state.statusTone = resultObject.statusTone ?? 'default';
|
|
@@ -4034,7 +4425,15 @@ async function applyRenderingAction(state, options, input, render) {
|
|
|
4034
4425
|
invalidateEditorScene(state, 'rendering-panel-action', options);
|
|
4035
4426
|
}
|
|
4036
4427
|
clearRenderingActionAfterMinimumDuration(state, progressStartedAt, input.actionId, render);
|
|
4037
|
-
return
|
|
4428
|
+
return {
|
|
4429
|
+
ok: resultObject?.statusTone !== 'error',
|
|
4430
|
+
changed,
|
|
4431
|
+
rendered,
|
|
4432
|
+
...(state.status ? { status: state.status } : {}),
|
|
4433
|
+
statusTone: state.statusTone,
|
|
4434
|
+
...(state.statusDetails ? { statusDetails: state.statusDetails } : {}),
|
|
4435
|
+
...(resultObject?.details ? { details: resultObject.details } : {}),
|
|
4436
|
+
};
|
|
4038
4437
|
}
|
|
4039
4438
|
catch (error) {
|
|
4040
4439
|
state.renderingAction = null;
|
|
@@ -4043,7 +4442,15 @@ async function applyRenderingAction(state, options, input, render) {
|
|
|
4043
4442
|
state.statusToneStatus = state.status;
|
|
4044
4443
|
state.statusDetails = state.status;
|
|
4045
4444
|
console.error('[LocalEditorHarness] rendering action failed', error);
|
|
4046
|
-
return
|
|
4445
|
+
return {
|
|
4446
|
+
ok: false,
|
|
4447
|
+
changed: false,
|
|
4448
|
+
rendered: true,
|
|
4449
|
+
status: state.status,
|
|
4450
|
+
statusTone: 'error',
|
|
4451
|
+
statusDetails: state.statusDetails,
|
|
4452
|
+
error: state.status,
|
|
4453
|
+
};
|
|
4047
4454
|
}
|
|
4048
4455
|
}
|
|
4049
4456
|
function clearRenderingActionAfterMinimumDuration(state, startedAt, actionId, render) {
|
|
@@ -4213,7 +4620,20 @@ function isSerializedTransformPath(path) {
|
|
|
4213
4620
|
|| path.startsWith('transform.scale.');
|
|
4214
4621
|
}
|
|
4215
4622
|
function isSerializedProjectionMetadataPath(path) {
|
|
4216
|
-
return path
|
|
4623
|
+
return isSerializedShadowMetadataPath(path);
|
|
4624
|
+
}
|
|
4625
|
+
function isSerializedShadowMetadataPath(path) {
|
|
4626
|
+
return path === 'shadowMode' || path.startsWith('shadow.');
|
|
4627
|
+
}
|
|
4628
|
+
function isSerializedShadowTopologyMetadataPath(path) {
|
|
4629
|
+
return path === 'shadowMode'
|
|
4630
|
+
|| path === 'shadow.cast'
|
|
4631
|
+
|| path === 'shadow.receive'
|
|
4632
|
+
|| path === 'shadow.mode'
|
|
4633
|
+
|| path === 'shadow.quality'
|
|
4634
|
+
|| path === 'shadow.light.mode'
|
|
4635
|
+
|| path === 'shadow.light.lightId'
|
|
4636
|
+
|| path.startsWith('shadow.light.');
|
|
4217
4637
|
}
|
|
4218
4638
|
function beginDuplicateDrag(state, options, input) {
|
|
4219
4639
|
if (state.mode !== 'editor' || !state.session)
|
|
@@ -4304,6 +4724,8 @@ function cancelDuplicateDrag(state, options) {
|
|
|
4304
4724
|
function commitGizmoTransform(state, options, event) {
|
|
4305
4725
|
if (state.mode !== 'editor' || !state.session)
|
|
4306
4726
|
return false;
|
|
4727
|
+
if (state.prefabStage)
|
|
4728
|
+
return commitPrefabStageGizmoTransform(state, options, event);
|
|
4307
4729
|
const document = state.session.getState().workingDocument;
|
|
4308
4730
|
const markerChanged = commitMarkerGizmoTransform(state, options, document, event);
|
|
4309
4731
|
if (markerChanged !== null)
|
|
@@ -4381,6 +4803,85 @@ function commitGizmoTransform(state, options, event) {
|
|
|
4381
4803
|
state.duplicateDrag = null;
|
|
4382
4804
|
return result.documentChanged;
|
|
4383
4805
|
}
|
|
4806
|
+
function commitPrefabStageGizmoTransform(state, options, event) {
|
|
4807
|
+
const session = state.session;
|
|
4808
|
+
const document = session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
4809
|
+
if (!state.prefabStage || !session || !document || !options.documentAdapter.createAssetActionPatch)
|
|
4810
|
+
return false;
|
|
4811
|
+
if (isTransformBatchCommit(event)) {
|
|
4812
|
+
restoreBatchTransformPreview(state, event.targets);
|
|
4813
|
+
state.status = 'Ignored Prefab Stage multi-selection transform';
|
|
4814
|
+
state.statusTone = 'warning';
|
|
4815
|
+
state.statusToneStatus = state.status;
|
|
4816
|
+
return false;
|
|
4817
|
+
}
|
|
4818
|
+
const target = resolvePrefabStagePreviewTarget(state, options, document, event.nodeId);
|
|
4819
|
+
if (!target?.selectable || !target.transformable) {
|
|
4820
|
+
state.projection?.setNodeTransformPreview(event.nodeId, event.before);
|
|
4821
|
+
state.status = target?.disabledReason ?? `Ignored ${event.tool} ${event.nodeId}`;
|
|
4822
|
+
state.statusTone = 'warning';
|
|
4823
|
+
state.statusToneStatus = state.status;
|
|
4824
|
+
return false;
|
|
4825
|
+
}
|
|
4826
|
+
const transformActionValue = createPrefabStageTransformActionValue(event.after);
|
|
4827
|
+
if (!transformActionValue) {
|
|
4828
|
+
state.projection?.setNodeTransformPreview(event.nodeId, event.before);
|
|
4829
|
+
state.status = `Ignored ${event.tool} ${target.label ?? target.targetId}: Prefab Stage transform requires TRS data`;
|
|
4830
|
+
state.statusTone = 'warning';
|
|
4831
|
+
state.statusToneStatus = state.status;
|
|
4832
|
+
return false;
|
|
4833
|
+
}
|
|
4834
|
+
const patch = options.documentAdapter.createAssetActionPatch({
|
|
4835
|
+
actionId: 'prefab.node.setTransform',
|
|
4836
|
+
targetPrefabAssetId: state.prefabStage.descriptor.assetId,
|
|
4837
|
+
nodeId: target.targetId,
|
|
4838
|
+
document,
|
|
4839
|
+
asset: null,
|
|
4840
|
+
activeId: target.targetId,
|
|
4841
|
+
selectedIds: [target.targetId],
|
|
4842
|
+
value: transformActionValue,
|
|
4843
|
+
});
|
|
4844
|
+
if (!patch) {
|
|
4845
|
+
state.projection?.setNodeTransformPreview(event.nodeId, event.before);
|
|
4846
|
+
state.status = `Ignored ${event.tool} ${target.label ?? target.targetId}`;
|
|
4847
|
+
state.statusTone = 'warning';
|
|
4848
|
+
state.statusToneStatus = state.status;
|
|
4849
|
+
return false;
|
|
4850
|
+
}
|
|
4851
|
+
const result = session.dispatch({
|
|
4852
|
+
type: 'document.patch',
|
|
4853
|
+
label: patch.label ?? `Set prefab node ${target.targetId} transform`,
|
|
4854
|
+
patch: patch.patch,
|
|
4855
|
+
targetId: target.targetId,
|
|
4856
|
+
...withProjectionImpact(resolveProjectionImpact(patch, patch.reprojectIds?.length
|
|
4857
|
+
? createReprojectProjectionImpact(patch.reprojectIds)
|
|
4858
|
+
: createTransformProjectionImpact([patch.changedId ?? target.targetId]))),
|
|
4859
|
+
});
|
|
4860
|
+
syncProjectionForDispatchResult(state, options, result);
|
|
4861
|
+
rebuildProjectionFromDocument(state, options, result.workingDocument, EMPTY_EDITOR_SELECTION);
|
|
4862
|
+
state.summary = summarizeDocument(options, result.workingDocument, session.getSource());
|
|
4863
|
+
state.status = patch.label ?? `Set prefab node ${target.label ?? target.targetId} transform`;
|
|
4864
|
+
state.statusTone = 'success';
|
|
4865
|
+
state.statusToneStatus = state.status;
|
|
4866
|
+
state.statusDetails = '';
|
|
4867
|
+
syncPrefabStageSelectionFromAssetAction(state, options, {
|
|
4868
|
+
actionId: 'prefab.node.setTransform',
|
|
4869
|
+
}, patch.changedId ?? target.targetId);
|
|
4870
|
+
return result.documentChanged;
|
|
4871
|
+
}
|
|
4872
|
+
function createPrefabStageTransformActionValue(transform) {
|
|
4873
|
+
if (!isEditorTransformTrsSnapshot(transform))
|
|
4874
|
+
return null;
|
|
4875
|
+
return {
|
|
4876
|
+
type: 'Transform',
|
|
4877
|
+
position: cloneEditorTransformVec3(transform.position),
|
|
4878
|
+
rotation: cloneEditorTransformVec3(transform.rotation),
|
|
4879
|
+
scale: cloneEditorTransformVec3(transform.scale),
|
|
4880
|
+
};
|
|
4881
|
+
}
|
|
4882
|
+
function cloneEditorTransformVec3(value) {
|
|
4883
|
+
return { x: value.x, y: value.y, z: value.z };
|
|
4884
|
+
}
|
|
4384
4885
|
function commitMarkerGizmoTransform(state, options, document, event) {
|
|
4385
4886
|
if (isTransformBatchCommit(event))
|
|
4386
4887
|
return null;
|
|
@@ -4552,6 +5053,25 @@ function cancelEditorIntent(state, options) {
|
|
|
4552
5053
|
|| state.viewportMeasurement.end) {
|
|
4553
5054
|
return clearViewportMeasurement(state);
|
|
4554
5055
|
}
|
|
5056
|
+
if (state.prefabStage?.selectedItemId) {
|
|
5057
|
+
cancelActiveOperation(state);
|
|
5058
|
+
state.prefabStage = { ...state.prefabStage, selectedItemId: null };
|
|
5059
|
+
state.editorStateRevision += 1;
|
|
5060
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-selection-cancel', state.editorStateRevision);
|
|
5061
|
+
state.status = 'Cleared Prefab Stage selection';
|
|
5062
|
+
state.statusTone = 'default';
|
|
5063
|
+
state.statusToneStatus = state.status;
|
|
5064
|
+
state.statusDetails = '';
|
|
5065
|
+
return true;
|
|
5066
|
+
}
|
|
5067
|
+
if (state.prefabStage) {
|
|
5068
|
+
cancelActiveOperation(state);
|
|
5069
|
+
state.status = 'Canceled Prefab Stage operation';
|
|
5070
|
+
state.statusTone = 'default';
|
|
5071
|
+
state.statusToneStatus = state.status;
|
|
5072
|
+
state.statusDetails = '';
|
|
5073
|
+
return true;
|
|
5074
|
+
}
|
|
4555
5075
|
const selection = state.session?.getSelection();
|
|
4556
5076
|
if (selection && selection.selectedIds.length > 0) {
|
|
4557
5077
|
return dispatchSelectionCommand(state, options, { type: 'selection.clear', label: 'Clear Selection' });
|
|
@@ -4559,9 +5079,17 @@ function cancelEditorIntent(state, options) {
|
|
|
4559
5079
|
cancelActiveOperation(state);
|
|
4560
5080
|
return true;
|
|
4561
5081
|
}
|
|
4562
|
-
function focusSelectedProjection(state) {
|
|
5082
|
+
function focusSelectedProjection(state, options) {
|
|
4563
5083
|
if (state.mode !== 'editor')
|
|
4564
5084
|
return false;
|
|
5085
|
+
if (state.prefabStage) {
|
|
5086
|
+
const activeId = getCurrentPrefabStageProjectionSelection(state, options).activeId;
|
|
5087
|
+
if (!activeId) {
|
|
5088
|
+
state.status = 'Focus failed: no Prefab Stage selection';
|
|
5089
|
+
return true;
|
|
5090
|
+
}
|
|
5091
|
+
return focusPrefabStageProjectionNode(state, options, activeId, 'prefab-stage-focus-selection');
|
|
5092
|
+
}
|
|
4565
5093
|
const activeId = state.session?.getState().selection.activeId ?? null;
|
|
4566
5094
|
if (!activeId) {
|
|
4567
5095
|
state.status = 'Focus failed: no selection';
|
|
@@ -4587,6 +5115,66 @@ function focusProjectionNode(state, nodeId) {
|
|
|
4587
5115
|
requestEditorSceneFrame(state, 'viewport-focus-selection');
|
|
4588
5116
|
return true;
|
|
4589
5117
|
}
|
|
5118
|
+
function frameViewportProjectionNode(state, nodeId) {
|
|
5119
|
+
if (state.mode !== 'editor')
|
|
5120
|
+
return false;
|
|
5121
|
+
const root = state.projection?.getAttachableRoot(nodeId) ?? null;
|
|
5122
|
+
if (!root) {
|
|
5123
|
+
state.status = `Focus failed: missing projection for ${nodeId}`;
|
|
5124
|
+
return false;
|
|
5125
|
+
}
|
|
5126
|
+
const focused = focusEditorViewportSelection(state.world?.camera ?? null, root, {
|
|
5127
|
+
babylon: state.babylon ?? undefined,
|
|
5128
|
+
});
|
|
5129
|
+
state.status = focused
|
|
5130
|
+
? `Focused ${nodeId} · ${formatEditorStatusTime(Date.now())}`
|
|
5131
|
+
: `Focus failed: camera could not frame ${nodeId}`;
|
|
5132
|
+
if (focused)
|
|
5133
|
+
requestEditorSceneFrame(state, 'viewport-focus-object');
|
|
5134
|
+
return focused;
|
|
5135
|
+
}
|
|
5136
|
+
function frameSelectedViewportProjection(state, options) {
|
|
5137
|
+
if (state.mode !== 'editor')
|
|
5138
|
+
return false;
|
|
5139
|
+
if (state.prefabStage) {
|
|
5140
|
+
const activeId = getCurrentPrefabStageProjectionSelection(state, options).activeId;
|
|
5141
|
+
if (!activeId) {
|
|
5142
|
+
state.status = 'Focus failed: no Prefab Stage selection';
|
|
5143
|
+
return false;
|
|
5144
|
+
}
|
|
5145
|
+
return focusPrefabStageProjectionNode(state, options, activeId, 'prefab-stage-frame-selection');
|
|
5146
|
+
}
|
|
5147
|
+
const activeId = state.session?.getState({ cloneDocuments: false }).selection.activeId ?? null;
|
|
5148
|
+
if (!activeId) {
|
|
5149
|
+
state.status = 'Focus failed: no selection';
|
|
5150
|
+
return false;
|
|
5151
|
+
}
|
|
5152
|
+
return frameViewportProjectionNode(state, activeId);
|
|
5153
|
+
}
|
|
5154
|
+
function focusPrefabStageProjectionNode(state, options, projectionNodeId, reason) {
|
|
5155
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
5156
|
+
if (!state.prefabStage || !document)
|
|
5157
|
+
return false;
|
|
5158
|
+
const target = resolvePrefabStagePreviewTarget(state, options, document, projectionNodeId);
|
|
5159
|
+
if (!target?.selectable) {
|
|
5160
|
+
state.status = `Focus failed: ${projectionNodeId} is not an editable Prefab Stage preview target`;
|
|
5161
|
+
return true;
|
|
5162
|
+
}
|
|
5163
|
+
const root = state.projection?.getAttachableRoot(projectionNodeId) ?? null;
|
|
5164
|
+
if (!root) {
|
|
5165
|
+
state.status = `Focus failed: missing projection for ${projectionNodeId}`;
|
|
5166
|
+
return true;
|
|
5167
|
+
}
|
|
5168
|
+
const focused = focusEditorViewportSelection(state.world?.camera ?? null, root, {
|
|
5169
|
+
babylon: state.babylon ?? undefined,
|
|
5170
|
+
});
|
|
5171
|
+
state.status = focused
|
|
5172
|
+
? `Focused ${target.label ?? projectionNodeId} · ${formatEditorStatusTime(Date.now())}`
|
|
5173
|
+
: `Focus failed: camera could not frame ${target.label ?? projectionNodeId}`;
|
|
5174
|
+
if (focused)
|
|
5175
|
+
requestEditorSceneFrame(state, reason);
|
|
5176
|
+
return true;
|
|
5177
|
+
}
|
|
4590
5178
|
function focusPrefabStagePreviewProjection(state, reason) {
|
|
4591
5179
|
const previewNodeId = state.prefabStage?.descriptor.previewNodeId;
|
|
4592
5180
|
if (!previewNodeId)
|
|
@@ -4827,11 +5415,12 @@ function applyIncrementalProjectionImpactToDocument(state, options, input) {
|
|
|
4827
5415
|
state.projection.projectNode(projectedNode);
|
|
4828
5416
|
}
|
|
4829
5417
|
for (const projectedNode of reprojectNodes) {
|
|
4830
|
-
state
|
|
5418
|
+
syncProjectionNodeTransformOrReprojectRuntime(state, projectedNode, { forceReproject: true });
|
|
4831
5419
|
}
|
|
4832
5420
|
for (const projectedNode of syncTransformNodes) {
|
|
4833
|
-
state
|
|
5421
|
+
syncProjectionNodeTransformOrReprojectRuntime(state, projectedNode);
|
|
4834
5422
|
}
|
|
5423
|
+
applyPreviewVisibilityStateToProjection(state);
|
|
4835
5424
|
const sanitized = sanitizeSelection(state, options, input.document, input.selection);
|
|
4836
5425
|
syncSelectionToProjection(state, options, sanitized ?? input.selection);
|
|
4837
5426
|
syncEditorWorldAppearanceFromDocument(state, options, input.document, `world-appearance-${input.reason}`);
|
|
@@ -4860,8 +5449,14 @@ function resolveCurrentEditorProjectionNodes(state, options, document) {
|
|
|
4860
5449
|
function rebuildProjectionFromDocument(state, options, document, selection) {
|
|
4861
5450
|
const nodes = resolveCurrentEditorProjectionNodes(state, options, document);
|
|
4862
5451
|
state.projection?.rebuild(nodes);
|
|
4863
|
-
|
|
4864
|
-
|
|
5452
|
+
applyPreviewVisibilityStateToProjection(state);
|
|
5453
|
+
if (state.prefabStage) {
|
|
5454
|
+
syncPrefabStageSelectionToProjection(state, options, 'prefab-stage-projection-rebuild');
|
|
5455
|
+
}
|
|
5456
|
+
else {
|
|
5457
|
+
const sanitized = sanitizeSelection(state, options, document, selection);
|
|
5458
|
+
syncSelectionToProjection(state, options, sanitized ?? selection);
|
|
5459
|
+
}
|
|
4865
5460
|
syncEditorWorldAppearanceFromDocument(state, options, document, 'world-appearance-rebuild');
|
|
4866
5461
|
syncEditorWorldRenderingFromDocument(state, options, document, 'world-rendering-rebuild', true);
|
|
4867
5462
|
if (state.prefabStage && nodes.length === 0) {
|
|
@@ -4881,7 +5476,7 @@ function syncProjectionForDispatchResult(state, options, result, changedId) {
|
|
|
4881
5476
|
if (result.documentChanged && changedId && result.workingDocument) {
|
|
4882
5477
|
const projectedNode = options.documentAdapter.getProjectionNode(result.workingDocument, changedId);
|
|
4883
5478
|
if (projectedNode)
|
|
4884
|
-
state
|
|
5479
|
+
syncProjectionNodeTransformOrReprojectRuntime(state, projectedNode);
|
|
4885
5480
|
}
|
|
4886
5481
|
if (result.selectionChanged) {
|
|
4887
5482
|
syncSelectionToProjection(state, options, result.selection ?? { selectedIds: [], activeId: null });
|
|
@@ -4907,7 +5502,7 @@ function syncProjectionForChangedIds(state, options, document, changedIds) {
|
|
|
4907
5502
|
for (const changedId of changedIds) {
|
|
4908
5503
|
const projectedNode = options.documentAdapter.getProjectionNode(document, changedId);
|
|
4909
5504
|
if (projectedNode)
|
|
4910
|
-
state
|
|
5505
|
+
syncProjectionNodeTransformOrReprojectRuntime(state, projectedNode);
|
|
4911
5506
|
}
|
|
4912
5507
|
const selection = state.session?.getState({ cloneDocuments: false }).selection ?? { selectedIds: [], activeId: null };
|
|
4913
5508
|
syncSelectionToProjection(state, options, selection);
|
|
@@ -4915,6 +5510,24 @@ function syncProjectionForChangedIds(state, options, document, changedIds) {
|
|
|
4915
5510
|
syncEditorWorldRenderingFromDocument(state, options, document, 'world-rendering-sync-changed-ids', true);
|
|
4916
5511
|
invalidateEditorScene(state, 'projection-sync-changed-ids');
|
|
4917
5512
|
}
|
|
5513
|
+
function syncProjectionNodeTransformOrReprojectRuntime(state, projectedNode, options = {}) {
|
|
5514
|
+
if (!state.projection)
|
|
5515
|
+
return;
|
|
5516
|
+
if (projectedNode.runtimeKind === 'light' && state.projection.syncRuntimeNode(projectedNode)) {
|
|
5517
|
+
state.shadowPreview?.refresh();
|
|
5518
|
+
return;
|
|
5519
|
+
}
|
|
5520
|
+
if (options.forceReproject || projectedNode.runtimeKind === 'light' || shouldReprojectRuntimeProjectionNode(projectedNode)) {
|
|
5521
|
+
state.projection.projectNode(projectedNode);
|
|
5522
|
+
if (projectedNode.runtimeKind === 'light')
|
|
5523
|
+
state.shadowPreview?.refresh();
|
|
5524
|
+
return;
|
|
5525
|
+
}
|
|
5526
|
+
state.projection.syncNodeTransform(projectedNode);
|
|
5527
|
+
}
|
|
5528
|
+
function shouldReprojectRuntimeProjectionNode(projectedNode) {
|
|
5529
|
+
return projectedNode.runtimeKind === 'camera';
|
|
5530
|
+
}
|
|
4918
5531
|
function syncProjectionMetadataForChangedIds(state, options, document, changedIds, syncOptions = {}) {
|
|
4919
5532
|
if (state.prefabStage) {
|
|
4920
5533
|
rebuildProjectionFromDocument(state, options, document, EMPTY_EDITOR_SELECTION);
|
|
@@ -4943,6 +5556,11 @@ function syncProjectionMetadataForChangedIds(state, options, document, changedId
|
|
|
4943
5556
|
}
|
|
4944
5557
|
invalidateEditorScene(state, 'projection-sync-metadata-ids');
|
|
4945
5558
|
}
|
|
5559
|
+
function rebuildProjectionAfterShadowTopologyMetadataPatch(state, options, document, selection) {
|
|
5560
|
+
rebuildProjectionFromDocument(state, options, document, selection);
|
|
5561
|
+
state.shadowPreview?.invalidateStaticProjectedArtifact?.();
|
|
5562
|
+
scheduleProjectionShadowPreviewRebuild(state, 'projection-shadow-topology-metadata-rebuild');
|
|
5563
|
+
}
|
|
4946
5564
|
function reprojectProjectionForChangedIds(state, options, document, changedIds) {
|
|
4947
5565
|
if (state.prefabStage) {
|
|
4948
5566
|
rebuildProjectionFromDocument(state, options, document, EMPTY_EDITOR_SELECTION);
|
|
@@ -4953,11 +5571,22 @@ function reprojectProjectionForChangedIds(state, options, document, changedIds)
|
|
|
4953
5571
|
if (projectedNode)
|
|
4954
5572
|
state.projection?.projectNode(projectedNode);
|
|
4955
5573
|
}
|
|
5574
|
+
applyPreviewVisibilityStateToProjection(state);
|
|
4956
5575
|
syncCurrentSelectionToSceneArtifacts(state, options);
|
|
4957
5576
|
syncEditorWorldAppearanceFromDocument(state, options, document, 'world-appearance-reproject-changed-ids');
|
|
4958
5577
|
syncEditorWorldRenderingFromDocument(state, options, document, 'world-rendering-reproject-changed-ids', true);
|
|
4959
5578
|
invalidateEditorScene(state, 'projection-reproject-changed-ids', options);
|
|
4960
5579
|
}
|
|
5580
|
+
function applyPreviewVisibilityStateToProjection(state) {
|
|
5581
|
+
const projection = state.projection;
|
|
5582
|
+
if (!projection?.clearPreviewVisibilityOverrides || !projection.setPreviewVisibilityOverrides)
|
|
5583
|
+
return;
|
|
5584
|
+
projection.clearPreviewVisibilityOverrides();
|
|
5585
|
+
const overrides = state.previewVisibility.overrides;
|
|
5586
|
+
if (Object.keys(overrides).length > 0) {
|
|
5587
|
+
projection.setPreviewVisibilityOverrides(overrides);
|
|
5588
|
+
}
|
|
5589
|
+
}
|
|
4961
5590
|
function setSceneCameraPreviewEnabled(state, options, enabled) {
|
|
4962
5591
|
if (!enabled) {
|
|
4963
5592
|
state.sceneCameraPreviewEnabled = false;
|
|
@@ -5025,16 +5654,16 @@ function syncViewportCameraState(state) {
|
|
|
5025
5654
|
projectionMode: cameraState.projectionMode,
|
|
5026
5655
|
};
|
|
5027
5656
|
}
|
|
5028
|
-
function syncViewportSpatialOverlay(state) {
|
|
5657
|
+
function syncViewportSpatialOverlay(state, options) {
|
|
5029
5658
|
const settings = state.viewportTools.overlay;
|
|
5030
5659
|
if (!settings.bounds && !settings.dimensions && !settings.edgeLengths && !settings.anchor) {
|
|
5031
5660
|
state.viewportSpatialOverlay = createEmptyEditorViewportSpatialOverlayState();
|
|
5032
5661
|
return;
|
|
5033
5662
|
}
|
|
5034
5663
|
const overlay = state.sceneViewSpatialOverlay;
|
|
5035
|
-
const selection = state
|
|
5036
|
-
const activeId = selection
|
|
5037
|
-
if (state.mode !== 'editor' || !overlay || !activeId || selection
|
|
5664
|
+
const selection = getCurrentPreviewSelection(state, options);
|
|
5665
|
+
const activeId = selection.activeId;
|
|
5666
|
+
if (state.mode !== 'editor' || !overlay || !activeId || selection.selectedIds.length !== 1) {
|
|
5038
5667
|
state.viewportSpatialOverlay = createEmptyEditorViewportSpatialOverlayState();
|
|
5039
5668
|
return;
|
|
5040
5669
|
}
|
|
@@ -5134,31 +5763,38 @@ function radiansToInspectorDegrees(value) {
|
|
|
5134
5763
|
function createUiState(state, options) {
|
|
5135
5764
|
const sessionState = state.session?.getState({ cloneDocuments: false });
|
|
5136
5765
|
const document = sessionState?.workingDocument ?? null;
|
|
5137
|
-
const
|
|
5138
|
-
const
|
|
5139
|
-
const
|
|
5766
|
+
const documentSelectedIds = sessionState?.selection.selectedIds ?? [];
|
|
5767
|
+
const documentActiveId = sessionState?.selection.activeId ?? null;
|
|
5768
|
+
const scopedPreviewSelection = getScopedPreviewSelectionForUiState(state, options, {
|
|
5769
|
+
selectedIds: documentSelectedIds,
|
|
5770
|
+
activeId: documentActiveId,
|
|
5771
|
+
});
|
|
5772
|
+
const selectedIds = scopedPreviewSelection.selectedIds;
|
|
5773
|
+
const activeId = scopedPreviewSelection.activeId;
|
|
5774
|
+
const largeSelection = isLargeSelection(documentSelectedIds);
|
|
5775
|
+
const transformSelectionIsLarge = isLargeSelection(selectedIds);
|
|
5140
5776
|
const markerGraph = document ? options.documentAdapter.getMarkerGraph?.(document) ?? null : null;
|
|
5141
5777
|
const markerTypes = document ? options.documentAdapter.getMarkerTypeCatalog?.(document) ?? [] : [];
|
|
5142
5778
|
const relationTypes = document ? options.documentAdapter.getRelationTypeCatalog?.(document) ?? [] : [];
|
|
5143
5779
|
const documentHierarchy = document ? options.documentAdapter.getHierarchyItems(document) : [];
|
|
5144
5780
|
const activeMarkerId = activeId ? readSpatialMarkerIdFromHierarchySelection(markerGraph, activeId, documentHierarchy) : null;
|
|
5145
5781
|
const markerRelationVisibility = createMarkerRelationVisibilityOptions(state);
|
|
5146
|
-
const markerInspectorObject = document && activeId
|
|
5782
|
+
const markerInspectorObject = document && activeId
|
|
5147
5783
|
? createMarkerInspectorObjectBase(options, document, activeId, markerGraph, documentHierarchy, markerTypes, state.activeMarkerRelationId, state.markerRelationPick, markerRelationVisibility)
|
|
5148
5784
|
: null;
|
|
5149
5785
|
const serializedObject = document && activeId && selectedIds.length === 1
|
|
5150
5786
|
? markerInspectorObject ? null : options.documentAdapter.getSerializedObject(document, activeId)
|
|
5151
5787
|
: null;
|
|
5152
|
-
const serializedMultiObject = document &&
|
|
5153
|
-
? options.documentAdapter.getSerializedMultiObject?.(document,
|
|
5788
|
+
const serializedMultiObject = document && documentSelectedIds.length > 1 && !largeSelection
|
|
5789
|
+
? options.documentAdapter.getSerializedMultiObject?.(document, documentSelectedIds, documentActiveId) ?? null
|
|
5154
5790
|
: null;
|
|
5155
|
-
const inspectorObjectBase = document && activeId && selectedIds.length === 1
|
|
5791
|
+
const inspectorObjectBase = document && activeId && (selectedIds.length === 1 || markerInspectorObject)
|
|
5156
5792
|
? markerInspectorObject
|
|
5157
5793
|
?? options.documentAdapter.getInspectorObject?.(document, activeId)
|
|
5158
5794
|
?? (serializedObject ? serializedObjectToInspectorObject(serializedObject, document) : null)
|
|
5159
5795
|
: null;
|
|
5160
|
-
const inspectorMultiObjectBase = document &&
|
|
5161
|
-
? createInspectorMultiObjectBase(state, options, document,
|
|
5796
|
+
const inspectorMultiObjectBase = document && documentSelectedIds.length > 1
|
|
5797
|
+
? createInspectorMultiObjectBase(state, options, document, documentSelectedIds, documentActiveId, serializedMultiObject, {
|
|
5162
5798
|
largeSelection,
|
|
5163
5799
|
})
|
|
5164
5800
|
: null;
|
|
@@ -5192,6 +5828,7 @@ function createUiState(state, options) {
|
|
|
5192
5828
|
return {
|
|
5193
5829
|
mode: state.mode,
|
|
5194
5830
|
busy: state.busy,
|
|
5831
|
+
agentBridge: state.agentBridgeStatus,
|
|
5195
5832
|
status: state.status,
|
|
5196
5833
|
statusTone: state.statusToneStatus === state.status ? state.statusTone : 'default',
|
|
5197
5834
|
statusDetails: state.statusToneStatus === state.status ? state.statusDetails : '',
|
|
@@ -5233,11 +5870,11 @@ function createUiState(state, options) {
|
|
|
5233
5870
|
draggingNodeId: state.gizmo?.getState().draggingNodeId ?? null,
|
|
5234
5871
|
},
|
|
5235
5872
|
transformOperations: {
|
|
5236
|
-
settings: cloneTransformOperationSettings(state
|
|
5873
|
+
settings: cloneTransformOperationSettings(getScopedTransformOperationSettings(state)),
|
|
5237
5874
|
selectedCount: selectedIds.length,
|
|
5238
5875
|
activeId,
|
|
5239
|
-
canAlign: !
|
|
5240
|
-
canDistribute: !
|
|
5876
|
+
canAlign: !transformSelectionIsLarge && selectedIds.length >= 2 && activeId != null && !state.prefabStage,
|
|
5877
|
+
canDistribute: !transformSelectionIsLarge && selectedIds.length >= 3 && !state.prefabStage,
|
|
5241
5878
|
},
|
|
5242
5879
|
viewportTools: cloneEditorViewportToolState(state.viewportTools),
|
|
5243
5880
|
viewportMeasurement: cloneViewportMeasurement(state.viewportMeasurement),
|
|
@@ -5291,6 +5928,53 @@ function createBrowserPrefabStageState(state, options, document) {
|
|
|
5291
5928
|
comparisonPreviews: createPrefabStageComparisonPreviews(state, descriptor),
|
|
5292
5929
|
};
|
|
5293
5930
|
}
|
|
5931
|
+
function summarizeAgentBridgePrefabStage(state, options) {
|
|
5932
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
5933
|
+
const stage = createBrowserPrefabStageState(state, options, document);
|
|
5934
|
+
if (!stage)
|
|
5935
|
+
return null;
|
|
5936
|
+
return createAgentBridgePrefabStageState(stage);
|
|
5937
|
+
}
|
|
5938
|
+
function summarizeAgentBridgePrefabStageDetails(state, options) {
|
|
5939
|
+
const document = state.session?.getState({ cloneDocuments: false }).workingDocument ?? null;
|
|
5940
|
+
const stage = createBrowserPrefabStageState(state, options, document);
|
|
5941
|
+
if (!stage)
|
|
5942
|
+
return null;
|
|
5943
|
+
return {
|
|
5944
|
+
stage: createAgentBridgePrefabStageState(stage),
|
|
5945
|
+
structureItems: stage.structureItems,
|
|
5946
|
+
inspectorObject: stage.inspectorObject ?? null,
|
|
5947
|
+
};
|
|
5948
|
+
}
|
|
5949
|
+
function createAgentBridgePrefabStageState(stage) {
|
|
5950
|
+
return {
|
|
5951
|
+
assetId: stage.assetId,
|
|
5952
|
+
...(stage.browserAssetId ? { browserAssetId: stage.browserAssetId } : {}),
|
|
5953
|
+
label: stage.label,
|
|
5954
|
+
...(stage.sourceAssetId ? { sourceAssetId: stage.sourceAssetId } : {}),
|
|
5955
|
+
...(stage.sourceAssetGuid ? { sourceAssetGuid: stage.sourceAssetGuid } : {}),
|
|
5956
|
+
...(stage.previewNodeId ? { previewNodeId: stage.previewNodeId } : {}),
|
|
5957
|
+
selectedItemId: stage.selectedItemId ?? null,
|
|
5958
|
+
...(stage.readonly != null ? { readonly: stage.readonly } : {}),
|
|
5959
|
+
};
|
|
5960
|
+
}
|
|
5961
|
+
function createAgentBridgePrefabSummaryFromStage(stage) {
|
|
5962
|
+
return {
|
|
5963
|
+
assetId: stage.assetId,
|
|
5964
|
+
...(stage.browserAssetId ? { browserAssetId: stage.browserAssetId } : {}),
|
|
5965
|
+
displayName: stage.label,
|
|
5966
|
+
...(stage.sourceAssetId ? { sourceAssetId: stage.sourceAssetId } : {}),
|
|
5967
|
+
...(stage.sourceAssetGuid ? { sourceAssetGuid: stage.sourceAssetGuid } : {}),
|
|
5968
|
+
...(stage.readonly != null ? { readonly: stage.readonly } : {}),
|
|
5969
|
+
status: 'ready',
|
|
5970
|
+
};
|
|
5971
|
+
}
|
|
5972
|
+
function isSameAgentBridgePrefabStage(left, right) {
|
|
5973
|
+
if (!left || !right)
|
|
5974
|
+
return false;
|
|
5975
|
+
return left.assetId === right.assetId
|
|
5976
|
+
|| (!!left.browserAssetId && left.browserAssetId === right.browserAssetId);
|
|
5977
|
+
}
|
|
5294
5978
|
function createPrefabStageContext(state, descriptor) {
|
|
5295
5979
|
const previewNodeId = descriptor.previewNodeId;
|
|
5296
5980
|
if (!previewNodeId) {
|
|
@@ -5383,18 +6067,32 @@ function createFallbackPrefabStageStructure(descriptor) {
|
|
|
5383
6067
|
}],
|
|
5384
6068
|
}];
|
|
5385
6069
|
}
|
|
6070
|
+
function getScopedPreviewSelectionForUiState(state, options, fallbackSelection) {
|
|
6071
|
+
return state.prefabStage
|
|
6072
|
+
? getCurrentPrefabStageProjectionSelection(state, options)
|
|
6073
|
+
: fallbackSelection;
|
|
6074
|
+
}
|
|
6075
|
+
function getCurrentPreviewSelection(state, options) {
|
|
6076
|
+
return getScopedPreviewSelectionForUiState(state, options, state.session?.getState({ cloneDocuments: false }).selection ?? EMPTY_EDITOR_SELECTION);
|
|
6077
|
+
}
|
|
5386
6078
|
function createUiPreviewState(state, options) {
|
|
5387
6079
|
const sessionState = state.session?.getState({ cloneDocuments: false });
|
|
5388
6080
|
const selection = sessionState?.selection;
|
|
5389
6081
|
const document = sessionState?.workingDocument ?? null;
|
|
5390
|
-
const
|
|
5391
|
-
const
|
|
5392
|
-
const
|
|
5393
|
-
|
|
6082
|
+
const documentSelectedIds = selection?.selectedIds ?? [];
|
|
6083
|
+
const documentActiveId = selection?.activeId ?? null;
|
|
6084
|
+
const scopedPreviewSelection = getScopedPreviewSelectionForUiState(state, options, {
|
|
6085
|
+
selectedIds: documentSelectedIds,
|
|
6086
|
+
activeId: documentActiveId,
|
|
6087
|
+
});
|
|
6088
|
+
const selectedIds = scopedPreviewSelection.selectedIds;
|
|
6089
|
+
const activeId = scopedPreviewSelection.activeId;
|
|
6090
|
+
const transformSelectionIsLarge = isLargeSelection(selectedIds);
|
|
6091
|
+
const shouldPreviewInspector = !!state.activeTransformPreview && document && documentActiveId && documentSelectedIds.length === 1;
|
|
5394
6092
|
const inspectorObjectBase = shouldPreviewInspector
|
|
5395
|
-
? options.documentAdapter.getInspectorObject?.(document,
|
|
6093
|
+
? options.documentAdapter.getInspectorObject?.(document, documentActiveId)
|
|
5396
6094
|
?? (() => {
|
|
5397
|
-
const serializedObject = options.documentAdapter.getSerializedObject(document,
|
|
6095
|
+
const serializedObject = options.documentAdapter.getSerializedObject(document, documentActiveId);
|
|
5398
6096
|
return serializedObject ? serializedObjectToInspectorObject(serializedObject, document) : null;
|
|
5399
6097
|
})()
|
|
5400
6098
|
: null;
|
|
@@ -5418,11 +6116,11 @@ function createUiPreviewState(state, options) {
|
|
|
5418
6116
|
draggingNodeId: state.gizmo?.getState().draggingNodeId ?? null,
|
|
5419
6117
|
},
|
|
5420
6118
|
transformOperations: {
|
|
5421
|
-
settings: cloneTransformOperationSettings(state
|
|
6119
|
+
settings: cloneTransformOperationSettings(getScopedTransformOperationSettings(state)),
|
|
5422
6120
|
selectedCount: selectedIds.length,
|
|
5423
6121
|
activeId,
|
|
5424
|
-
canAlign: !
|
|
5425
|
-
canDistribute: !
|
|
6122
|
+
canAlign: !transformSelectionIsLarge && selectedIds.length >= 2 && activeId != null && !state.prefabStage,
|
|
6123
|
+
canDistribute: !transformSelectionIsLarge && selectedIds.length >= 3 && !state.prefabStage,
|
|
5426
6124
|
},
|
|
5427
6125
|
viewportTools: cloneEditorViewportToolState(state.viewportTools),
|
|
5428
6126
|
viewportMeasurement: cloneViewportMeasurement(state.viewportMeasurement),
|