@runreal/unreal-mcp
Version:
MCP server for Unreal Engine using Unreal Python Remote Execution
74 lines (73 loc) • 4.16 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UEMoveCamera = exports.UETakeScreenshot = exports.UEDeleteObject = exports.UEUpdateObject = exports.UECreateObject = exports.UEValidateAssets = exports.UEGetWorldOutliner = exports.UESearchAssets = exports.UEGetMapInfo = exports.UEGetProjectInfo = exports.UEConsoleCommand = exports.UEGetAssetReferences = exports.UEExportAsset = exports.UEListAssets = exports.UEGetAssetInfo = void 0;
exports.read = read;
const node_fs_1 = __importDefault(require("node:fs"));
const node_path_1 = __importDefault(require("node:path"));
const utils_js_1 = require("../utils.js");
function read(filePath) {
return node_fs_1.default.readFileSync(node_path_1.default.join(__dirname, filePath), "utf8");
}
const UEGetAssetInfo = (asset_path) => (0, utils_js_1.Template)(read("./scripts/ue_get_asset_info.py"), { asset_path });
exports.UEGetAssetInfo = UEGetAssetInfo;
const UEListAssets = () => (0, utils_js_1.Template)(read("./scripts/ue_list_assets.py"));
exports.UEListAssets = UEListAssets;
const UEExportAsset = (asset_path) => (0, utils_js_1.Template)(read("./scripts/ue_export_asset.py"), { asset_path });
exports.UEExportAsset = UEExportAsset;
const UEGetAssetReferences = (asset_path) => (0, utils_js_1.Template)(read("./scripts/ue_get_asset_references.py"), { asset_path });
exports.UEGetAssetReferences = UEGetAssetReferences;
const UEConsoleCommand = (command) => (0, utils_js_1.Template)(read("./scripts/ue_console_command.py"), { command });
exports.UEConsoleCommand = UEConsoleCommand;
const UEGetProjectInfo = () => (0, utils_js_1.Template)(read("./scripts/ue_get_project_info.py"));
exports.UEGetProjectInfo = UEGetProjectInfo;
const UEGetMapInfo = () => (0, utils_js_1.Template)(read("./scripts/ue_get_map_info.py"));
exports.UEGetMapInfo = UEGetMapInfo;
const UESearchAssets = (search_term, asset_class) => (0, utils_js_1.Template)(read("./scripts/ue_search_assets.py"), {
search_term,
asset_class: asset_class || "",
});
exports.UESearchAssets = UESearchAssets;
const UEGetWorldOutliner = () => (0, utils_js_1.Template)(read("./scripts/ue_get_world_outliner.py"));
exports.UEGetWorldOutliner = UEGetWorldOutliner;
const UEValidateAssets = (asset_paths) => (0, utils_js_1.Template)(read("./scripts/ue_validate_assets.py"), {
asset_paths: asset_paths || "",
});
exports.UEValidateAssets = UEValidateAssets;
const UECreateObject = (object_class, object_name, location, rotation, scale, properties) => {
return (0, utils_js_1.Template)(read("./scripts/ue_create_object.py"), {
object_class,
object_name,
location: location ? JSON.stringify(location) : "null",
rotation: rotation ? JSON.stringify(rotation) : "null",
scale: scale ? JSON.stringify(scale) : "null",
properties: properties ? JSON.stringify(properties) : "null",
});
};
exports.UECreateObject = UECreateObject;
const UEUpdateObject = (actor_name, location, rotation, scale, properties, new_name) => {
return (0, utils_js_1.Template)(read("./scripts/ue_update_object.py"), {
actor_name,
location: location ? JSON.stringify(location) : "null",
rotation: rotation ? JSON.stringify(rotation) : "null",
scale: scale ? JSON.stringify(scale) : "null",
properties: properties ? JSON.stringify(properties) : "null",
new_name: new_name || "null",
});
};
exports.UEUpdateObject = UEUpdateObject;
const UEDeleteObject = (actor_names) => (0, utils_js_1.Template)(read("./scripts/ue_delete_object.py"), {
actor_names,
});
exports.UEDeleteObject = UEDeleteObject;
const UETakeScreenshot = () => (0, utils_js_1.Template)(read("./scripts/ue_take_screenshot.py"));
exports.UETakeScreenshot = UETakeScreenshot;
const UEMoveCamera = (location, rotation) => {
return (0, utils_js_1.Template)(read("./scripts/ue_move_camera.py"), {
location: JSON.stringify(location),
rotation: JSON.stringify(rotation),
});
};
exports.UEMoveCamera = UEMoveCamera;