unreal-engine-mcp-server 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +57 -0
- package/.env.production +25 -0
- package/.eslintrc.json +54 -0
- package/.github/workflows/publish-mcp.yml +75 -0
- package/Dockerfile +54 -0
- package/LICENSE +21 -0
- package/Public/icon.png +0 -0
- package/README.md +209 -0
- package/claude_desktop_config_example.json +13 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +7 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +484 -0
- package/dist/prompts/index.d.ts +14 -0
- package/dist/prompts/index.js +38 -0
- package/dist/python-utils.d.ts +29 -0
- package/dist/python-utils.js +54 -0
- package/dist/resources/actors.d.ts +13 -0
- package/dist/resources/actors.js +83 -0
- package/dist/resources/assets.d.ts +23 -0
- package/dist/resources/assets.js +245 -0
- package/dist/resources/levels.d.ts +17 -0
- package/dist/resources/levels.js +94 -0
- package/dist/tools/actors.d.ts +51 -0
- package/dist/tools/actors.js +459 -0
- package/dist/tools/animation.d.ts +196 -0
- package/dist/tools/animation.js +579 -0
- package/dist/tools/assets.d.ts +21 -0
- package/dist/tools/assets.js +304 -0
- package/dist/tools/audio.d.ts +170 -0
- package/dist/tools/audio.js +416 -0
- package/dist/tools/blueprint.d.ts +144 -0
- package/dist/tools/blueprint.js +652 -0
- package/dist/tools/build_environment_advanced.d.ts +66 -0
- package/dist/tools/build_environment_advanced.js +484 -0
- package/dist/tools/consolidated-tool-definitions.d.ts +2598 -0
- package/dist/tools/consolidated-tool-definitions.js +607 -0
- package/dist/tools/consolidated-tool-handlers.d.ts +2 -0
- package/dist/tools/consolidated-tool-handlers.js +1050 -0
- package/dist/tools/debug.d.ts +185 -0
- package/dist/tools/debug.js +265 -0
- package/dist/tools/editor.d.ts +88 -0
- package/dist/tools/editor.js +365 -0
- package/dist/tools/engine.d.ts +30 -0
- package/dist/tools/engine.js +36 -0
- package/dist/tools/foliage.d.ts +155 -0
- package/dist/tools/foliage.js +525 -0
- package/dist/tools/introspection.d.ts +98 -0
- package/dist/tools/introspection.js +683 -0
- package/dist/tools/landscape.d.ts +158 -0
- package/dist/tools/landscape.js +375 -0
- package/dist/tools/level.d.ts +110 -0
- package/dist/tools/level.js +362 -0
- package/dist/tools/lighting.d.ts +159 -0
- package/dist/tools/lighting.js +1179 -0
- package/dist/tools/materials.d.ts +34 -0
- package/dist/tools/materials.js +146 -0
- package/dist/tools/niagara.d.ts +145 -0
- package/dist/tools/niagara.js +289 -0
- package/dist/tools/performance.d.ts +163 -0
- package/dist/tools/performance.js +412 -0
- package/dist/tools/physics.d.ts +189 -0
- package/dist/tools/physics.js +784 -0
- package/dist/tools/rc.d.ts +110 -0
- package/dist/tools/rc.js +363 -0
- package/dist/tools/sequence.d.ts +112 -0
- package/dist/tools/sequence.js +675 -0
- package/dist/tools/tool-definitions.d.ts +4919 -0
- package/dist/tools/tool-definitions.js +891 -0
- package/dist/tools/tool-handlers.d.ts +47 -0
- package/dist/tools/tool-handlers.js +830 -0
- package/dist/tools/ui.d.ts +171 -0
- package/dist/tools/ui.js +337 -0
- package/dist/tools/visual.d.ts +29 -0
- package/dist/tools/visual.js +67 -0
- package/dist/types/env.d.ts +10 -0
- package/dist/types/env.js +18 -0
- package/dist/types/index.d.ts +323 -0
- package/dist/types/index.js +28 -0
- package/dist/types/tool-types.d.ts +274 -0
- package/dist/types/tool-types.js +13 -0
- package/dist/unreal-bridge.d.ts +126 -0
- package/dist/unreal-bridge.js +992 -0
- package/dist/utils/cache-manager.d.ts +64 -0
- package/dist/utils/cache-manager.js +176 -0
- package/dist/utils/error-handler.d.ts +66 -0
- package/dist/utils/error-handler.js +243 -0
- package/dist/utils/errors.d.ts +133 -0
- package/dist/utils/errors.js +256 -0
- package/dist/utils/http.d.ts +26 -0
- package/dist/utils/http.js +135 -0
- package/dist/utils/logger.d.ts +12 -0
- package/dist/utils/logger.js +32 -0
- package/dist/utils/normalize.d.ts +17 -0
- package/dist/utils/normalize.js +49 -0
- package/dist/utils/response-validator.d.ts +34 -0
- package/dist/utils/response-validator.js +121 -0
- package/dist/utils/safe-json.d.ts +4 -0
- package/dist/utils/safe-json.js +97 -0
- package/dist/utils/stdio-redirect.d.ts +2 -0
- package/dist/utils/stdio-redirect.js +20 -0
- package/dist/utils/validation.d.ts +50 -0
- package/dist/utils/validation.js +173 -0
- package/mcp-config-example.json +14 -0
- package/package.json +63 -0
- package/server.json +60 -0
- package/src/cli.ts +7 -0
- package/src/index.ts +543 -0
- package/src/prompts/index.ts +51 -0
- package/src/python/editor_compat.py +181 -0
- package/src/python-utils.ts +57 -0
- package/src/resources/actors.ts +92 -0
- package/src/resources/assets.ts +251 -0
- package/src/resources/levels.ts +83 -0
- package/src/tools/actors.ts +480 -0
- package/src/tools/animation.ts +713 -0
- package/src/tools/assets.ts +305 -0
- package/src/tools/audio.ts +548 -0
- package/src/tools/blueprint.ts +736 -0
- package/src/tools/build_environment_advanced.ts +526 -0
- package/src/tools/consolidated-tool-definitions.ts +619 -0
- package/src/tools/consolidated-tool-handlers.ts +1093 -0
- package/src/tools/debug.ts +368 -0
- package/src/tools/editor.ts +360 -0
- package/src/tools/engine.ts +32 -0
- package/src/tools/foliage.ts +652 -0
- package/src/tools/introspection.ts +778 -0
- package/src/tools/landscape.ts +523 -0
- package/src/tools/level.ts +410 -0
- package/src/tools/lighting.ts +1316 -0
- package/src/tools/materials.ts +148 -0
- package/src/tools/niagara.ts +312 -0
- package/src/tools/performance.ts +549 -0
- package/src/tools/physics.ts +924 -0
- package/src/tools/rc.ts +437 -0
- package/src/tools/sequence.ts +791 -0
- package/src/tools/tool-definitions.ts +907 -0
- package/src/tools/tool-handlers.ts +941 -0
- package/src/tools/ui.ts +499 -0
- package/src/tools/visual.ts +60 -0
- package/src/types/env.ts +27 -0
- package/src/types/index.ts +414 -0
- package/src/types/tool-types.ts +343 -0
- package/src/unreal-bridge.ts +1118 -0
- package/src/utils/cache-manager.ts +213 -0
- package/src/utils/error-handler.ts +320 -0
- package/src/utils/errors.ts +312 -0
- package/src/utils/http.ts +184 -0
- package/src/utils/logger.ts +30 -0
- package/src/utils/normalize.ts +54 -0
- package/src/utils/response-validator.ts +145 -0
- package/src/utils/safe-json.ts +112 -0
- package/src/utils/stdio-redirect.ts +18 -0
- package/src/utils/validation.ts +212 -0
- package/tsconfig.json +33 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
export class AssetTools {
|
|
4
|
+
bridge;
|
|
5
|
+
constructor(bridge) {
|
|
6
|
+
this.bridge = bridge;
|
|
7
|
+
}
|
|
8
|
+
async importAsset(sourcePath, destinationPath) {
|
|
9
|
+
try {
|
|
10
|
+
// Sanitize destination path (remove trailing slash)
|
|
11
|
+
const cleanDest = destinationPath.replace(/\/$/, '');
|
|
12
|
+
// Create test FBX file if it's a test file
|
|
13
|
+
if (sourcePath.includes('test_model.fbx')) {
|
|
14
|
+
// Create the file outside of Python, before import
|
|
15
|
+
try {
|
|
16
|
+
this.createTestFBX(sourcePath);
|
|
17
|
+
}
|
|
18
|
+
catch (_err) {
|
|
19
|
+
// If we can't create the file, we'll handle it in Python
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// Use Python API to import asset with file creation fallback
|
|
23
|
+
const pythonCode = `
|
|
24
|
+
import unreal
|
|
25
|
+
import os
|
|
26
|
+
|
|
27
|
+
# Create test FBX if needed
|
|
28
|
+
source_path = r'${sourcePath}'
|
|
29
|
+
if 'test_model.fbx' in source_path and not os.path.exists(source_path):
|
|
30
|
+
# Create directory if needed
|
|
31
|
+
os.makedirs(os.path.dirname(source_path), exist_ok=True)
|
|
32
|
+
|
|
33
|
+
# Create a valid FBX ASCII file
|
|
34
|
+
fbx_content = """FBXHeaderExtension: {
|
|
35
|
+
FBXHeaderVersion: 1003
|
|
36
|
+
FBXVersion: 7400
|
|
37
|
+
CreationTimeStamp: {
|
|
38
|
+
Version: 1000
|
|
39
|
+
}
|
|
40
|
+
Creator: "MCP FBX Test Generator"
|
|
41
|
+
}
|
|
42
|
+
GlobalSettings: {
|
|
43
|
+
Version: 1000
|
|
44
|
+
Properties70: {
|
|
45
|
+
P: "UpAxis", "int", "Integer", "",2
|
|
46
|
+
P: "UpAxisSign", "int", "Integer", "",1
|
|
47
|
+
P: "FrontAxis", "int", "Integer", "",1
|
|
48
|
+
P: "FrontAxisSign", "int", "Integer", "",1
|
|
49
|
+
P: "CoordAxis", "int", "Integer", "",0
|
|
50
|
+
P: "CoordAxisSign", "int", "Integer", "",1
|
|
51
|
+
P: "UnitScaleFactor", "double", "Number", "",1
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
Definitions: {
|
|
55
|
+
Version: 100
|
|
56
|
+
Count: 2
|
|
57
|
+
ObjectType: "Model" {
|
|
58
|
+
Count: 1
|
|
59
|
+
}
|
|
60
|
+
ObjectType: "Geometry" {
|
|
61
|
+
Count: 1
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
Objects: {
|
|
65
|
+
Geometry: 1234567, "Geometry::Cube", "Mesh" {
|
|
66
|
+
Vertices: *24 {
|
|
67
|
+
a: -50,-50,50,50,-50,50,50,50,50,-50,50,50,-50,-50,-50,50,-50,-50,50,50,-50,-50,50,-50
|
|
68
|
+
}
|
|
69
|
+
PolygonVertexIndex: *36 {
|
|
70
|
+
a: 0,1,2,-4,4,5,6,-8,0,4,7,-4,1,5,4,-1,2,6,5,-2,3,7,6,-3
|
|
71
|
+
}
|
|
72
|
+
GeometryVersion: 124
|
|
73
|
+
LayerElementNormal: 0 {
|
|
74
|
+
Version: 101
|
|
75
|
+
Name: ""
|
|
76
|
+
MappingInformationType: "ByPolygonVertex"
|
|
77
|
+
ReferenceInformationType: "Direct"
|
|
78
|
+
Normals: *108 {
|
|
79
|
+
a: 0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
LayerElementUV: 0 {
|
|
83
|
+
Version: 101
|
|
84
|
+
Name: "UVMap"
|
|
85
|
+
MappingInformationType: "ByPolygonVertex"
|
|
86
|
+
ReferenceInformationType: "IndexToDirect"
|
|
87
|
+
UV: *48 {
|
|
88
|
+
a: 0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1
|
|
89
|
+
}
|
|
90
|
+
UVIndex: *36 {
|
|
91
|
+
a: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
Layer: 0 {
|
|
95
|
+
Version: 100
|
|
96
|
+
LayerElement: {
|
|
97
|
+
Type: "LayerElementNormal"
|
|
98
|
+
TypedIndex: 0
|
|
99
|
+
}
|
|
100
|
+
LayerElement: {
|
|
101
|
+
Type: "LayerElementUV"
|
|
102
|
+
TypedIndex: 0
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
Model: 2345678, "Model::Cube", "Mesh" {
|
|
107
|
+
Version: 232
|
|
108
|
+
Properties70: {
|
|
109
|
+
P: "InheritType", "enum", "", "",1
|
|
110
|
+
P: "ScalingMax", "Vector3D", "Vector", "",0,0,0
|
|
111
|
+
P: "DefaultAttributeIndex", "int", "Integer", "",0
|
|
112
|
+
}
|
|
113
|
+
Shading: Y
|
|
114
|
+
Culling: "CullingOff"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
Connections: {
|
|
118
|
+
C: "OO",1234567,2345678
|
|
119
|
+
}
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
with open(source_path, 'w') as f:
|
|
123
|
+
f.write(fbx_content)
|
|
124
|
+
print(f"Created test FBX file: {source_path}")
|
|
125
|
+
|
|
126
|
+
# Set up the import task
|
|
127
|
+
task = unreal.AssetImportTask()
|
|
128
|
+
task.filename = r'${sourcePath}'
|
|
129
|
+
task.destination_path = '${cleanDest}'
|
|
130
|
+
task.automated = True
|
|
131
|
+
task.save = True
|
|
132
|
+
task.replace_existing = True
|
|
133
|
+
|
|
134
|
+
# Configure FBX import options
|
|
135
|
+
options = unreal.FbxImportUI()
|
|
136
|
+
options.import_mesh = True
|
|
137
|
+
options.import_as_skeletal = False
|
|
138
|
+
options.mesh_type_to_import = unreal.FBXImportType.FBXIT_STATIC_MESH
|
|
139
|
+
options.static_mesh_import_data.combine_meshes = True
|
|
140
|
+
options.static_mesh_import_data.generate_lightmap_u_vs = False
|
|
141
|
+
options.static_mesh_import_data.auto_generate_collision = False
|
|
142
|
+
task.options = options
|
|
143
|
+
|
|
144
|
+
# Use AssetTools to import
|
|
145
|
+
asset_tools = unreal.AssetToolsHelpers.get_asset_tools()
|
|
146
|
+
try:
|
|
147
|
+
asset_tools.import_asset_tasks([task])
|
|
148
|
+
if task.imported_object_paths:
|
|
149
|
+
print(f"RESULT:{'{'}'success': True, 'imported': {len(task.imported_object_paths)}, 'paths': {task.imported_object_paths}{'}'}")
|
|
150
|
+
else:
|
|
151
|
+
print(f"RESULT:{'{'}'success': False, 'error': 'No assets imported', 'source': task.filename{'}'}")
|
|
152
|
+
except Exception as e:
|
|
153
|
+
print(f"RESULT:{'{'}'success': False, 'error': str(e), 'source': task.filename{'}'}")
|
|
154
|
+
`.trim();
|
|
155
|
+
const pyResp = await this.bridge.executePython(pythonCode);
|
|
156
|
+
// Parse Python output
|
|
157
|
+
let outputStr = '';
|
|
158
|
+
if (typeof pyResp === 'object' && pyResp !== null) {
|
|
159
|
+
if (pyResp.LogOutput && Array.isArray(pyResp.LogOutput)) {
|
|
160
|
+
outputStr = pyResp.LogOutput.map((l) => l.Output || '').join('');
|
|
161
|
+
}
|
|
162
|
+
else if ('ReturnValue' in pyResp) {
|
|
163
|
+
outputStr = String(pyResp.ReturnValue);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
outputStr = JSON.stringify(pyResp);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
outputStr = String(pyResp || '');
|
|
171
|
+
}
|
|
172
|
+
const match = outputStr.match(/RESULT:({.*})/);
|
|
173
|
+
if (match) {
|
|
174
|
+
try {
|
|
175
|
+
const parsed = JSON.parse(match[1].replace(/'/g, '"'));
|
|
176
|
+
if (parsed.success) {
|
|
177
|
+
const count = parsed.imported?.count ?? 0;
|
|
178
|
+
const paths = parsed.imported?.paths ?? [];
|
|
179
|
+
return { success: true, message: `Imported ${count} assets to ${cleanDest}`, paths };
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
return { error: `Import failed: ${parsed.error || 'Unknown error'} (source: ${parsed.source || sourcePath})` };
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
// Fall through
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// If unable to parse, return generic attempt result
|
|
190
|
+
return { error: `Import did not report success for source ${sourcePath}` };
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
return { error: `Failed to import asset: ${err}` };
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async duplicateAsset(sourcePath, destinationPath) {
|
|
197
|
+
try {
|
|
198
|
+
const res = await this.bridge.call({
|
|
199
|
+
objectPath: '/Script/EditorScriptingUtilities.Default__EditorAssetLibrary',
|
|
200
|
+
functionName: 'DuplicateAsset',
|
|
201
|
+
parameters: {
|
|
202
|
+
SourceAssetPath: sourcePath,
|
|
203
|
+
DestinationAssetPath: destinationPath
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return res?.Result ?? res;
|
|
207
|
+
}
|
|
208
|
+
catch (err) {
|
|
209
|
+
return { error: `Failed to duplicate asset: ${err}` };
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
async deleteAsset(assetPath) {
|
|
213
|
+
try {
|
|
214
|
+
const res = await this.bridge.call({
|
|
215
|
+
objectPath: '/Script/EditorScriptingUtilities.Default__EditorAssetLibrary',
|
|
216
|
+
functionName: 'DeleteAsset',
|
|
217
|
+
parameters: {
|
|
218
|
+
AssetPathToDelete: assetPath
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return res?.Result ?? res;
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
return { error: `Failed to delete asset: ${err}` };
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async saveAsset(assetPath) {
|
|
228
|
+
try {
|
|
229
|
+
const res = await this.bridge.call({
|
|
230
|
+
objectPath: '/Script/EditorScriptingUtilities.Default__EditorAssetLibrary',
|
|
231
|
+
functionName: 'SaveAsset',
|
|
232
|
+
parameters: {
|
|
233
|
+
AssetToSave: assetPath
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
return res?.Result ?? res;
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
return { error: `Failed to save asset: ${err}` };
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
createTestFBX(filePath) {
|
|
243
|
+
// Create a minimal valid FBX ASCII file for testing
|
|
244
|
+
const fbxContent = `; FBX 7.5.0 project file
|
|
245
|
+
FBXHeaderExtension: {
|
|
246
|
+
FBXHeaderVersion: 1003
|
|
247
|
+
FBXVersion: 7500
|
|
248
|
+
CreationTimeStamp: {
|
|
249
|
+
Version: 1000
|
|
250
|
+
Year: 2024
|
|
251
|
+
Month: 1
|
|
252
|
+
Day: 1
|
|
253
|
+
Hour: 0
|
|
254
|
+
Minute: 0
|
|
255
|
+
Second: 0
|
|
256
|
+
Millisecond: 0
|
|
257
|
+
}
|
|
258
|
+
Creator: "MCP Test FBX Generator"
|
|
259
|
+
}
|
|
260
|
+
GlobalSettings: {
|
|
261
|
+
Version: 1000
|
|
262
|
+
}
|
|
263
|
+
Definitions: {
|
|
264
|
+
Version: 100
|
|
265
|
+
Count: 2
|
|
266
|
+
ObjectType: "Model" {
|
|
267
|
+
Count: 1
|
|
268
|
+
}
|
|
269
|
+
ObjectType: "Geometry" {
|
|
270
|
+
Count: 1
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
Objects: {
|
|
274
|
+
Geometry: 1234567, "Geometry::Cube", "Mesh" {
|
|
275
|
+
Vertices: *24 {
|
|
276
|
+
a: -50,-50,-50,50,-50,-50,50,50,-50,-50,50,-50,-50,-50,50,50,-50,50,50,50,50,-50,50,50
|
|
277
|
+
}
|
|
278
|
+
PolygonVertexIndex: *36 {
|
|
279
|
+
a: 0,1,2,-4,4,7,6,-6,0,4,5,-2,1,5,6,-3,2,6,7,-4,4,0,3,-8
|
|
280
|
+
}
|
|
281
|
+
GeometryVersion: 124
|
|
282
|
+
}
|
|
283
|
+
Model: 2345678, "Model::TestCube", "Mesh" {
|
|
284
|
+
Version: 232
|
|
285
|
+
Properties70: {
|
|
286
|
+
P: "ScalingMax", "Vector3D", "Vector", "",0,0,0
|
|
287
|
+
P: "DefaultAttributeIndex", "int", "Integer", "",0
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
Connections: {
|
|
292
|
+
C: "OO",1234567,2345678
|
|
293
|
+
}
|
|
294
|
+
`;
|
|
295
|
+
// Ensure directory exists
|
|
296
|
+
const dir = path.dirname(filePath);
|
|
297
|
+
if (!fs.existsSync(dir)) {
|
|
298
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
299
|
+
}
|
|
300
|
+
// Write the FBX file
|
|
301
|
+
fs.writeFileSync(filePath, fbxContent, 'utf8');
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { UnrealBridge } from '../unreal-bridge.js';
|
|
2
|
+
export declare class AudioTools {
|
|
3
|
+
private bridge;
|
|
4
|
+
constructor(bridge: UnrealBridge);
|
|
5
|
+
private _executeCommand;
|
|
6
|
+
createSoundCue(params: {
|
|
7
|
+
name: string;
|
|
8
|
+
wavePath?: string;
|
|
9
|
+
savePath?: string;
|
|
10
|
+
settings?: {
|
|
11
|
+
volume?: number;
|
|
12
|
+
pitch?: number;
|
|
13
|
+
looping?: boolean;
|
|
14
|
+
attenuationSettings?: string;
|
|
15
|
+
};
|
|
16
|
+
}): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
error?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
success: boolean;
|
|
22
|
+
error: any;
|
|
23
|
+
message?: undefined;
|
|
24
|
+
}>;
|
|
25
|
+
playSoundAtLocation(params: {
|
|
26
|
+
soundPath: string;
|
|
27
|
+
location: [number, number, number];
|
|
28
|
+
volume?: number;
|
|
29
|
+
pitch?: number;
|
|
30
|
+
startTime?: number;
|
|
31
|
+
}): Promise<{
|
|
32
|
+
success: boolean;
|
|
33
|
+
message: string;
|
|
34
|
+
error?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
success: boolean;
|
|
37
|
+
error: any;
|
|
38
|
+
message?: undefined;
|
|
39
|
+
}>;
|
|
40
|
+
playSound2D(params: {
|
|
41
|
+
soundPath: string;
|
|
42
|
+
volume?: number;
|
|
43
|
+
pitch?: number;
|
|
44
|
+
startTime?: number;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
success: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
error?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
success: boolean;
|
|
51
|
+
error: any;
|
|
52
|
+
message?: undefined;
|
|
53
|
+
}>;
|
|
54
|
+
createAudioComponent(params: {
|
|
55
|
+
actorName: string;
|
|
56
|
+
componentName: string;
|
|
57
|
+
soundPath: string;
|
|
58
|
+
autoPlay?: boolean;
|
|
59
|
+
is3D?: boolean;
|
|
60
|
+
}): Promise<{
|
|
61
|
+
success: boolean;
|
|
62
|
+
message: string;
|
|
63
|
+
}>;
|
|
64
|
+
setSoundAttenuation(params: {
|
|
65
|
+
name: string;
|
|
66
|
+
innerRadius?: number;
|
|
67
|
+
falloffDistance?: number;
|
|
68
|
+
attenuationShape?: 'Sphere' | 'Capsule' | 'Box' | 'Cone';
|
|
69
|
+
falloffMode?: 'Linear' | 'Logarithmic' | 'Inverse' | 'LogReverse' | 'Natural';
|
|
70
|
+
}): Promise<{
|
|
71
|
+
success: boolean;
|
|
72
|
+
message: string;
|
|
73
|
+
}>;
|
|
74
|
+
createSoundClass(params: {
|
|
75
|
+
name: string;
|
|
76
|
+
parentClass?: string;
|
|
77
|
+
properties?: {
|
|
78
|
+
volume?: number;
|
|
79
|
+
pitch?: number;
|
|
80
|
+
lowPassFilterFrequency?: number;
|
|
81
|
+
attenuationDistanceScale?: number;
|
|
82
|
+
};
|
|
83
|
+
}): Promise<{
|
|
84
|
+
success: boolean;
|
|
85
|
+
message: string;
|
|
86
|
+
}>;
|
|
87
|
+
createSoundMix(params: {
|
|
88
|
+
name: string;
|
|
89
|
+
classAdjusters?: Array<{
|
|
90
|
+
soundClass: string;
|
|
91
|
+
volumeAdjuster?: number;
|
|
92
|
+
pitchAdjuster?: number;
|
|
93
|
+
fadeInTime?: number;
|
|
94
|
+
fadeOutTime?: number;
|
|
95
|
+
}>;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
message: string;
|
|
99
|
+
}>;
|
|
100
|
+
pushSoundMix(params: {
|
|
101
|
+
mixName: string;
|
|
102
|
+
}): Promise<any>;
|
|
103
|
+
popSoundMix(params: {
|
|
104
|
+
mixName: string;
|
|
105
|
+
}): Promise<any>;
|
|
106
|
+
setMasterVolume(params: {
|
|
107
|
+
volume: number;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
success: boolean;
|
|
110
|
+
message: string;
|
|
111
|
+
error?: undefined;
|
|
112
|
+
} | {
|
|
113
|
+
success: boolean;
|
|
114
|
+
error: any;
|
|
115
|
+
message?: undefined;
|
|
116
|
+
}>;
|
|
117
|
+
createAmbientSound(params: {
|
|
118
|
+
name: string;
|
|
119
|
+
location: [number, number, number];
|
|
120
|
+
soundPath: string;
|
|
121
|
+
volume?: number;
|
|
122
|
+
radius?: number;
|
|
123
|
+
autoPlay?: boolean;
|
|
124
|
+
}): Promise<{
|
|
125
|
+
success: boolean;
|
|
126
|
+
message: string;
|
|
127
|
+
}>;
|
|
128
|
+
createReverbZone(params: {
|
|
129
|
+
name: string;
|
|
130
|
+
location: [number, number, number];
|
|
131
|
+
size: [number, number, number];
|
|
132
|
+
reverbEffect?: string;
|
|
133
|
+
volume?: number;
|
|
134
|
+
fadeTime?: number;
|
|
135
|
+
}): Promise<{
|
|
136
|
+
success: boolean;
|
|
137
|
+
message: string;
|
|
138
|
+
}>;
|
|
139
|
+
enableAudioAnalysis(params: {
|
|
140
|
+
enabled: boolean;
|
|
141
|
+
fftSize?: number;
|
|
142
|
+
outputType?: 'Magnitude' | 'Decibel' | 'Normalized';
|
|
143
|
+
}): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
message: string;
|
|
146
|
+
}>;
|
|
147
|
+
stopAllSounds(): Promise<any>;
|
|
148
|
+
fadeSound(params: {
|
|
149
|
+
soundName: string;
|
|
150
|
+
targetVolume: number;
|
|
151
|
+
fadeTime: number;
|
|
152
|
+
fadeType?: 'FadeIn' | 'FadeOut' | 'FadeTo';
|
|
153
|
+
}): Promise<any>;
|
|
154
|
+
setDopplerEffect(params: {
|
|
155
|
+
enabled: boolean;
|
|
156
|
+
scale?: number;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
success: boolean;
|
|
159
|
+
message: string;
|
|
160
|
+
}>;
|
|
161
|
+
setAudioOcclusion(params: {
|
|
162
|
+
enabled: boolean;
|
|
163
|
+
lowPassFilterFrequency?: number;
|
|
164
|
+
volumeAttenuation?: number;
|
|
165
|
+
}): Promise<{
|
|
166
|
+
success: boolean;
|
|
167
|
+
message: string;
|
|
168
|
+
}>;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=audio.d.ts.map
|