run_external_project_script
Spawn an isolated headless Unreal editor to run a Python script against an external project, avoiding /Game package collisions and returning stdout.
Instructions
Spawn a SEPARATE headless UnrealEditor-Cmd.exe to run a python script against an EXTERNAL project and capture its stdout. Needed because another project's /Game packages collide with the live project's (they cannot be loaded side by side), so reading data from content outside this project needs an isolated editor. Give it an existing .uproject OR a module_dir (a minimal engine-only .uproject is cloned in place, with any 'disable_plugins' turned off, then deleted); it launches <uproject> -run=pythonscript -script=<script> -unattended -nullrhi -NoLiveCoding -stdout, blocks until exit or timeout, and returns stdout. HEAVY: spawns a full editor process (tens of seconds) and BLOCKS the editor for the duration -- run with confirmation. The engine binary is resolved from THIS editor's install (FPaths::EngineDir); no path is assumed.
Returns: { exe: string, uproject_used: string, cloned: bool, script: string, params: string, launched: bool, exit_code: int, success: bool, timed_out: bool, duration_seconds: number, stdout: string, stdout_length: int, stdout_file: string, cleaned_up: bool, message: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | Absolute path to the .py file to run (the -script argument). | |
| uproject | No | Path to an existing external .uproject to run against (optional; provide this OR module_dir). | |
| extra_args | No | Optional list of extra command-line tokens appended to the launch. | |
| module_dir | No | Directory of a content folder or project whose Content to load; a temporary engine-only .uproject is cloned here and cleaned up (optional; provide this OR uproject). | |
| disable_plugins | No | Optional list of plugin names to disable in the CLONED .uproject (e.g. custom plugins that hang headless startup). Only applies when module_dir is used. | |
| timeout_seconds | No | Max seconds to wait before terminating the child (optional, default 300; clamped 30..3600). |