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/animation.js
DELETED
|
@@ -1,773 +0,0 @@
|
|
|
1
|
-
import { cleanObject } from '../utils/safe-json.js';
|
|
2
|
-
import { validateAssetParams, sanitizeCommandArgument } from '../utils/validation.js';
|
|
3
|
-
export class AnimationTools {
|
|
4
|
-
bridge;
|
|
5
|
-
managedArtifacts = new Map();
|
|
6
|
-
automationBridge;
|
|
7
|
-
constructor(bridge, automationBridge) {
|
|
8
|
-
this.bridge = bridge;
|
|
9
|
-
this.automationBridge = automationBridge;
|
|
10
|
-
}
|
|
11
|
-
setAutomationBridge(automationBridge) {
|
|
12
|
-
this.automationBridge = automationBridge;
|
|
13
|
-
}
|
|
14
|
-
trackArtifact(key, info) {
|
|
15
|
-
this.managedArtifacts.set(key, { ...info, createdAt: Date.now() });
|
|
16
|
-
}
|
|
17
|
-
async createAnimationBlueprint(params) {
|
|
18
|
-
try {
|
|
19
|
-
const targetPath = params.savePath ?? '/Game/Animations';
|
|
20
|
-
const validation = validateAssetParams({ name: params.name, savePath: targetPath });
|
|
21
|
-
if (!validation.valid) {
|
|
22
|
-
const message = validation.error ?? 'Invalid asset parameters';
|
|
23
|
-
return { success: false, message, error: message };
|
|
24
|
-
}
|
|
25
|
-
const sanitized = validation.sanitized;
|
|
26
|
-
const assetName = sanitized.name;
|
|
27
|
-
const assetPath = sanitized.savePath ?? targetPath;
|
|
28
|
-
const fullPath = `${assetPath}/${assetName}`;
|
|
29
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
30
|
-
try {
|
|
31
|
-
const resp = await this.automationBridge.sendAutomationRequest('create_animation_blueprint', {
|
|
32
|
-
name: assetName,
|
|
33
|
-
skeletonPath: params.skeletonPath,
|
|
34
|
-
savePath: assetPath
|
|
35
|
-
}, { timeoutMs: 60000 });
|
|
36
|
-
const result = resp?.result ?? resp;
|
|
37
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
38
|
-
const warnings = Array.isArray(resultObj?.warnings) ? resultObj.warnings : undefined;
|
|
39
|
-
const details = Array.isArray(resultObj?.details) ? resultObj.details : undefined;
|
|
40
|
-
const isSuccess = resp && resp.success !== false && !!resultObj;
|
|
41
|
-
if (isSuccess && resultObj) {
|
|
42
|
-
const blueprintPath = typeof resultObj.blueprintPath === 'string' ? resultObj.blueprintPath : fullPath;
|
|
43
|
-
this.trackArtifact(assetName, { path: blueprintPath, type: 'AnimationBlueprint' });
|
|
44
|
-
return {
|
|
45
|
-
success: true,
|
|
46
|
-
message: resp.message || `Animation Blueprint created at ${blueprintPath}`,
|
|
47
|
-
path: blueprintPath,
|
|
48
|
-
skeleton: params.skeletonPath,
|
|
49
|
-
warnings,
|
|
50
|
-
details
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const message = typeof resp?.message === 'string'
|
|
54
|
-
? resp.message
|
|
55
|
-
: (typeof resp?.error === 'string' ? resp.error : 'Animation Blueprint creation failed');
|
|
56
|
-
const error = typeof resp?.error === 'string' ? resp.error : message;
|
|
57
|
-
return {
|
|
58
|
-
success: false,
|
|
59
|
-
message,
|
|
60
|
-
error,
|
|
61
|
-
path: fullPath,
|
|
62
|
-
skeleton: params.skeletonPath,
|
|
63
|
-
warnings,
|
|
64
|
-
details
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
catch (err) {
|
|
68
|
-
const error = String(err);
|
|
69
|
-
return {
|
|
70
|
-
success: false,
|
|
71
|
-
message: `Failed to create Animation Blueprint: ${error}`,
|
|
72
|
-
error,
|
|
73
|
-
path: fullPath,
|
|
74
|
-
skeleton: params.skeletonPath
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
success: false,
|
|
80
|
-
message: 'Automation bridge not connected for Animation Blueprint creation',
|
|
81
|
-
error: 'AUTOMATION_BRIDGE_UNAVAILABLE',
|
|
82
|
-
path: fullPath,
|
|
83
|
-
skeleton: params.skeletonPath
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
catch (err) {
|
|
87
|
-
const error = `Failed to create Animation Blueprint: ${err}`;
|
|
88
|
-
return { success: false, message: error, error: String(err) };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
async addStateMachine(params) {
|
|
92
|
-
try {
|
|
93
|
-
if (!params.blueprintPath || !params.machineName) {
|
|
94
|
-
return { success: false, error: 'blueprintPath and machineName are required' };
|
|
95
|
-
}
|
|
96
|
-
const safeBlueprintPath = sanitizeCommandArgument(params.blueprintPath);
|
|
97
|
-
const safeMachineName = sanitizeCommandArgument(params.machineName);
|
|
98
|
-
if (!safeBlueprintPath || !safeMachineName) {
|
|
99
|
-
return { success: false, error: 'Blueprint path and machine name must be valid and non-empty.' };
|
|
100
|
-
}
|
|
101
|
-
const commands = [
|
|
102
|
-
`AddAnimStateMachine ${safeBlueprintPath} ${safeMachineName}`
|
|
103
|
-
];
|
|
104
|
-
for (const state of params.states) {
|
|
105
|
-
const safeStateName = sanitizeCommandArgument(state.name);
|
|
106
|
-
const safeAnimationName = state.animation ? sanitizeCommandArgument(state.animation) : '';
|
|
107
|
-
if (!safeStateName) {
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
commands.push(`AddAnimState ${safeBlueprintPath} ${safeMachineName} ${safeStateName} ${safeAnimationName}`);
|
|
111
|
-
if (state.isEntry) {
|
|
112
|
-
commands.push(`SetAnimStateEntry ${safeBlueprintPath} ${safeMachineName} ${safeStateName}`);
|
|
113
|
-
}
|
|
114
|
-
if (state.isExit) {
|
|
115
|
-
commands.push(`SetAnimStateExit ${safeBlueprintPath} ${safeMachineName} ${safeStateName}`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (params.transitions) {
|
|
119
|
-
for (const transition of params.transitions) {
|
|
120
|
-
const safeSourceState = sanitizeCommandArgument(transition.sourceState);
|
|
121
|
-
const safeTargetState = sanitizeCommandArgument(transition.targetState);
|
|
122
|
-
if (!safeSourceState || !safeTargetState) {
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
commands.push(`AddAnimTransition ${safeBlueprintPath} ${safeMachineName} ${safeSourceState} ${safeTargetState}`);
|
|
126
|
-
if (transition.condition) {
|
|
127
|
-
const safeCondition = sanitizeCommandArgument(transition.condition);
|
|
128
|
-
if (safeCondition) {
|
|
129
|
-
commands.push(`SetAnimTransitionRule ${safeBlueprintPath} ${safeMachineName} ${safeSourceState} ${safeTargetState} ${safeCondition}`);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
await this.bridge.executeConsoleCommands(commands);
|
|
135
|
-
return {
|
|
136
|
-
success: true,
|
|
137
|
-
message: `State machine ${safeMachineName} added to ${safeBlueprintPath}`
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
catch (err) {
|
|
141
|
-
return { success: false, error: `Failed to add state machine: ${err}` };
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async createStateMachine(params) {
|
|
145
|
-
try {
|
|
146
|
-
const rawName = typeof params.machineName === 'string' ? params.machineName.trim() : '';
|
|
147
|
-
const machineName = rawName || 'StateMachine';
|
|
148
|
-
const normalizedStates = Array.isArray(params.states)
|
|
149
|
-
? params.states
|
|
150
|
-
.map((s) => {
|
|
151
|
-
if (typeof s === 'string') {
|
|
152
|
-
const name = s.trim();
|
|
153
|
-
return name ? { name } : undefined;
|
|
154
|
-
}
|
|
155
|
-
if (s && typeof s === 'object') {
|
|
156
|
-
const stateObj = s;
|
|
157
|
-
if (typeof stateObj.name === 'string') {
|
|
158
|
-
const name = stateObj.name.trim();
|
|
159
|
-
if (!name)
|
|
160
|
-
return undefined;
|
|
161
|
-
return s;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return undefined;
|
|
165
|
-
})
|
|
166
|
-
.filter((s) => !!s)
|
|
167
|
-
: [];
|
|
168
|
-
const normalizedTransitionsRaw = Array.isArray(params.transitions)
|
|
169
|
-
? params.transitions
|
|
170
|
-
.map((t) => {
|
|
171
|
-
if (!t || typeof t !== 'object')
|
|
172
|
-
return undefined;
|
|
173
|
-
const tObj = t;
|
|
174
|
-
const src = (String(tObj.sourceState ?? '') || '').trim();
|
|
175
|
-
const dst = (String(tObj.targetState ?? '') || '').trim();
|
|
176
|
-
if (!src || !dst)
|
|
177
|
-
return undefined;
|
|
178
|
-
return { sourceState: src, targetState: dst, condition: tObj.condition };
|
|
179
|
-
})
|
|
180
|
-
.filter((t) => !!t)
|
|
181
|
-
: [];
|
|
182
|
-
const normalizedTransitions = normalizedTransitionsRaw;
|
|
183
|
-
const blueprintPath = typeof params.blueprintPath === 'string' && params.blueprintPath.trim().length > 0
|
|
184
|
-
? params.blueprintPath.trim()
|
|
185
|
-
: undefined;
|
|
186
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
187
|
-
const bridge = this.automationBridge;
|
|
188
|
-
try {
|
|
189
|
-
const payload = cleanObject({
|
|
190
|
-
subAction: 'add_state_machine',
|
|
191
|
-
blueprintPath,
|
|
192
|
-
stateMachineName: machineName
|
|
193
|
-
});
|
|
194
|
-
const resp = await bridge.sendAutomationRequest('manage_animation_authoring', payload, { timeoutMs: 60000 });
|
|
195
|
-
const result = resp?.result ?? resp;
|
|
196
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
197
|
-
const isSuccess = resp && resp.success !== false && !!resultObj;
|
|
198
|
-
if (isSuccess && resultObj) {
|
|
199
|
-
const key = `StateMachine:${machineName}`;
|
|
200
|
-
this.trackArtifact(key, {
|
|
201
|
-
path: blueprintPath,
|
|
202
|
-
type: 'AnimationStateMachine',
|
|
203
|
-
metadata: {
|
|
204
|
-
machineName,
|
|
205
|
-
states: normalizedStates,
|
|
206
|
-
transitions: normalizedTransitions
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
const addedStateNames = [];
|
|
210
|
-
if (normalizedStates.length > 0) {
|
|
211
|
-
const stateResults = await Promise.all(normalizedStates.map(state => bridge.sendAutomationRequest('manage_animation_authoring', cleanObject({
|
|
212
|
-
subAction: 'add_state',
|
|
213
|
-
blueprintPath,
|
|
214
|
-
stateMachineName: machineName,
|
|
215
|
-
stateName: state.name
|
|
216
|
-
}), { timeoutMs: 30000 })));
|
|
217
|
-
const failedState = stateResults.find((r) => r && r.success === false);
|
|
218
|
-
if (failedState) {
|
|
219
|
-
const failed = failedState;
|
|
220
|
-
return {
|
|
221
|
-
success: false,
|
|
222
|
-
message: 'Failed to add one or more states',
|
|
223
|
-
error: failed.error || failed.message || 'Unknown error'
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
for (const state of normalizedStates) {
|
|
227
|
-
addedStateNames.push(state.name);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
if (normalizedTransitions.length > 0) {
|
|
231
|
-
const transitionResults = await Promise.all(normalizedTransitions.map(transition => bridge.sendAutomationRequest('manage_animation_authoring', cleanObject({
|
|
232
|
-
subAction: 'add_transition',
|
|
233
|
-
blueprintPath,
|
|
234
|
-
stateMachineName: machineName,
|
|
235
|
-
fromState: transition.sourceState,
|
|
236
|
-
toState: transition.targetState,
|
|
237
|
-
crossfadeDuration: 0.2
|
|
238
|
-
}), { timeoutMs: 30000 })));
|
|
239
|
-
const failedTransition = transitionResults.find((r) => r && r.success === false);
|
|
240
|
-
if (failedTransition) {
|
|
241
|
-
const failed = failedTransition;
|
|
242
|
-
if (addedStateNames.length > 0) {
|
|
243
|
-
await Promise.all(addedStateNames.map(stateName => bridge.sendAutomationRequest('manage_animation_authoring', cleanObject({
|
|
244
|
-
subAction: 'delete_state',
|
|
245
|
-
blueprintPath,
|
|
246
|
-
stateMachineName: machineName,
|
|
247
|
-
stateName
|
|
248
|
-
}), { timeoutMs: 10000 }).catch(() => {
|
|
249
|
-
})));
|
|
250
|
-
}
|
|
251
|
-
return {
|
|
252
|
-
success: false,
|
|
253
|
-
message: 'Failed to add one or more transitions (rolled back added states)',
|
|
254
|
-
error: failed.error || failed.message || 'Unknown error'
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
success: true,
|
|
260
|
-
message: resp.message || `State machine '${machineName}' created in blueprint`,
|
|
261
|
-
machineName,
|
|
262
|
-
blueprintPath,
|
|
263
|
-
states: normalizedStates.length ? normalizedStates : undefined,
|
|
264
|
-
transitions: normalizedTransitions.length ? normalizedTransitions : undefined
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
const message = typeof resp?.message === 'string'
|
|
268
|
-
? resp.message
|
|
269
|
-
: (typeof resp?.error === 'string' ? resp.error : 'State machine creation failed');
|
|
270
|
-
const error = typeof resp?.error === 'string' ? resp.error : message;
|
|
271
|
-
return { success: false, message, error };
|
|
272
|
-
}
|
|
273
|
-
catch (err) {
|
|
274
|
-
const error = String(err);
|
|
275
|
-
return {
|
|
276
|
-
success: false,
|
|
277
|
-
message: `Failed to create state machine: ${error}`,
|
|
278
|
-
error
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return {
|
|
283
|
-
success: false,
|
|
284
|
-
message: 'Automation bridge not connected for createStateMachine',
|
|
285
|
-
error: 'AUTOMATION_BRIDGE_UNAVAILABLE'
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
const error = String(err);
|
|
290
|
-
return {
|
|
291
|
-
success: false,
|
|
292
|
-
message: `Failed to create state machine: ${error}`,
|
|
293
|
-
error
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
async createBlendSpace(params) {
|
|
298
|
-
try {
|
|
299
|
-
const targetPath = params.savePath ?? params.path ?? '/Game/Animations';
|
|
300
|
-
const validation = validateAssetParams({ name: params.name ?? 'BlendSpace', savePath: targetPath });
|
|
301
|
-
if (!validation.valid) {
|
|
302
|
-
return { success: false, error: validation.error ?? 'Invalid asset parameters' };
|
|
303
|
-
}
|
|
304
|
-
const sanitized = validation.sanitized;
|
|
305
|
-
const assetName = sanitized.name;
|
|
306
|
-
const assetPath = sanitized.savePath ?? targetPath;
|
|
307
|
-
const dimensions = params.dimensions === 2 ? 2 : 1;
|
|
308
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
309
|
-
try {
|
|
310
|
-
const payload = {
|
|
311
|
-
action: 'create_blend_space',
|
|
312
|
-
name: assetName,
|
|
313
|
-
savePath: assetPath,
|
|
314
|
-
skeletonPath: params.skeletonPath,
|
|
315
|
-
dimensions,
|
|
316
|
-
samples: params.samples
|
|
317
|
-
};
|
|
318
|
-
if (params.horizontalAxis) {
|
|
319
|
-
payload.minX = params.horizontalAxis.minValue;
|
|
320
|
-
payload.maxX = params.horizontalAxis.maxValue;
|
|
321
|
-
}
|
|
322
|
-
if (params.verticalAxis) {
|
|
323
|
-
payload.minY = params.verticalAxis.minValue;
|
|
324
|
-
payload.maxY = params.verticalAxis.maxValue;
|
|
325
|
-
}
|
|
326
|
-
const resp = await this.automationBridge.sendAutomationRequest('animation_physics', cleanObject(payload));
|
|
327
|
-
const result = resp?.result ?? resp;
|
|
328
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
329
|
-
const isSuccess = resp && resp.success !== false && !!resultObj;
|
|
330
|
-
if (isSuccess && resultObj) {
|
|
331
|
-
const path = typeof resultObj.blendSpacePath === 'string'
|
|
332
|
-
? resultObj.blendSpacePath
|
|
333
|
-
: `${assetPath}/${assetName}`;
|
|
334
|
-
const warnings = Array.isArray(resultObj.warnings) ? resultObj.warnings : undefined;
|
|
335
|
-
const details = resultObj.details;
|
|
336
|
-
return {
|
|
337
|
-
success: true,
|
|
338
|
-
message: resp.message || `Blend Space ${assetName} created`,
|
|
339
|
-
path,
|
|
340
|
-
skeletonPath: params.skeletonPath,
|
|
341
|
-
details,
|
|
342
|
-
warnings
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
const message = typeof resp?.message === 'string'
|
|
346
|
-
? resp.message
|
|
347
|
-
: (typeof resp?.error === 'string' ? resp.error : 'Blend space creation failed');
|
|
348
|
-
const error = typeof resp?.error === 'string' ? resp.error : message;
|
|
349
|
-
return { success: false, error };
|
|
350
|
-
}
|
|
351
|
-
catch (err) {
|
|
352
|
-
const error = String(err);
|
|
353
|
-
return { success: false, error: `Failed to create blend space: ${error}` };
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return { success: false, error: 'Automation bridge not connected for createBlendSpace' };
|
|
357
|
-
}
|
|
358
|
-
catch (err) {
|
|
359
|
-
return { success: false, error: `Failed to create blend space: ${err}` };
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
async setupControlRig(params) {
|
|
363
|
-
try {
|
|
364
|
-
const targetPath = params.savePath ?? '/Game/Animations';
|
|
365
|
-
const validation = validateAssetParams({ name: params.name, savePath: targetPath });
|
|
366
|
-
if (!validation.valid) {
|
|
367
|
-
return { success: false, error: validation.error ?? 'Invalid asset parameters' };
|
|
368
|
-
}
|
|
369
|
-
const sanitized = validation.sanitized;
|
|
370
|
-
const assetName = sanitized.name;
|
|
371
|
-
const assetPath = sanitized.savePath ?? targetPath;
|
|
372
|
-
const fullPath = `${assetPath}/${assetName}`;
|
|
373
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
374
|
-
try {
|
|
375
|
-
const resp = await this.automationBridge.sendAutomationRequest('animation_physics', cleanObject({
|
|
376
|
-
action: 'setup_ik',
|
|
377
|
-
name: assetName,
|
|
378
|
-
savePath: assetPath,
|
|
379
|
-
skeletonPath: params.skeletonPath,
|
|
380
|
-
controls: params.controls
|
|
381
|
-
}), { timeoutMs: 60000 });
|
|
382
|
-
const result = resp?.result ?? resp;
|
|
383
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
384
|
-
const isSuccess = resp && resp.success !== false && !!resultObj;
|
|
385
|
-
if (isSuccess && resultObj) {
|
|
386
|
-
const controlRigPath = typeof resultObj.controlRigPath === 'string'
|
|
387
|
-
? resultObj.controlRigPath
|
|
388
|
-
: fullPath;
|
|
389
|
-
const warnings = Array.isArray(resultObj.warnings) ? resultObj.warnings : undefined;
|
|
390
|
-
const details = resultObj.details;
|
|
391
|
-
this.trackArtifact(assetName, { path: controlRigPath, type: 'ControlRig' });
|
|
392
|
-
return {
|
|
393
|
-
success: true,
|
|
394
|
-
message: resp.message || `Control Rig ${assetName} created`,
|
|
395
|
-
path: controlRigPath,
|
|
396
|
-
warnings,
|
|
397
|
-
details
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
const message = typeof resp?.message === 'string'
|
|
401
|
-
? resp.message
|
|
402
|
-
: (typeof resp?.error === 'string' ? resp.error : 'Control Rig setup failed');
|
|
403
|
-
const error = typeof resp?.error === 'string' ? resp.error : message;
|
|
404
|
-
return { success: false, error };
|
|
405
|
-
}
|
|
406
|
-
catch (err) {
|
|
407
|
-
const error = String(err);
|
|
408
|
-
return { success: false, error: `Failed to setup control rig: ${error}` };
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
return { success: false, error: 'Automation bridge not connected for setupControlRig' };
|
|
412
|
-
}
|
|
413
|
-
catch (err) {
|
|
414
|
-
return { success: false, error: `Failed to setup control rig: ${err}` };
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
async setupIK(params) {
|
|
418
|
-
try {
|
|
419
|
-
const actorName = (params.actorName || 'Character').trim();
|
|
420
|
-
const ikBones = Array.isArray(params.ikBones)
|
|
421
|
-
? params.ikBones.map((b) => String(b)).filter((b) => b.trim().length > 0)
|
|
422
|
-
: [];
|
|
423
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
424
|
-
const resp = await this.automationBridge.sendAutomationRequest('animation_physics', {
|
|
425
|
-
action: 'setup_ik',
|
|
426
|
-
actorName,
|
|
427
|
-
ikBones,
|
|
428
|
-
enableFootPlacement: params.enableFootPlacement === true
|
|
429
|
-
}, { timeoutMs: 60000 });
|
|
430
|
-
if (resp && resp.success !== false) {
|
|
431
|
-
const key = `IK:${actorName}`;
|
|
432
|
-
this.trackArtifact(key, {
|
|
433
|
-
type: 'IKSetup',
|
|
434
|
-
metadata: {
|
|
435
|
-
actorName,
|
|
436
|
-
ikBones,
|
|
437
|
-
enableFootPlacement: params.enableFootPlacement === true
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
return {
|
|
441
|
-
success: true,
|
|
442
|
-
message: resp.message || `IK setup completed for actor "${actorName}"`,
|
|
443
|
-
actorName,
|
|
444
|
-
ikBones: ikBones.length ? ikBones : undefined,
|
|
445
|
-
enableFootPlacement: params.enableFootPlacement === true ? true : undefined
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
return { success: false, message: resp?.message || 'IK setup failed', error: resp?.error || 'BRIDGE_ERROR' };
|
|
449
|
-
}
|
|
450
|
-
return { success: false, message: 'Automation bridge not connected', error: 'AUTOMATION_BRIDGE_UNAVAILABLE' };
|
|
451
|
-
}
|
|
452
|
-
catch (err) {
|
|
453
|
-
const error = String(err);
|
|
454
|
-
return {
|
|
455
|
-
success: false,
|
|
456
|
-
message: `Failed to setup IK: ${error}`,
|
|
457
|
-
error
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
async createProceduralAnim(params) {
|
|
462
|
-
try {
|
|
463
|
-
const baseName = (params.systemName || '').trim()
|
|
464
|
-
|| (params.baseAnimation ? params.baseAnimation.split('/').pop() || '' : '');
|
|
465
|
-
const systemName = baseName || 'ProceduralSystem';
|
|
466
|
-
const basePath = (params.savePath || '/Game/Animations').replace(/\/+$/, '');
|
|
467
|
-
const path = `${basePath || '/Game/Animations'}/${systemName}`;
|
|
468
|
-
this.trackArtifact(systemName, {
|
|
469
|
-
path,
|
|
470
|
-
type: 'ProceduralAnimation',
|
|
471
|
-
metadata: {
|
|
472
|
-
baseAnimation: params.baseAnimation,
|
|
473
|
-
modifiers: Array.isArray(params.modifiers) ? params.modifiers : []
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
return {
|
|
477
|
-
success: true,
|
|
478
|
-
message: `Procedural animation system '${systemName}' specification recorded at ${path}`,
|
|
479
|
-
path,
|
|
480
|
-
systemName
|
|
481
|
-
};
|
|
482
|
-
}
|
|
483
|
-
catch (err) {
|
|
484
|
-
const error = String(err);
|
|
485
|
-
return {
|
|
486
|
-
success: false,
|
|
487
|
-
message: `Failed to record procedural animation system: ${error}`,
|
|
488
|
-
error
|
|
489
|
-
};
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
async createBlendTree(params) {
|
|
493
|
-
try {
|
|
494
|
-
const rawName = (params.treeName || '').trim();
|
|
495
|
-
const treeName = rawName || 'BlendTree';
|
|
496
|
-
const basePath = (params.savePath || '/Game/Animations').replace(/\/+$/, '');
|
|
497
|
-
const path = `${basePath || '/Game/Animations'}/${treeName}`;
|
|
498
|
-
this.trackArtifact(treeName, {
|
|
499
|
-
path,
|
|
500
|
-
type: 'BlendTree',
|
|
501
|
-
metadata: {
|
|
502
|
-
blendType: params.blendType,
|
|
503
|
-
basePose: params.basePose,
|
|
504
|
-
additiveAnimations: Array.isArray(params.additiveAnimations) ? params.additiveAnimations : []
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
return {
|
|
508
|
-
success: true,
|
|
509
|
-
message: `Blend tree '${treeName}' specification recorded at ${path}`,
|
|
510
|
-
path,
|
|
511
|
-
treeName
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
catch (err) {
|
|
515
|
-
const error = String(err);
|
|
516
|
-
return {
|
|
517
|
-
success: false,
|
|
518
|
-
message: `Failed to record blend tree specification: ${error}`,
|
|
519
|
-
error
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
async cleanup(artifacts) {
|
|
524
|
-
try {
|
|
525
|
-
const pathsToDelete = [];
|
|
526
|
-
if (Array.isArray(artifacts) && artifacts.length > 0) {
|
|
527
|
-
pathsToDelete.push(...artifacts.map((a) => String(a).trim()).filter((a) => a.length > 0));
|
|
528
|
-
}
|
|
529
|
-
else {
|
|
530
|
-
for (const [key, val] of this.managedArtifacts.entries()) {
|
|
531
|
-
if (val.path)
|
|
532
|
-
pathsToDelete.push(val.path);
|
|
533
|
-
else
|
|
534
|
-
pathsToDelete.push(key);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
if (pathsToDelete.length === 0) {
|
|
538
|
-
return {
|
|
539
|
-
success: true,
|
|
540
|
-
message: 'No artifacts to cleanup.'
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
let bridgeMessage = '';
|
|
544
|
-
if (this.automationBridge) {
|
|
545
|
-
try {
|
|
546
|
-
const response = await this.automationBridge.sendAutomationRequest('animation_physics', {
|
|
547
|
-
action: 'cleanup',
|
|
548
|
-
artifacts: pathsToDelete
|
|
549
|
-
});
|
|
550
|
-
if (!response.success) {
|
|
551
|
-
bridgeMessage = ` (Engine cleanup failed: ${response.message})`;
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
bridgeMessage = ' (Engine assets deleted)';
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
catch (e) {
|
|
558
|
-
bridgeMessage = ` (Engine connection failed: ${e})`;
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
else {
|
|
562
|
-
bridgeMessage = ' (No automation bridge available)';
|
|
563
|
-
}
|
|
564
|
-
const removed = [];
|
|
565
|
-
const toRemoveKeys = [];
|
|
566
|
-
for (const [key, val] of this.managedArtifacts.entries()) {
|
|
567
|
-
if (pathsToDelete.includes(key) || (val.path && pathsToDelete.includes(val.path))) {
|
|
568
|
-
toRemoveKeys.push(key);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
for (const key of toRemoveKeys) {
|
|
572
|
-
this.managedArtifacts.delete(key);
|
|
573
|
-
removed.push(key);
|
|
574
|
-
}
|
|
575
|
-
for (const path of pathsToDelete) {
|
|
576
|
-
if (!removed.includes(path)) {
|
|
577
|
-
removed.push(path);
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
return {
|
|
581
|
-
success: true,
|
|
582
|
-
message: `Cleanup attempt processed for ${pathsToDelete.length} artifacts${bridgeMessage}`,
|
|
583
|
-
removed
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
catch (err) {
|
|
587
|
-
const error = String(err);
|
|
588
|
-
return {
|
|
589
|
-
success: false,
|
|
590
|
-
message: `Failed to cleanup animation artifacts: ${error}`,
|
|
591
|
-
error
|
|
592
|
-
};
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
async createAnimationAsset(params) {
|
|
596
|
-
try {
|
|
597
|
-
const targetPath = (params.path || params.savePath) ?? '/Game/Animations';
|
|
598
|
-
const validation = validateAssetParams({ name: params.name ?? 'AnimAsset', savePath: targetPath });
|
|
599
|
-
if (!validation.valid) {
|
|
600
|
-
const message = validation.error ?? 'Invalid asset parameters';
|
|
601
|
-
return { success: false, message, error: message };
|
|
602
|
-
}
|
|
603
|
-
const sanitized = validation.sanitized;
|
|
604
|
-
const assetName = sanitized.name;
|
|
605
|
-
const assetPath = sanitized.savePath ?? targetPath;
|
|
606
|
-
const fullPath = `${assetPath}/${assetName}`;
|
|
607
|
-
const normalizedType = (params.assetType || 'sequence').toLowerCase();
|
|
608
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
609
|
-
try {
|
|
610
|
-
const payload = {
|
|
611
|
-
action: 'create_animation_asset',
|
|
612
|
-
name: assetName,
|
|
613
|
-
savePath: assetPath,
|
|
614
|
-
skeletonPath: params.skeletonPath,
|
|
615
|
-
assetType: normalizedType
|
|
616
|
-
};
|
|
617
|
-
const resp = await this.automationBridge.sendAutomationRequest('animation_physics', cleanObject(payload), { timeoutMs: 60000 });
|
|
618
|
-
const result = resp?.result ?? resp;
|
|
619
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
620
|
-
const isSuccess = resp && resp.success !== false && !!resultObj;
|
|
621
|
-
if (isSuccess && resultObj) {
|
|
622
|
-
const assetPathResult = typeof resultObj.assetPath === 'string' ? resultObj.assetPath : fullPath;
|
|
623
|
-
const assetTypeResult = typeof resultObj.assetType === 'string' ? resultObj.assetType : undefined;
|
|
624
|
-
const existingAsset = typeof resultObj.existingAsset === 'boolean' ? Boolean(resultObj.existingAsset) : false;
|
|
625
|
-
this.trackArtifact(assetName, { path: assetPathResult, type: 'AnimationAsset' });
|
|
626
|
-
return {
|
|
627
|
-
success: true,
|
|
628
|
-
message: resp.message || `Animation asset created at ${assetPathResult}`,
|
|
629
|
-
path: assetPathResult,
|
|
630
|
-
assetType: assetTypeResult,
|
|
631
|
-
existingAsset
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
const message = typeof resp?.message === 'string'
|
|
635
|
-
? resp.message
|
|
636
|
-
: (typeof resp?.error === 'string' ? resp.error : 'Animation asset creation failed');
|
|
637
|
-
const error = typeof resp?.error === 'string' ? resp.error : message;
|
|
638
|
-
return { success: false, message, error };
|
|
639
|
-
}
|
|
640
|
-
catch (err) {
|
|
641
|
-
const error = String(err);
|
|
642
|
-
return {
|
|
643
|
-
success: false,
|
|
644
|
-
message: `Failed to create animation asset: ${error}`,
|
|
645
|
-
error
|
|
646
|
-
};
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
return {
|
|
650
|
-
success: false,
|
|
651
|
-
message: 'Automation bridge not connected for createAnimationAsset',
|
|
652
|
-
error: 'AUTOMATION_BRIDGE_UNAVAILABLE'
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
|
-
catch (err) {
|
|
656
|
-
const error = String(err);
|
|
657
|
-
return {
|
|
658
|
-
success: false,
|
|
659
|
-
message: `Failed to create animation asset: ${error}`,
|
|
660
|
-
error
|
|
661
|
-
};
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
async addNotify(params) {
|
|
665
|
-
try {
|
|
666
|
-
const rawPath = (params.animationPath || params.assetPath || '').trim();
|
|
667
|
-
if (!rawPath) {
|
|
668
|
-
const error = 'animationPath or assetPath is required for addNotify';
|
|
669
|
-
return { success: false, message: error, error };
|
|
670
|
-
}
|
|
671
|
-
const notifyName = (params.notifyName || 'Notify').trim();
|
|
672
|
-
const time = typeof params.time === 'number' && params.time >= 0 ? params.time : 0;
|
|
673
|
-
if (this.automationBridge && typeof this.automationBridge.sendAutomationRequest === 'function') {
|
|
674
|
-
try {
|
|
675
|
-
const resp = await this.automationBridge.sendAutomationRequest('animation_physics', cleanObject({
|
|
676
|
-
action: 'add_notify',
|
|
677
|
-
assetPath: rawPath,
|
|
678
|
-
notifyName,
|
|
679
|
-
time
|
|
680
|
-
}), { timeoutMs: 60000 });
|
|
681
|
-
const result = resp?.result ?? resp;
|
|
682
|
-
const resultObj = result && typeof result === 'object' ? result : undefined;
|
|
683
|
-
if (resp && resp.success !== false && resultObj) {
|
|
684
|
-
return {
|
|
685
|
-
success: true,
|
|
686
|
-
message: resp.message || `Notify '${notifyName}' added to ${rawPath} at time ${time}`,
|
|
687
|
-
assetPath: typeof resultObj.assetPath === 'string' ? resultObj.assetPath : rawPath,
|
|
688
|
-
notifyName,
|
|
689
|
-
time
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
catch (err) {
|
|
694
|
-
const error = String(err);
|
|
695
|
-
return {
|
|
696
|
-
success: false,
|
|
697
|
-
message: `Failed to add notify: ${error}`,
|
|
698
|
-
error
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
success: false,
|
|
704
|
-
message: 'Automation bridge not connected for addNotify',
|
|
705
|
-
error: 'AUTOMATION_BRIDGE_UNAVAILABLE'
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
catch (err) {
|
|
709
|
-
const error = String(err);
|
|
710
|
-
return {
|
|
711
|
-
success: false,
|
|
712
|
-
message: `Failed to add notify: ${error}`,
|
|
713
|
-
error
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
async createLevelSequence(params) {
|
|
718
|
-
try {
|
|
719
|
-
const targetPath = params.savePath ?? '/Game/Cinematics';
|
|
720
|
-
const validation = validateAssetParams({ name: params.name, savePath: targetPath });
|
|
721
|
-
if (!validation.valid) {
|
|
722
|
-
return { success: false, error: validation.error ?? 'Invalid asset parameters' };
|
|
723
|
-
}
|
|
724
|
-
const sanitized = validation.sanitized;
|
|
725
|
-
const assetName = sanitized.name;
|
|
726
|
-
const assetPath = sanitized.savePath ?? targetPath;
|
|
727
|
-
const commands = [
|
|
728
|
-
`CreateAsset LevelSequence ${assetName} ${assetPath}`,
|
|
729
|
-
`SetSequenceFrameRate ${assetName} ${params.frameRate ?? 30}`,
|
|
730
|
-
`SetSequenceDuration ${assetName} ${params.duration ?? 5}`
|
|
731
|
-
];
|
|
732
|
-
if (params.tracks) {
|
|
733
|
-
for (const track of params.tracks) {
|
|
734
|
-
commands.push(`AddSequenceTrack ${assetName} ${track.actorName} ${track.trackType}`);
|
|
735
|
-
if (track.keyframes) {
|
|
736
|
-
for (const keyframe of track.keyframes) {
|
|
737
|
-
commands.push(`AddSequenceKey ${assetName} ${track.actorName} ${track.trackType} ${keyframe.time} ${JSON.stringify(keyframe.value)}`);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
await this.bridge.executeConsoleCommands(commands);
|
|
743
|
-
return {
|
|
744
|
-
success: true,
|
|
745
|
-
message: `Level Sequence ${assetName} created`,
|
|
746
|
-
path: `${assetPath}/${assetName}`
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
catch (err) {
|
|
750
|
-
return { success: false, error: `Failed to create level sequence: ${err}` };
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
async playAnimation(params) {
|
|
754
|
-
try {
|
|
755
|
-
const commands = [
|
|
756
|
-
`PlayAnimation ${params.actorName} ${params.animationType} ${params.animationPath} ${params.playRate ?? 1.0} ${params.loop ?? false} ${params.blendInTime ?? 0.25} ${params.blendOutTime ?? 0.25}`
|
|
757
|
-
];
|
|
758
|
-
await this.bridge.executeConsoleCommands(commands);
|
|
759
|
-
return {
|
|
760
|
-
success: true,
|
|
761
|
-
message: `Animation ${params.animationType} triggered on ${params.actorName}`,
|
|
762
|
-
actorName: params.actorName,
|
|
763
|
-
animationType: params.animationType,
|
|
764
|
-
assetPath: params.animationPath
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
catch (err) {
|
|
768
|
-
const error = `Failed to play animation: ${err}`;
|
|
769
|
-
return { success: false, message: error, error: String(err) };
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
//# sourceMappingURL=animation.js.map
|