unreal-engine-mcp-server 0.5.21 → 0.5.30
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/CHANGELOG.md +247 -4
- package/README.md +140 -85
- package/dist/automation/bridge.d.ts +8 -0
- package/dist/automation/bridge.d.ts.map +1 -1
- package/dist/automation/bridge.js +94 -14
- package/dist/automation/bridge.js.map +1 -1
- package/dist/automation/connection-manager.d.ts.map +1 -1
- package/dist/automation/connection-manager.js +13 -5
- package/dist/automation/connection-manager.js.map +1 -1
- package/dist/automation/handshake.d.ts.map +1 -1
- package/dist/automation/handshake.js +40 -27
- package/dist/automation/handshake.js.map +1 -1
- package/dist/automation/index.d.ts +1 -1
- package/dist/automation/index.d.ts.map +1 -1
- package/dist/automation/index.js +0 -1
- package/dist/automation/index.js.map +1 -1
- package/dist/automation/message-handler.d.ts.map +1 -1
- package/dist/automation/message-handler.js +13 -9
- package/dist/automation/message-handler.js.map +1 -1
- package/dist/automation/message-schema.d.ts.map +1 -1
- package/dist/automation/message-schema.js +19 -18
- package/dist/automation/message-schema.js.map +1 -1
- package/dist/automation/request-tracker.d.ts +1 -0
- package/dist/automation/request-tracker.d.ts.map +1 -1
- package/dist/automation/request-tracker.js +30 -31
- package/dist/automation/request-tracker.js.map +1 -1
- package/dist/automation/types.d.ts +38 -32
- package/dist/automation/types.d.ts.map +1 -1
- package/dist/cli.js +14 -16
- package/dist/cli.js.map +1 -1
- package/dist/config/class-aliases.d.ts.map +1 -1
- package/dist/config/class-aliases.js +10 -2
- package/dist/config/class-aliases.js.map +1 -1
- package/dist/config.d.ts +9 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +58 -32
- package/dist/config.js.map +1 -1
- package/dist/handlers/resource-handlers.d.ts +15 -2
- package/dist/handlers/resource-handlers.d.ts.map +1 -1
- package/dist/handlers/resource-handlers.js +46 -63
- package/dist/handlers/resource-handlers.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -48
- package/dist/index.js.map +1 -1
- package/dist/resources/assets.d.ts.map +1 -1
- package/dist/resources/assets.js +34 -9
- package/dist/resources/assets.js.map +1 -1
- package/dist/resources/levels.d.ts +3 -0
- package/dist/resources/levels.d.ts.map +1 -1
- package/dist/resources/levels.js +33 -17
- package/dist/resources/levels.js.map +1 -1
- package/dist/server/resource-registry.d.ts +15 -2
- package/dist/server/resource-registry.d.ts.map +1 -1
- package/dist/server/resource-registry.js +9 -8
- package/dist/server/resource-registry.js.map +1 -1
- package/dist/server/tool-registry.d.ts +0 -1
- package/dist/server/tool-registry.d.ts.map +1 -1
- package/dist/server/tool-registry.js +91 -101
- package/dist/server/tool-registry.js.map +1 -1
- package/dist/server-setup.d.ts +5 -2
- package/dist/server-setup.d.ts.map +1 -1
- package/dist/server-setup.js +15 -19
- package/dist/server-setup.js.map +1 -1
- package/dist/services/health-monitor.d.ts +3 -0
- package/dist/services/health-monitor.d.ts.map +1 -1
- package/dist/services/health-monitor.js +30 -11
- package/dist/services/health-monitor.js.map +1 -1
- package/dist/services/metrics-server.d.ts +1 -1
- package/dist/services/metrics-server.d.ts.map +1 -1
- package/dist/services/metrics-server.js +65 -3
- package/dist/services/metrics-server.js.map +1 -1
- package/dist/tools/base-tool.d.ts.map +1 -1
- package/dist/tools/base-tool.js +14 -16
- package/dist/tools/base-tool.js.map +1 -1
- package/dist/tools/consolidated-tool-definitions.d.ts +16 -1
- package/dist/tools/consolidated-tool-definitions.d.ts.map +1 -1
- package/dist/tools/consolidated-tool-definitions.js +1479 -2538
- package/dist/tools/consolidated-tool-definitions.js.map +1 -1
- package/dist/tools/consolidated-tool-handlers.d.ts.map +1 -1
- package/dist/tools/consolidated-tool-handlers.js +195 -217
- package/dist/tools/consolidated-tool-handlers.js.map +1 -1
- package/dist/tools/dynamic-handler-registry.d.ts +1 -0
- package/dist/tools/dynamic-handler-registry.d.ts.map +1 -1
- package/dist/tools/dynamic-handler-registry.js +15 -7
- package/dist/tools/dynamic-handler-registry.js.map +1 -1
- package/dist/tools/dynamic-tool-manager.d.ts +1 -1
- package/dist/tools/dynamic-tool-manager.d.ts.map +1 -1
- package/dist/tools/dynamic-tool-manager.js +30 -18
- package/dist/tools/dynamic-tool-manager.js.map +1 -1
- package/dist/tools/editor.d.ts +2 -2
- package/dist/tools/editor.d.ts.map +1 -1
- package/dist/tools/editor.js +4 -4
- package/dist/tools/editor.js.map +1 -1
- package/dist/tools/handlers/actor-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/actor-handlers.js +66 -7
- package/dist/tools/handlers/actor-handlers.js.map +1 -1
- package/dist/tools/handlers/ai-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/ai-handlers.js +24 -13
- package/dist/tools/handlers/ai-handlers.js.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/animation-authoring-handlers.js +285 -218
- package/dist/tools/handlers/animation-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/animation-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/animation-handlers.js +69 -21
- package/dist/tools/handlers/animation-handlers.js.map +1 -1
- package/dist/tools/handlers/asset-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/asset-handlers.js +75 -16
- package/dist/tools/handlers/asset-handlers.js.map +1 -1
- package/dist/tools/handlers/audio-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/audio-authoring-handlers.js +102 -9
- package/dist/tools/handlers/audio-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/audio-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/audio-handlers.js +48 -13
- package/dist/tools/handlers/audio-handlers.js.map +1 -1
- package/dist/tools/handlers/blueprint-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/blueprint-handlers.js +28 -48
- package/dist/tools/handlers/blueprint-handlers.js.map +1 -1
- package/dist/tools/handlers/character-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/character-handlers.js +13 -12
- package/dist/tools/handlers/character-handlers.js.map +1 -1
- package/dist/tools/handlers/combat-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/combat-handlers.js +12 -12
- package/dist/tools/handlers/combat-handlers.js.map +1 -1
- package/dist/tools/handlers/common-handlers.d.ts +14 -0
- package/dist/tools/handlers/common-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/common-handlers.js +117 -9
- package/dist/tools/handlers/common-handlers.js.map +1 -1
- package/dist/tools/handlers/editor-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/editor-handlers.js +139 -67
- package/dist/tools/handlers/editor-handlers.js.map +1 -1
- package/dist/tools/handlers/effect-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/effect-handlers.js +324 -36
- package/dist/tools/handlers/effect-handlers.js.map +1 -1
- package/dist/tools/handlers/environment-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/environment-handlers.js +186 -21
- package/dist/tools/handlers/environment-handlers.js.map +1 -1
- package/dist/tools/handlers/game-framework-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/game-framework-handlers.js +10 -12
- package/dist/tools/handlers/game-framework-handlers.js.map +1 -1
- package/dist/tools/handlers/gas-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/gas-handlers.js +136 -20
- package/dist/tools/handlers/gas-handlers.js.map +1 -1
- package/dist/tools/handlers/geometry-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/geometry-handlers.js +130 -7
- package/dist/tools/handlers/geometry-handlers.js.map +1 -1
- package/dist/tools/handlers/graph-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/graph-handlers.js +46 -11
- package/dist/tools/handlers/graph-handlers.js.map +1 -1
- package/dist/tools/handlers/input-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/input-handlers.js +33 -75
- package/dist/tools/handlers/input-handlers.js.map +1 -1
- package/dist/tools/handlers/inspect-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/inspect-handlers.js +136 -39
- package/dist/tools/handlers/inspect-handlers.js.map +1 -1
- package/dist/tools/handlers/interaction-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/interaction-handlers.js +14 -12
- package/dist/tools/handlers/interaction-handlers.js.map +1 -1
- package/dist/tools/handlers/inventory-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/inventory-handlers.js +19 -12
- package/dist/tools/handlers/inventory-handlers.js.map +1 -1
- package/dist/tools/handlers/level-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/level-handlers.js +166 -149
- package/dist/tools/handlers/level-handlers.js.map +1 -1
- package/dist/tools/handlers/level-structure-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/level-structure-handlers.js +18 -34
- package/dist/tools/handlers/level-structure-handlers.js.map +1 -1
- package/dist/tools/handlers/manage-tools-handlers.js +3 -3
- package/dist/tools/handlers/manage-tools-handlers.js.map +1 -1
- package/dist/tools/handlers/material-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/material-authoring-handlers.js +382 -41
- package/dist/tools/handlers/material-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/navigation-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/navigation-handlers.js +11 -36
- package/dist/tools/handlers/navigation-handlers.js.map +1 -1
- package/dist/tools/handlers/networking-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/networking-handlers.js +17 -15
- package/dist/tools/handlers/networking-handlers.js.map +1 -1
- package/dist/tools/handlers/niagara-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/niagara-authoring-handlers.js +24 -23
- package/dist/tools/handlers/niagara-authoring-handlers.js.map +1 -1
- package/dist/tools/handlers/pcg-handlers.d.ts +4 -0
- package/dist/tools/handlers/pcg-handlers.d.ts.map +1 -0
- package/dist/tools/handlers/pcg-handlers.js +77 -0
- package/dist/tools/handlers/pcg-handlers.js.map +1 -0
- package/dist/tools/handlers/performance-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/performance-handlers.js +35 -42
- package/dist/tools/handlers/performance-handlers.js.map +1 -1
- package/dist/tools/handlers/pipeline-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/pipeline-handlers.js +157 -39
- package/dist/tools/handlers/pipeline-handlers.js.map +1 -1
- package/dist/tools/handlers/sequence-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/sequence-handlers.js +6 -4
- package/dist/tools/handlers/sequence-handlers.js.map +1 -1
- package/dist/tools/handlers/sessions-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/sessions-handlers.js +7 -15
- package/dist/tools/handlers/sessions-handlers.js.map +1 -1
- package/dist/tools/handlers/spline-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/spline-handlers.js +8 -35
- package/dist/tools/handlers/spline-handlers.js.map +1 -1
- package/dist/tools/handlers/system-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/system-handlers.js +100 -26
- package/dist/tools/handlers/system-handlers.js.map +1 -1
- package/dist/tools/handlers/texture-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/texture-handlers.js +14 -0
- package/dist/tools/handlers/texture-handlers.js.map +1 -1
- package/dist/tools/handlers/volume-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/volume-handlers.js +6 -33
- package/dist/tools/handlers/volume-handlers.js.map +1 -1
- package/dist/tools/handlers/widget-authoring-handlers.d.ts.map +1 -1
- package/dist/tools/handlers/widget-authoring-handlers.js +26 -20
- package/dist/tools/handlers/widget-authoring-handlers.js.map +1 -1
- package/dist/tools/level.d.ts +2 -2
- package/dist/tools/level.d.ts.map +1 -1
- package/dist/tools/level.js +2 -1
- package/dist/tools/level.js.map +1 -1
- package/dist/tools/property-dictionary.js +1 -1
- package/dist/tools/property-dictionary.js.map +1 -1
- package/dist/tools/schemas/core-tools.d.ts +1 -1
- package/dist/tools/schemas/core-tools.d.ts.map +1 -1
- package/dist/tools/schemas/core-tools.js +94 -57
- package/dist/tools/schemas/core-tools.js.map +1 -1
- package/dist/tools/tool-definition-utils.d.ts +8 -0
- package/dist/tools/tool-definition-utils.d.ts.map +1 -1
- package/dist/tools/tool-definition-utils.js +20 -0
- package/dist/tools/tool-definition-utils.js.map +1 -1
- package/dist/types/automation-responses.d.ts +26 -33
- package/dist/types/automation-responses.d.ts.map +1 -1
- package/dist/types/env.d.ts.map +1 -1
- package/dist/types/env.js +7 -6
- package/dist/types/env.js.map +1 -1
- package/dist/types/handler-types.d.ts +41 -20
- package/dist/types/handler-types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/tool-interfaces.d.ts +5 -873
- package/dist/types/tool-interfaces.d.ts.map +1 -1
- package/dist/types/tool-types.d.ts +35 -1
- package/dist/types/tool-types.d.ts.map +1 -1
- package/dist/unreal-bridge.d.ts.map +1 -1
- package/dist/unreal-bridge.js +16 -6
- package/dist/unreal-bridge.js.map +1 -1
- package/dist/utils/action-constants.d.ts +4 -1
- package/dist/utils/action-constants.d.ts.map +1 -1
- package/dist/utils/action-constants.js +4 -1
- package/dist/utils/action-constants.js.map +1 -1
- package/dist/utils/command-validator.d.ts.map +1 -1
- package/dist/utils/command-validator.js +5 -4
- package/dist/utils/command-validator.js.map +1 -1
- package/dist/utils/elicitation.d.ts +5 -2
- package/dist/utils/elicitation.d.ts.map +1 -1
- package/dist/utils/elicitation.js +38 -21
- package/dist/utils/elicitation.js.map +1 -1
- package/dist/utils/environment-snapshot.d.ts +17 -0
- package/dist/utils/environment-snapshot.d.ts.map +1 -0
- package/dist/utils/environment-snapshot.js +242 -0
- package/dist/utils/environment-snapshot.js.map +1 -0
- package/dist/utils/error-handler.d.ts +1 -11
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +41 -25
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/ini-reader.js +4 -4
- package/dist/utils/ini-reader.js.map +1 -1
- package/dist/utils/log-reader.d.ts +29 -0
- package/dist/utils/log-reader.d.ts.map +1 -0
- package/dist/utils/log-reader.js +229 -0
- package/dist/utils/log-reader.js.map +1 -0
- package/dist/utils/log-redaction.d.ts +4 -0
- package/dist/utils/log-redaction.d.ts.map +1 -0
- package/dist/utils/log-redaction.js +27 -0
- package/dist/utils/log-redaction.js.map +1 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +20 -7
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/normalize.d.ts.map +1 -1
- package/dist/utils/normalize.js +31 -30
- package/dist/utils/normalize.js.map +1 -1
- package/dist/utils/path-security.d.ts.map +1 -1
- package/dist/utils/path-security.js +20 -11
- package/dist/utils/path-security.js.map +1 -1
- package/dist/utils/response-factory.d.ts +1 -1
- package/dist/utils/response-factory.d.ts.map +1 -1
- package/dist/utils/response-factory.js +17 -3
- package/dist/utils/response-factory.js.map +1 -1
- package/dist/utils/response-validator.d.ts.map +1 -1
- package/dist/utils/response-validator.js +114 -47
- package/dist/utils/response-validator.js.map +1 -1
- package/dist/utils/safe-json.d.ts.map +1 -1
- package/dist/utils/safe-json.js +24 -18
- package/dist/utils/safe-json.js.map +1 -1
- package/dist/utils/type-coercion.d.ts +2 -3
- package/dist/utils/type-coercion.d.ts.map +1 -1
- package/dist/utils/type-coercion.js +42 -14
- package/dist/utils/type-coercion.js.map +1 -1
- package/dist/utils/type-guards.d.ts +2 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +4 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/unreal-command-queue.d.ts +2 -0
- package/dist/utils/unreal-command-queue.d.ts.map +1 -1
- package/dist/utils/unreal-command-queue.js +80 -54
- package/dist/utils/unreal-command-queue.js.map +1 -1
- package/dist/utils/validation.d.ts +2 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +44 -34
- package/dist/utils/validation.js.map +1 -1
- package/package.json +4 -6
- package/server.json +3 -3
- package/dist/graphql/loaders.d.ts +0 -64
- package/dist/graphql/loaders.d.ts.map +0 -1
- package/dist/graphql/loaders.js +0 -117
- package/dist/graphql/loaders.js.map +0 -1
- package/dist/graphql/resolvers.d.ts +0 -373
- package/dist/graphql/resolvers.d.ts.map +0 -1
- package/dist/graphql/resolvers.js +0 -776
- package/dist/graphql/resolvers.js.map +0 -1
- package/dist/graphql/schema.d.ts +0 -5
- package/dist/graphql/schema.d.ts.map +0 -1
- package/dist/graphql/schema.js +0 -437
- package/dist/graphql/schema.js.map +0 -1
- package/dist/graphql/server.d.ts +0 -25
- package/dist/graphql/server.d.ts.map +0 -1
- package/dist/graphql/server.js +0 -119
- package/dist/graphql/server.js.map +0 -1
- package/dist/graphql/types.d.ts +0 -9
- package/dist/graphql/types.d.ts.map +0 -1
- package/dist/graphql/types.js +0 -2
- package/dist/graphql/types.js.map +0 -1
- package/dist/tools/actors.d.ts +0 -212
- package/dist/tools/actors.d.ts.map +0 -1
- package/dist/tools/actors.js +0 -456
- package/dist/tools/actors.js.map +0 -1
- package/dist/tools/animation.d.ts +0 -274
- package/dist/tools/animation.d.ts.map +0 -1
- package/dist/tools/animation.js +0 -773
- package/dist/tools/animation.js.map +0 -1
- package/dist/tools/assets.d.ts +0 -82
- package/dist/tools/assets.d.ts.map +0 -1
- package/dist/tools/assets.js +0 -383
- package/dist/tools/assets.js.map +0 -1
- package/dist/tools/blueprint.d.ts +0 -271
- package/dist/tools/blueprint.d.ts.map +0 -1
- package/dist/tools/blueprint.js +0 -828
- package/dist/tools/blueprint.js.map +0 -1
- package/dist/tools/environment.d.ts +0 -37
- package/dist/tools/environment.d.ts.map +0 -1
- package/dist/tools/environment.js +0 -338
- package/dist/tools/environment.js.map +0 -1
- package/dist/tools/foliage.d.ts +0 -140
- package/dist/tools/foliage.d.ts.map +0 -1
- package/dist/tools/foliage.js +0 -405
- package/dist/tools/foliage.js.map +0 -1
- package/dist/tools/landscape.d.ts +0 -120
- package/dist/tools/landscape.d.ts.map +0 -1
- package/dist/tools/landscape.js +0 -454
- package/dist/tools/landscape.js.map +0 -1
- package/dist/tools/lighting.d.ts +0 -240
- package/dist/tools/lighting.d.ts.map +0 -1
- package/dist/tools/lighting.js +0 -856
- package/dist/tools/lighting.js.map +0 -1
- package/dist/tools/logs.d.ts +0 -45
- package/dist/tools/logs.d.ts.map +0 -1
- package/dist/tools/logs.js +0 -235
- package/dist/tools/logs.js.map +0 -1
- package/dist/tools/niagara.d.ts +0 -277
- package/dist/tools/niagara.d.ts.map +0 -1
- package/dist/tools/niagara.js +0 -325
- package/dist/tools/niagara.js.map +0 -1
- package/dist/tools/physics.d.ts +0 -191
- package/dist/tools/physics.d.ts.map +0 -1
- package/dist/tools/physics.js +0 -492
- package/dist/tools/physics.js.map +0 -1
- package/dist/tools/sequence.d.ts +0 -139
- package/dist/tools/sequence.d.ts.map +0 -1
- package/dist/tools/sequence.js +0 -261
- package/dist/tools/sequence.js.map +0 -1
package/dist/tools/lighting.js
DELETED
|
@@ -1,856 +0,0 @@
|
|
|
1
|
-
import { ensureVector3 } from '../utils/validation.js';
|
|
2
|
-
import { Logger } from '../utils/logger.js';
|
|
3
|
-
const log = new Logger('LightingTools');
|
|
4
|
-
export class LightingTools {
|
|
5
|
-
bridge;
|
|
6
|
-
automationBridge;
|
|
7
|
-
constructor(bridge, automationBridge) {
|
|
8
|
-
this.bridge = bridge;
|
|
9
|
-
this.automationBridge = automationBridge;
|
|
10
|
-
}
|
|
11
|
-
setAutomationBridge(automationBridge) { this.automationBridge = automationBridge; }
|
|
12
|
-
normalizeName(value, defaultName) {
|
|
13
|
-
if (typeof value === 'string') {
|
|
14
|
-
const trimmed = value.trim();
|
|
15
|
-
if (trimmed.length > 0) {
|
|
16
|
-
return trimmed;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (typeof defaultName === 'string') {
|
|
20
|
-
const trimmedDefault = defaultName.trim();
|
|
21
|
-
if (trimmedDefault.length > 0) {
|
|
22
|
-
return trimmedDefault;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return `Light_${Date.now()}_${Math.floor(Math.random() * 1000)}`;
|
|
26
|
-
}
|
|
27
|
-
async listLightTypes() {
|
|
28
|
-
if (!this.automationBridge) {
|
|
29
|
-
throw new Error('Automation Bridge required to list light types');
|
|
30
|
-
}
|
|
31
|
-
const response = await this.automationBridge.sendAutomationRequest('list_light_types', {});
|
|
32
|
-
return response;
|
|
33
|
-
}
|
|
34
|
-
async spawnLightViaAutomation(lightClass, params) {
|
|
35
|
-
if (!this.automationBridge) {
|
|
36
|
-
throw new Error('Automation Bridge not available. Cannot spawn lights without plugin support.');
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
const payload = {
|
|
40
|
-
lightClass,
|
|
41
|
-
name: params.name,
|
|
42
|
-
};
|
|
43
|
-
if (params.location) {
|
|
44
|
-
payload.location = Array.isArray(params.location)
|
|
45
|
-
? { x: params.location[0], y: params.location[1], z: params.location[2] }
|
|
46
|
-
: params.location;
|
|
47
|
-
}
|
|
48
|
-
if (params.rotation) {
|
|
49
|
-
if (Array.isArray(params.rotation)) {
|
|
50
|
-
const rotArray = params.rotation;
|
|
51
|
-
payload.rotation = { pitch: rotArray[0], yaw: rotArray[1], roll: rotArray[2] };
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
payload.rotation = params.rotation;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (params.properties) {
|
|
58
|
-
payload.properties = params.properties;
|
|
59
|
-
}
|
|
60
|
-
const response = await this.automationBridge.sendAutomationRequest('spawn_light', payload, {
|
|
61
|
-
timeoutMs: 60000
|
|
62
|
-
});
|
|
63
|
-
if (response.success === false) {
|
|
64
|
-
throw new Error(response.error || response.message || 'Failed to spawn light');
|
|
65
|
-
}
|
|
66
|
-
return response;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
throw new Error(`Failed to spawn ${lightClass}: ${error instanceof Error ? error.message : String(error)}`);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async createDirectionalLight(params) {
|
|
73
|
-
const name = this.normalizeName(params.name);
|
|
74
|
-
if (!this.automationBridge) {
|
|
75
|
-
throw new Error('Automation Bridge required for light spawning');
|
|
76
|
-
}
|
|
77
|
-
if (params.intensity !== undefined) {
|
|
78
|
-
if (typeof params.intensity !== 'number' || !isFinite(params.intensity)) {
|
|
79
|
-
throw new Error(`Invalid intensity value: ${params.intensity}`);
|
|
80
|
-
}
|
|
81
|
-
if (params.intensity < 0) {
|
|
82
|
-
throw new Error('Invalid intensity: must be non-negative');
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (params.temperature !== undefined) {
|
|
86
|
-
if (typeof params.temperature !== 'number' || !isFinite(params.temperature)) {
|
|
87
|
-
throw new Error(`Invalid temperature value: ${params.temperature}`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (params.color !== undefined) {
|
|
91
|
-
if (!Array.isArray(params.color) || params.color.length !== 3) {
|
|
92
|
-
throw new Error('Invalid color: must be an array [r,g,b]');
|
|
93
|
-
}
|
|
94
|
-
for (const c of params.color) {
|
|
95
|
-
if (typeof c !== 'number' || !isFinite(c)) {
|
|
96
|
-
throw new Error('Invalid color component: must be finite numbers');
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (params.rotation !== undefined) {
|
|
101
|
-
if (Array.isArray(params.rotation)) {
|
|
102
|
-
if (params.rotation.length !== 3) {
|
|
103
|
-
throw new Error('Invalid rotation: must be an array [pitch,yaw,roll]');
|
|
104
|
-
}
|
|
105
|
-
for (const r of params.rotation) {
|
|
106
|
-
if (typeof r !== 'number' || !isFinite(r)) {
|
|
107
|
-
throw new Error('Invalid rotation component: must be finite numbers');
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
const rot = params.rotation || [0, 0, 0];
|
|
113
|
-
const properties = params.properties || {};
|
|
114
|
-
if (params.intensity !== undefined) {
|
|
115
|
-
properties.intensity = params.intensity;
|
|
116
|
-
}
|
|
117
|
-
if (params.color) {
|
|
118
|
-
properties.color = { r: params.color[0], g: params.color[1], b: params.color[2], a: 1.0 };
|
|
119
|
-
}
|
|
120
|
-
if (params.castShadows !== undefined) {
|
|
121
|
-
properties.castShadows = params.castShadows;
|
|
122
|
-
}
|
|
123
|
-
if (params.temperature !== undefined) {
|
|
124
|
-
properties.temperature = params.temperature;
|
|
125
|
-
}
|
|
126
|
-
if (params.useAsAtmosphereSunLight !== undefined) {
|
|
127
|
-
properties.useAsAtmosphereSunLight = params.useAsAtmosphereSunLight;
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
130
|
-
await this.spawnLightViaAutomation('DirectionalLight', {
|
|
131
|
-
name,
|
|
132
|
-
location: [0, 0, 500],
|
|
133
|
-
rotation: rot,
|
|
134
|
-
properties
|
|
135
|
-
});
|
|
136
|
-
return { success: true, message: `Directional light '${name}' spawned` };
|
|
137
|
-
}
|
|
138
|
-
catch (e) {
|
|
139
|
-
return { success: false, error: `Failed to create directional light: ${(e instanceof Error ? e.message : String(e)) ?? e}` };
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
async createPointLight(params) {
|
|
143
|
-
const name = this.normalizeName(params.name);
|
|
144
|
-
if (!this.automationBridge) {
|
|
145
|
-
throw new Error('Automation Bridge required for light spawning');
|
|
146
|
-
}
|
|
147
|
-
let location = [0, 0, 0];
|
|
148
|
-
if (params.location !== undefined) {
|
|
149
|
-
try {
|
|
150
|
-
location = ensureVector3(params.location, 'location');
|
|
151
|
-
}
|
|
152
|
-
catch (e) {
|
|
153
|
-
throw new Error(`Invalid location: ${e instanceof Error ? e.message : String(e)}`);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
if (params.intensity !== undefined) {
|
|
157
|
-
if (typeof params.intensity !== 'number' || !isFinite(params.intensity)) {
|
|
158
|
-
throw new Error(`Invalid intensity value: ${params.intensity}`);
|
|
159
|
-
}
|
|
160
|
-
if (params.intensity < 0) {
|
|
161
|
-
throw new Error('Invalid intensity: must be non-negative');
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
if (params.radius !== undefined) {
|
|
165
|
-
if (typeof params.radius !== 'number' || !isFinite(params.radius)) {
|
|
166
|
-
throw new Error(`Invalid radius value: ${params.radius}`);
|
|
167
|
-
}
|
|
168
|
-
if (params.radius < 0) {
|
|
169
|
-
throw new Error('Invalid radius: must be non-negative');
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (params.falloffExponent !== undefined) {
|
|
173
|
-
if (typeof params.falloffExponent !== 'number' || !isFinite(params.falloffExponent)) {
|
|
174
|
-
throw new Error(`Invalid falloffExponent value: ${params.falloffExponent}`);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (params.color !== undefined) {
|
|
178
|
-
if (!Array.isArray(params.color) || params.color.length !== 3) {
|
|
179
|
-
throw new Error('Invalid color: must be an array [r,g,b]');
|
|
180
|
-
}
|
|
181
|
-
for (const c of params.color) {
|
|
182
|
-
if (typeof c !== 'number' || !isFinite(c)) {
|
|
183
|
-
throw new Error('Invalid color component: must be finite numbers');
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
const properties = {};
|
|
188
|
-
if (params.intensity !== undefined) {
|
|
189
|
-
properties.intensity = params.intensity;
|
|
190
|
-
}
|
|
191
|
-
if (params.radius !== undefined) {
|
|
192
|
-
properties.attenuationRadius = params.radius;
|
|
193
|
-
}
|
|
194
|
-
if (params.color) {
|
|
195
|
-
properties.color = { r: params.color[0], g: params.color[1], b: params.color[2], a: 1.0 };
|
|
196
|
-
}
|
|
197
|
-
if (params.castShadows !== undefined) {
|
|
198
|
-
properties.castShadows = params.castShadows;
|
|
199
|
-
}
|
|
200
|
-
if (params.falloffExponent !== undefined) {
|
|
201
|
-
properties.lightFalloffExponent = params.falloffExponent;
|
|
202
|
-
}
|
|
203
|
-
try {
|
|
204
|
-
await this.spawnLightViaAutomation('PointLight', {
|
|
205
|
-
name,
|
|
206
|
-
location,
|
|
207
|
-
rotation: params.rotation,
|
|
208
|
-
properties
|
|
209
|
-
});
|
|
210
|
-
return { success: true, message: `Point light '${name}' spawned at ${location.join(', ')}` };
|
|
211
|
-
}
|
|
212
|
-
catch (e) {
|
|
213
|
-
return { success: false, error: `Failed to create point light: ${(e instanceof Error ? e.message : String(e)) ?? e}` };
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
async createSpotLight(params) {
|
|
217
|
-
const name = this.normalizeName(params.name);
|
|
218
|
-
if (!this.automationBridge) {
|
|
219
|
-
throw new Error('Automation Bridge required for light spawning');
|
|
220
|
-
}
|
|
221
|
-
if (!params.location || !Array.isArray(params.location) || params.location.length !== 3) {
|
|
222
|
-
throw new Error('Invalid location: must be an array [x,y,z]');
|
|
223
|
-
}
|
|
224
|
-
for (const l of params.location) {
|
|
225
|
-
if (typeof l !== 'number' || !isFinite(l)) {
|
|
226
|
-
throw new Error('Invalid location component: must be finite numbers');
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
if (!params.rotation) {
|
|
230
|
-
throw new Error('Rotation is required');
|
|
231
|
-
}
|
|
232
|
-
if (Array.isArray(params.rotation)) {
|
|
233
|
-
if (params.rotation.length !== 3) {
|
|
234
|
-
throw new Error('Invalid rotation: must be an array [pitch,yaw,roll]');
|
|
235
|
-
}
|
|
236
|
-
for (const r of params.rotation) {
|
|
237
|
-
if (typeof r !== 'number' || !isFinite(r)) {
|
|
238
|
-
throw new Error('Invalid rotation component: must be finite numbers');
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (params.intensity !== undefined) {
|
|
243
|
-
if (typeof params.intensity !== 'number' || !isFinite(params.intensity)) {
|
|
244
|
-
throw new Error(`Invalid intensity value: ${params.intensity}`);
|
|
245
|
-
}
|
|
246
|
-
if (params.intensity < 0) {
|
|
247
|
-
throw new Error('Invalid intensity: must be non-negative');
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
if (params.innerCone !== undefined) {
|
|
251
|
-
if (typeof params.innerCone !== 'number' || !isFinite(params.innerCone)) {
|
|
252
|
-
throw new Error(`Invalid innerCone value: ${params.innerCone}`);
|
|
253
|
-
}
|
|
254
|
-
if (params.innerCone < 0 || params.innerCone > 180) {
|
|
255
|
-
throw new Error('Invalid innerCone: must be between 0 and 180 degrees');
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
if (params.outerCone !== undefined) {
|
|
259
|
-
if (typeof params.outerCone !== 'number' || !isFinite(params.outerCone)) {
|
|
260
|
-
throw new Error(`Invalid outerCone value: ${params.outerCone}`);
|
|
261
|
-
}
|
|
262
|
-
if (params.outerCone < 0 || params.outerCone > 180) {
|
|
263
|
-
throw new Error('Invalid outerCone: must be between 0 and 180 degrees');
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (params.radius !== undefined) {
|
|
267
|
-
if (typeof params.radius !== 'number' || !isFinite(params.radius)) {
|
|
268
|
-
throw new Error(`Invalid radius value: ${params.radius}`);
|
|
269
|
-
}
|
|
270
|
-
if (params.radius < 0) {
|
|
271
|
-
throw new Error('Invalid radius: must be non-negative');
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (params.color !== undefined) {
|
|
275
|
-
if (!Array.isArray(params.color) || params.color.length !== 3) {
|
|
276
|
-
throw new Error('Invalid color: must be an array [r,g,b]');
|
|
277
|
-
}
|
|
278
|
-
for (const c of params.color) {
|
|
279
|
-
if (typeof c !== 'number' || !isFinite(c)) {
|
|
280
|
-
throw new Error('Invalid color component: must be finite numbers');
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
const properties = {};
|
|
285
|
-
if (params.intensity !== undefined) {
|
|
286
|
-
properties.intensity = params.intensity;
|
|
287
|
-
}
|
|
288
|
-
if (params.innerCone !== undefined) {
|
|
289
|
-
properties.innerConeAngle = params.innerCone;
|
|
290
|
-
}
|
|
291
|
-
if (params.outerCone !== undefined) {
|
|
292
|
-
properties.outerConeAngle = params.outerCone;
|
|
293
|
-
}
|
|
294
|
-
if (params.radius !== undefined) {
|
|
295
|
-
properties.attenuationRadius = params.radius;
|
|
296
|
-
}
|
|
297
|
-
if (params.color) {
|
|
298
|
-
properties.color = { r: params.color[0], g: params.color[1], b: params.color[2], a: 1.0 };
|
|
299
|
-
}
|
|
300
|
-
if (params.castShadows !== undefined) {
|
|
301
|
-
properties.castShadows = params.castShadows;
|
|
302
|
-
}
|
|
303
|
-
try {
|
|
304
|
-
await this.spawnLightViaAutomation('SpotLight', {
|
|
305
|
-
name,
|
|
306
|
-
location: params.location,
|
|
307
|
-
rotation: params.rotation,
|
|
308
|
-
properties
|
|
309
|
-
});
|
|
310
|
-
return { success: true, message: `Spot light '${name}' spawned at ${params.location.join(', ')}` };
|
|
311
|
-
}
|
|
312
|
-
catch (e) {
|
|
313
|
-
return { success: false, error: `Failed to create spot light: ${(e instanceof Error ? e.message : String(e)) ?? e}` };
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
async createRectLight(params) {
|
|
317
|
-
const name = this.normalizeName(params.name);
|
|
318
|
-
if (!this.automationBridge) {
|
|
319
|
-
throw new Error('Automation Bridge required for light spawning');
|
|
320
|
-
}
|
|
321
|
-
if (!params.location || !Array.isArray(params.location) || params.location.length !== 3) {
|
|
322
|
-
throw new Error('Invalid location: must be an array [x,y,z]');
|
|
323
|
-
}
|
|
324
|
-
for (const l of params.location) {
|
|
325
|
-
if (typeof l !== 'number' || !isFinite(l)) {
|
|
326
|
-
throw new Error('Invalid location component: must be finite numbers');
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
if (!params.rotation) {
|
|
330
|
-
throw new Error('Rotation is required');
|
|
331
|
-
}
|
|
332
|
-
if (Array.isArray(params.rotation)) {
|
|
333
|
-
if (params.rotation.length !== 3) {
|
|
334
|
-
throw new Error('Invalid rotation: must be an array [pitch,yaw,roll]');
|
|
335
|
-
}
|
|
336
|
-
for (const r of params.rotation) {
|
|
337
|
-
if (typeof r !== 'number' || !isFinite(r)) {
|
|
338
|
-
throw new Error('Invalid rotation component: must be finite numbers');
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
if (params.width !== undefined) {
|
|
343
|
-
if (typeof params.width !== 'number' || !isFinite(params.width)) {
|
|
344
|
-
throw new Error(`Invalid width value: ${params.width}`);
|
|
345
|
-
}
|
|
346
|
-
if (params.width <= 0) {
|
|
347
|
-
throw new Error('Invalid width: must be positive');
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
if (params.height !== undefined) {
|
|
351
|
-
if (typeof params.height !== 'number' || !isFinite(params.height)) {
|
|
352
|
-
throw new Error(`Invalid height value: ${params.height}`);
|
|
353
|
-
}
|
|
354
|
-
if (params.height <= 0) {
|
|
355
|
-
throw new Error('Invalid height: must be positive');
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
if (params.intensity !== undefined) {
|
|
359
|
-
if (typeof params.intensity !== 'number' || !isFinite(params.intensity)) {
|
|
360
|
-
throw new Error(`Invalid intensity value: ${params.intensity}`);
|
|
361
|
-
}
|
|
362
|
-
if (params.intensity < 0) {
|
|
363
|
-
throw new Error('Invalid intensity: must be non-negative');
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (params.color !== undefined) {
|
|
367
|
-
if (!Array.isArray(params.color) || params.color.length !== 3) {
|
|
368
|
-
throw new Error('Invalid color: must be an array [r,g,b]');
|
|
369
|
-
}
|
|
370
|
-
for (const c of params.color) {
|
|
371
|
-
if (typeof c !== 'number' || !isFinite(c)) {
|
|
372
|
-
throw new Error('Invalid color component: must be finite numbers');
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
const properties = {};
|
|
377
|
-
if (params.intensity !== undefined) {
|
|
378
|
-
properties.intensity = params.intensity;
|
|
379
|
-
}
|
|
380
|
-
if (params.color) {
|
|
381
|
-
properties.color = { r: params.color[0], g: params.color[1], b: params.color[2], a: 1.0 };
|
|
382
|
-
}
|
|
383
|
-
if (params.width !== undefined) {
|
|
384
|
-
properties.sourceWidth = params.width;
|
|
385
|
-
}
|
|
386
|
-
if (params.height !== undefined) {
|
|
387
|
-
properties.sourceHeight = params.height;
|
|
388
|
-
}
|
|
389
|
-
try {
|
|
390
|
-
await this.spawnLightViaAutomation('RectLight', {
|
|
391
|
-
name,
|
|
392
|
-
location: params.location,
|
|
393
|
-
rotation: params.rotation,
|
|
394
|
-
properties
|
|
395
|
-
});
|
|
396
|
-
return { success: true, message: `Rect light '${name}' spawned at ${params.location.join(', ')}` };
|
|
397
|
-
}
|
|
398
|
-
catch (e) {
|
|
399
|
-
return { success: false, error: `Failed to create rect light: ${(e instanceof Error ? e.message : String(e)) ?? e}` };
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
async createDynamicLight(params) {
|
|
403
|
-
try {
|
|
404
|
-
const name = typeof params.name === 'string' && params.name.trim().length > 0 ? params.name.trim() : `DynamicLight_${Date.now() % 10000}`;
|
|
405
|
-
const lightTypeRaw = typeof params.lightType === 'string' && params.lightType.trim().length > 0 ? params.lightType.trim() : 'Point';
|
|
406
|
-
const location = Array.isArray(params.location) ? { x: params.location[0], y: params.location[1], z: params.location[2] } : (params.location || { x: 0, y: 0, z: 100 });
|
|
407
|
-
const toArray3 = (loc) => {
|
|
408
|
-
if (Array.isArray(loc)) {
|
|
409
|
-
return [Number(loc[0]) || 0, Number(loc[1]) || 0, Number(loc[2]) || 0];
|
|
410
|
-
}
|
|
411
|
-
const locObj = loc;
|
|
412
|
-
return [Number(locObj?.x) || 0, Number(locObj?.y) || 0, Number(locObj?.z) || 0];
|
|
413
|
-
};
|
|
414
|
-
const locArr = toArray3(location);
|
|
415
|
-
const typeNorm = (lightTypeRaw || 'Point').toLowerCase();
|
|
416
|
-
const extractColorArray = (color) => {
|
|
417
|
-
if (Array.isArray(color) && color.length >= 3) {
|
|
418
|
-
return [color[0], color[1], color[2]];
|
|
419
|
-
}
|
|
420
|
-
if (color && typeof color === 'object') {
|
|
421
|
-
const c = color;
|
|
422
|
-
if (typeof c.r === 'number' && typeof c.g === 'number' && typeof c.b === 'number') {
|
|
423
|
-
return [c.r, c.g, c.b];
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return undefined;
|
|
427
|
-
};
|
|
428
|
-
const colorArr = extractColorArray(params.color);
|
|
429
|
-
switch (typeNorm) {
|
|
430
|
-
case 'directional':
|
|
431
|
-
case 'directionallight':
|
|
432
|
-
return await this.createDirectionalLight({ name, intensity: params.intensity, color: colorArr, rotation: params.rotation });
|
|
433
|
-
case 'spot':
|
|
434
|
-
case 'spotlight':
|
|
435
|
-
return await this.createSpotLight({ name, location: locArr, rotation: (params.rotation ?? [0, 0, 0]), intensity: params.intensity, innerCone: undefined, outerCone: undefined, color: colorArr });
|
|
436
|
-
case 'rect':
|
|
437
|
-
case 'rectlight':
|
|
438
|
-
return await this.createRectLight({ name, location: locArr, rotation: (params.rotation ?? [0, 0, 0]), width: undefined, height: undefined, intensity: params.intensity, color: colorArr });
|
|
439
|
-
case 'point':
|
|
440
|
-
default:
|
|
441
|
-
return await this.createPointLight({ name, location: locArr, intensity: params.intensity, radius: undefined, color: colorArr, castShadows: undefined });
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
catch (err) {
|
|
445
|
-
return { success: false, error: `Failed to create dynamic light: ${err}` };
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
async createSkyLight(params) {
|
|
449
|
-
const name = this.normalizeName(params.name);
|
|
450
|
-
if (params.sourceType === 'SpecifiedCubemap' && (!params.cubemapPath || params.cubemapPath.trim().length === 0)) {
|
|
451
|
-
const message = 'cubemapPath is required when sourceType is SpecifiedCubemap';
|
|
452
|
-
return { success: false, error: message, message };
|
|
453
|
-
}
|
|
454
|
-
if (!this.automationBridge) {
|
|
455
|
-
throw new Error('Automation Bridge required for sky light creation');
|
|
456
|
-
}
|
|
457
|
-
try {
|
|
458
|
-
const properties = {};
|
|
459
|
-
if (params.intensity !== undefined)
|
|
460
|
-
properties.Intensity = params.intensity;
|
|
461
|
-
if (params.castShadows !== undefined)
|
|
462
|
-
properties.CastShadows = params.castShadows;
|
|
463
|
-
if (params.realTimeCapture !== undefined)
|
|
464
|
-
properties.RealTimeCapture = params.realTimeCapture;
|
|
465
|
-
if (params.color)
|
|
466
|
-
properties.LightColor = { r: params.color[0], g: params.color[1], b: params.color[2], a: 1.0 };
|
|
467
|
-
const payload = {
|
|
468
|
-
name,
|
|
469
|
-
sourceType: params.sourceType || 'CapturedScene',
|
|
470
|
-
location: params.location,
|
|
471
|
-
rotation: params.rotation,
|
|
472
|
-
properties
|
|
473
|
-
};
|
|
474
|
-
if (params.cubemapPath) {
|
|
475
|
-
payload.cubemapPath = params.cubemapPath;
|
|
476
|
-
}
|
|
477
|
-
if (params.intensity !== undefined) {
|
|
478
|
-
payload.intensity = params.intensity;
|
|
479
|
-
}
|
|
480
|
-
if (params.recapture) {
|
|
481
|
-
payload.recapture = params.recapture;
|
|
482
|
-
}
|
|
483
|
-
const response = await this.automationBridge.sendAutomationRequest('spawn_sky_light', payload, {
|
|
484
|
-
timeoutMs: 60000
|
|
485
|
-
});
|
|
486
|
-
if (response.success === false) {
|
|
487
|
-
return {
|
|
488
|
-
success: false,
|
|
489
|
-
error: response.error || response.message || 'Failed to create sky light'
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
return {
|
|
493
|
-
success: true,
|
|
494
|
-
message: response.message || 'Sky light created',
|
|
495
|
-
...(response.result || {})
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
catch (error) {
|
|
499
|
-
return {
|
|
500
|
-
success: false,
|
|
501
|
-
error: `Failed to create sky light: ${error instanceof Error ? error.message : String(error)}`
|
|
502
|
-
};
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
async ensureSingleSkyLight(params) {
|
|
506
|
-
const defaultName = 'MCP_Test_Sky';
|
|
507
|
-
const name = this.normalizeName(params?.name, defaultName);
|
|
508
|
-
const recapture = !!params?.recapture;
|
|
509
|
-
if (!this.automationBridge) {
|
|
510
|
-
throw new Error('Automation Bridge required for sky light management');
|
|
511
|
-
}
|
|
512
|
-
try {
|
|
513
|
-
const response = await this.automationBridge.sendAutomationRequest('ensure_single_sky_light', {
|
|
514
|
-
name,
|
|
515
|
-
recapture
|
|
516
|
-
}, {
|
|
517
|
-
timeoutMs: 60000
|
|
518
|
-
});
|
|
519
|
-
if (response.success === false) {
|
|
520
|
-
return {
|
|
521
|
-
success: false,
|
|
522
|
-
error: response.error || response.message || 'Failed to ensure single sky light'
|
|
523
|
-
};
|
|
524
|
-
}
|
|
525
|
-
const resultObj = (response.result ?? {});
|
|
526
|
-
return {
|
|
527
|
-
success: true,
|
|
528
|
-
message: response.message || `Ensured single SkyLight (removed ${resultObj.removed ?? 0})`,
|
|
529
|
-
...resultObj
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
catch (error) {
|
|
533
|
-
return {
|
|
534
|
-
success: false,
|
|
535
|
-
error: `Failed to ensure single sky light: ${error instanceof Error ? error.message : String(error)}`
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
async setupGlobalIllumination(params) {
|
|
540
|
-
if (!params.method) {
|
|
541
|
-
return {
|
|
542
|
-
success: false,
|
|
543
|
-
error: 'MISSING_REQUIRED_PARAM',
|
|
544
|
-
message: "'method' parameter is required for setup_global_illumination"
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
if (this.automationBridge) {
|
|
548
|
-
try {
|
|
549
|
-
const response = await this.automationBridge.sendAutomationRequest('setup_global_illumination', {
|
|
550
|
-
method: params.method,
|
|
551
|
-
quality: params.quality,
|
|
552
|
-
indirectLightingIntensity: params.indirectLightingIntensity,
|
|
553
|
-
bounces: params.bounces
|
|
554
|
-
});
|
|
555
|
-
if (response.success) {
|
|
556
|
-
return { success: true, message: 'Global illumination configured via bridge', ...(response.result || {}) };
|
|
557
|
-
}
|
|
558
|
-
return {
|
|
559
|
-
success: false,
|
|
560
|
-
error: response.error || 'BRIDGE_ERROR',
|
|
561
|
-
message: response.message || 'Failed to configure global illumination via bridge'
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
catch (e) {
|
|
565
|
-
log.debug(`Bridge error for setup_global_illumination, falling back to console: ${e}`);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
const commands = [];
|
|
569
|
-
switch (params.method) {
|
|
570
|
-
case 'Lightmass':
|
|
571
|
-
commands.push('r.DynamicGlobalIlluminationMethod 0');
|
|
572
|
-
break;
|
|
573
|
-
case 'LumenGI':
|
|
574
|
-
commands.push('r.DynamicGlobalIlluminationMethod 1');
|
|
575
|
-
break;
|
|
576
|
-
case 'ScreenSpace':
|
|
577
|
-
commands.push('r.DynamicGlobalIlluminationMethod 2');
|
|
578
|
-
break;
|
|
579
|
-
case 'None':
|
|
580
|
-
commands.push('r.DynamicGlobalIlluminationMethod 3');
|
|
581
|
-
break;
|
|
582
|
-
}
|
|
583
|
-
if (params.quality) {
|
|
584
|
-
const qualityMap = { 'Low': 0, 'Medium': 1, 'High': 2, 'Epic': 3 };
|
|
585
|
-
const qualityValue = qualityMap[params.quality] ?? 1;
|
|
586
|
-
commands.push(`r.Lumen.Quality ${qualityValue}`);
|
|
587
|
-
}
|
|
588
|
-
if (params.indirectLightingIntensity !== undefined) {
|
|
589
|
-
commands.push(`r.IndirectLightingIntensity ${params.indirectLightingIntensity}`);
|
|
590
|
-
}
|
|
591
|
-
if (params.bounces !== undefined) {
|
|
592
|
-
commands.push(`r.Lumen.MaxReflectionBounces ${params.bounces}`);
|
|
593
|
-
}
|
|
594
|
-
if (commands.length > 0) {
|
|
595
|
-
await this.bridge.executeBatchConsoleCommands(commands);
|
|
596
|
-
}
|
|
597
|
-
return { success: true, message: 'Global illumination configured (console)' };
|
|
598
|
-
}
|
|
599
|
-
async configureShadows(params) {
|
|
600
|
-
if (this.automationBridge) {
|
|
601
|
-
try {
|
|
602
|
-
const response = await this.automationBridge.sendAutomationRequest('configure_shadows', {
|
|
603
|
-
shadowQuality: params.shadowQuality,
|
|
604
|
-
cascadedShadows: params.cascadedShadows,
|
|
605
|
-
shadowDistance: params.shadowDistance,
|
|
606
|
-
contactShadows: params.contactShadows,
|
|
607
|
-
rayTracedShadows: params.rayTracedShadows,
|
|
608
|
-
virtualShadowMaps: params.rayTracedShadows
|
|
609
|
-
});
|
|
610
|
-
if (response.success)
|
|
611
|
-
return { success: true, message: 'Shadow settings configured via bridge', ...(response.result || {}) };
|
|
612
|
-
}
|
|
613
|
-
catch (_e) {
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
const commands = [];
|
|
617
|
-
if (params.shadowQuality) {
|
|
618
|
-
const qualityMap = { 'Low': 0, 'Medium': 1, 'High': 2, 'Epic': 3 };
|
|
619
|
-
const qualityValue = qualityMap[params.shadowQuality] ?? 1;
|
|
620
|
-
commands.push(`r.ShadowQuality ${qualityValue}`);
|
|
621
|
-
}
|
|
622
|
-
if (params.cascadedShadows !== undefined) {
|
|
623
|
-
commands.push(`r.Shadow.CSM.MaxCascades ${params.cascadedShadows ? 4 : 1}`);
|
|
624
|
-
}
|
|
625
|
-
if (params.shadowDistance !== undefined) {
|
|
626
|
-
commands.push(`r.Shadow.DistanceScale ${params.shadowDistance}`);
|
|
627
|
-
}
|
|
628
|
-
if (params.contactShadows !== undefined) {
|
|
629
|
-
commands.push(`r.ContactShadows ${params.contactShadows ? 1 : 0}`);
|
|
630
|
-
}
|
|
631
|
-
if (params.rayTracedShadows !== undefined) {
|
|
632
|
-
commands.push(`r.RayTracing.Shadows ${params.rayTracedShadows ? 1 : 0}`);
|
|
633
|
-
}
|
|
634
|
-
if (commands.length > 0) {
|
|
635
|
-
await this.bridge.executeBatchConsoleCommands(commands);
|
|
636
|
-
}
|
|
637
|
-
return { success: true, message: 'Shadow settings configured (console)' };
|
|
638
|
-
}
|
|
639
|
-
async buildLighting(params) {
|
|
640
|
-
if (!this.automationBridge) {
|
|
641
|
-
throw new Error('Automation Bridge required for lighting build');
|
|
642
|
-
}
|
|
643
|
-
try {
|
|
644
|
-
const response = await this.automationBridge.sendAutomationRequest('bake_lightmap', {
|
|
645
|
-
quality: params.quality || 'High',
|
|
646
|
-
buildOnlySelected: params.buildOnlySelected || false,
|
|
647
|
-
buildReflectionCaptures: params.buildReflectionCaptures !== false,
|
|
648
|
-
levelPath: params.levelPath
|
|
649
|
-
}, {
|
|
650
|
-
timeoutMs: 300000
|
|
651
|
-
});
|
|
652
|
-
if (response.success === false) {
|
|
653
|
-
return {
|
|
654
|
-
success: false,
|
|
655
|
-
error: response.error || response.message || 'Failed to build lighting'
|
|
656
|
-
};
|
|
657
|
-
}
|
|
658
|
-
return {
|
|
659
|
-
success: true,
|
|
660
|
-
message: response.message || 'Lighting build started',
|
|
661
|
-
...(response.result || {})
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
catch (error) {
|
|
665
|
-
return {
|
|
666
|
-
success: false,
|
|
667
|
-
error: `Failed to build lighting: ${error instanceof Error ? error.message : String(error)}`
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
async createLightingEnabledLevel(params) {
|
|
672
|
-
let path = params?.path;
|
|
673
|
-
if (!path && params?.levelName) {
|
|
674
|
-
path = `/Game/Maps/${params.levelName}`;
|
|
675
|
-
}
|
|
676
|
-
const levelName = params?.levelName || 'LightingEnabledLevel';
|
|
677
|
-
if (!this.automationBridge) {
|
|
678
|
-
throw new Error('Automation Bridge not available. Level creation requires plugin support.');
|
|
679
|
-
}
|
|
680
|
-
if (!path) {
|
|
681
|
-
path = `/Game/Maps/${levelName}`;
|
|
682
|
-
}
|
|
683
|
-
try {
|
|
684
|
-
const response = await this.automationBridge.sendAutomationRequest('create_lighting_enabled_level', {
|
|
685
|
-
path,
|
|
686
|
-
levelName,
|
|
687
|
-
copyActors: params?.copyActors === true,
|
|
688
|
-
useTemplate: params?.useTemplate === true,
|
|
689
|
-
}, {
|
|
690
|
-
timeoutMs: 120000
|
|
691
|
-
});
|
|
692
|
-
if (response.success === false) {
|
|
693
|
-
return {
|
|
694
|
-
success: false,
|
|
695
|
-
error: response.error || response.message || 'Failed to create level'
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
return {
|
|
699
|
-
success: true,
|
|
700
|
-
message: response.message || `Created new level "${levelName}" with lighting enabled`,
|
|
701
|
-
...(response.result || {})
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
catch (error) {
|
|
705
|
-
return {
|
|
706
|
-
success: false,
|
|
707
|
-
error: `Failed to create lighting-enabled level: ${error}`
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
async createLightmassVolume(params) {
|
|
712
|
-
const name = this.normalizeName(params.name);
|
|
713
|
-
if (!this.automationBridge) {
|
|
714
|
-
throw new Error('Automation Bridge not available. Lightmass volume creation requires plugin support.');
|
|
715
|
-
}
|
|
716
|
-
const toVector3 = (val, defaultVal) => {
|
|
717
|
-
if (Array.isArray(val) && val.length >= 3) {
|
|
718
|
-
return [Number(val[0]) || 0, Number(val[1]) || 0, Number(val[2]) || 0];
|
|
719
|
-
}
|
|
720
|
-
if (val && typeof val === 'object') {
|
|
721
|
-
const obj = val;
|
|
722
|
-
return [Number(obj.x) || 0, Number(obj.y) || 0, Number(obj.z) || 0];
|
|
723
|
-
}
|
|
724
|
-
return defaultVal;
|
|
725
|
-
};
|
|
726
|
-
const locArr = toVector3(params.location, [0, 0, 0]);
|
|
727
|
-
const sizeArr = toVector3(params.size, [1000, 1000, 1000]);
|
|
728
|
-
try {
|
|
729
|
-
const response = await this.automationBridge.sendAutomationRequest('create_lightmass_volume', {
|
|
730
|
-
name,
|
|
731
|
-
location: { x: locArr[0], y: locArr[1], z: locArr[2] },
|
|
732
|
-
size: { x: sizeArr[0], y: sizeArr[1], z: sizeArr[2] }
|
|
733
|
-
}, {
|
|
734
|
-
timeoutMs: 60000
|
|
735
|
-
});
|
|
736
|
-
if (response.success === false) {
|
|
737
|
-
return {
|
|
738
|
-
success: false,
|
|
739
|
-
error: response.error || response.message || 'Failed to create lightmass volume'
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
return {
|
|
743
|
-
success: true,
|
|
744
|
-
message: `LightmassImportanceVolume '${name}' created`,
|
|
745
|
-
...(response.result || {})
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
catch (error) {
|
|
749
|
-
return {
|
|
750
|
-
success: false,
|
|
751
|
-
error: `Failed to create lightmass volume: ${error}`
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
async setExposure(params) {
|
|
756
|
-
if (this.automationBridge) {
|
|
757
|
-
try {
|
|
758
|
-
const response = await this.automationBridge.sendAutomationRequest('set_exposure', {
|
|
759
|
-
method: params.method,
|
|
760
|
-
compensationValue: params.compensationValue,
|
|
761
|
-
minBrightness: params.minBrightness,
|
|
762
|
-
maxBrightness: params.maxBrightness
|
|
763
|
-
});
|
|
764
|
-
if (response.success)
|
|
765
|
-
return { success: true, message: 'Exposure settings updated via bridge', ...(response.result || {}) };
|
|
766
|
-
}
|
|
767
|
-
catch (_e) {
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
const commands = [];
|
|
771
|
-
commands.push(`r.EyeAdaptation.ExposureMethod ${params.method === 'Manual' ? 0 : 1}`);
|
|
772
|
-
if (params.compensationValue !== undefined) {
|
|
773
|
-
commands.push(`r.EyeAdaptation.ExposureCompensation ${params.compensationValue}`);
|
|
774
|
-
}
|
|
775
|
-
if (params.minBrightness !== undefined) {
|
|
776
|
-
commands.push(`r.EyeAdaptation.MinBrightness ${params.minBrightness}`);
|
|
777
|
-
}
|
|
778
|
-
if (params.maxBrightness !== undefined) {
|
|
779
|
-
commands.push(`r.EyeAdaptation.MaxBrightness ${params.maxBrightness}`);
|
|
780
|
-
}
|
|
781
|
-
if (commands.length > 0) {
|
|
782
|
-
await this.bridge.executeBatchConsoleCommands(commands);
|
|
783
|
-
}
|
|
784
|
-
return { success: true, message: 'Exposure settings updated (console)' };
|
|
785
|
-
}
|
|
786
|
-
async setAmbientOcclusion(params) {
|
|
787
|
-
if (this.automationBridge) {
|
|
788
|
-
try {
|
|
789
|
-
const response = await this.automationBridge.sendAutomationRequest('set_ambient_occlusion', {
|
|
790
|
-
enabled: params.enabled,
|
|
791
|
-
intensity: params.intensity,
|
|
792
|
-
radius: params.radius,
|
|
793
|
-
quality: params.quality
|
|
794
|
-
});
|
|
795
|
-
if (response.success)
|
|
796
|
-
return { success: true, message: 'Ambient occlusion configured via bridge', ...(response.result || {}) };
|
|
797
|
-
}
|
|
798
|
-
catch (_e) {
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
const commands = [];
|
|
802
|
-
commands.push(`r.AmbientOcclusion.Enabled ${params.enabled ? 1 : 0}`);
|
|
803
|
-
if (params.intensity !== undefined) {
|
|
804
|
-
commands.push(`r.AmbientOcclusion.Intensity ${params.intensity}`);
|
|
805
|
-
}
|
|
806
|
-
if (params.radius !== undefined) {
|
|
807
|
-
commands.push(`r.AmbientOcclusion.Radius ${params.radius}`);
|
|
808
|
-
}
|
|
809
|
-
if (params.quality) {
|
|
810
|
-
const qualityMap = { 'Low': 0, 'Medium': 1, 'High': 2 };
|
|
811
|
-
const qualityValue = qualityMap[params.quality] ?? 1;
|
|
812
|
-
commands.push(`r.AmbientOcclusion.Quality ${qualityValue}`);
|
|
813
|
-
}
|
|
814
|
-
if (commands.length > 0) {
|
|
815
|
-
await this.bridge.executeBatchConsoleCommands(commands);
|
|
816
|
-
}
|
|
817
|
-
return { success: true, message: 'Ambient occlusion configured (console)' };
|
|
818
|
-
}
|
|
819
|
-
async setupVolumetricFog(params) {
|
|
820
|
-
await this.bridge.executeConsoleCommand(`r.VolumetricFog ${params.enabled ? 1 : 0}`);
|
|
821
|
-
if (!this.automationBridge) {
|
|
822
|
-
return {
|
|
823
|
-
success: true,
|
|
824
|
-
message: 'Volumetric fog console setting applied (plugin required for fog actor adjustment)'
|
|
825
|
-
};
|
|
826
|
-
}
|
|
827
|
-
try {
|
|
828
|
-
const response = await this.automationBridge.sendAutomationRequest('setup_volumetric_fog', {
|
|
829
|
-
enabled: params.enabled,
|
|
830
|
-
density: params.density,
|
|
831
|
-
scatteringIntensity: params.scatteringIntensity,
|
|
832
|
-
fogHeight: params.fogHeight
|
|
833
|
-
}, {
|
|
834
|
-
timeoutMs: 60000
|
|
835
|
-
});
|
|
836
|
-
if (response.success === false) {
|
|
837
|
-
return {
|
|
838
|
-
success: false,
|
|
839
|
-
error: response.error || response.message || 'Failed to configure volumetric fog'
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
return {
|
|
843
|
-
success: true,
|
|
844
|
-
message: 'Volumetric fog configured',
|
|
845
|
-
...(response.result || {})
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
catch (error) {
|
|
849
|
-
return {
|
|
850
|
-
success: false,
|
|
851
|
-
error: `Failed to setup volumetric fog: ${error}`
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
//# sourceMappingURL=lighting.js.map
|