Skip to content
Back to skills

Unreal Editor Python

ASecurity

Unreal editor Python, headless: UnrealEditor-Cmd -ExecutePythonScript or -run=pythonscript, init_unreal.py, the unreal module, commandlets, timeout and sentinel.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongoc++bashapi

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add tipoLi5890/game-studio --skill unreal-editor-python --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Unreal Editor Python?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Unreal Editor Python
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-unreal-editor-python/badge)](https://www.skillsdirectory.com/skills/tipoli5890-unreal-editor-python)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: unreal-editor-python
description: >-
  Unreal editor Python, headless: UnrealEditor-Cmd -ExecutePythonScript or -run=pythonscript,
  init_unreal.py, the unreal module, commandlets, timeout and sentinel.
---

# unreal-editor-python — the editor as a command-line tool

Most editor work an agent needs (create, inspect, import, save assets) runs as a Python script in
an editor process with no window, bounded by a wall clock and judged by what the script wrote: a
JSON file for the data, one sentinel line for the verdict, the log for the errors. An exit code of
0 alone proves nothing.

## Load what the situation needs

| The situation | Read |
|---|---|
| Run a Python script headless, get its result back | *Run one script*, `reference/headless-runs.md`, `scripts/editor_run.py` |
| Which editor binary; the flags of a headless run | `reference/headless-runs.md` §1, §3 |
| `unreal.EditorAssetLibrary`, `AssetData`, levels, undo, progress, `init_unreal.py` | `reference/unreal-module.md` |
| C++ that runs in the editor binary: a commandlet | `reference/commandlets.md`, `templates/RouteAuditCommandlet.h` |
| A script to start from | `templates/courier_asset_report.py` |
| Reading the run's log: the first error, the blocks | `unreal-config-logs` |
| Importing meshes and textures by script | `unreal-asset-import` |
| IK Rigs and retargeting by script | `unreal-rigged-character` |
| Automation tests and their report | `unreal-automation-tests` |
| A live editor is open with an MCP server | `unreal-mcp` |

## Run one script

```bash
export UE_ROOT=/path/to/the/engine
python3 scripts/editor_run.py which
python3 scripts/editor_run.py python --project CourierRun/CourierRun.uproject \
    --script CourierRun/Content/Python/courier_asset_report.py --out report.json \
    --env COURIER_ROOT=/Game/CourierRun/Props
```

```
editor: <UE_ROOT>/Engine/Binaries/Win64/UnrealEditor-Cmd.exe (from UE_ROOT)
command: <editor> <project>/CourierRun.uproject -run=pythonscript -script=<project>/Content/Python/courier_asset_report.py -unattended -nullrhi -nosplash -stdout -FullStdOutLogOutput -ABSLOG=<run>/editor.log
log: <run>/editor.log
judged: <run>/editor.log
sentinel: line <n> UNREAL_DEV_DONE courier_asset_report assets=2
out: report.json
editor_run: PASS exit=0 wall=<s>s fatal=0 errors=0 warnings=0 sentinel=DONE
```

The runner finds the binary under `--engine` or `UE_ROOT` (never a guessed path), adds the
headless flags and `-ABSLOG=<file>`, sets `UNREAL_DEV_OUT` to the JSON file and each `--env`
pair, runs under `--timeout` (default 1800 s), ends the whole process group on timeout, and
judges the log with the marker block `unreal-config-logs` uses.

| Exit | Verdict | Meaning |
|---|---|---|
| 0 | `PASS` | the expected exit code, no Fatal or Error line, `UNREAL_DEV_DONE`, a valid JSON file |
| 2 | `FAIL` | a Fatal or Error line, `UNREAL_DEV_FAIL`, another exit code, a sentinel without its JSON file |
| 3 | `UNVERIFIED` | no binary, a timeout, no output, no sentinel, `--dry-run` |
| 1 | refused / usage | no `.uproject`, no script, a bad flag |

| Flag | Effect |
|---|---|
| `--engine PATH` / `--editor PATH` | the engine root (default `$UE_ROOT`) / one explicit binary |
| `--script FILE` | the editor Python script; `--script-arg A` adds an argument after its name |
| `--full-editor` | `-ExecutePythonScript=` (after the startup level loads) instead of the commandlet |
| `--out FILE`, `--env KEY=VALUE` | the JSON result (`UNREAL_DEV_OUT`) and the inputs |
| `--timeout S`, `--expect N` | the wall clock; the exit code a pass needs |
| `--log FILE` | where `-ABSLOG` points, removed before launch (default: the run folder, kept after) |
| `--fail-on-warning`, `--echo`, `--dry-run` | warnings fail; print the log; print the command only |

`run` takes any editor arguments after `--` (`-ExecCmds="...;Quit"`, or an engine commandlet such as
`-run=cook`) with the same bound and verdict; `--sentinel` requires `UNREAL_DEV_DONE` there.

## The same run by hand

```bash
"$UE_ROOT/Engine/Binaries/Linux/UnrealEditor" "$PWD/CourierRun/CourierRun.uproject" \
    -run=pythonscript -script="$PWD/CourierRun/Content/Python/courier_asset_report.py" \
    -unattended -nullrhi -nosplash -stdout -FullStdOutLogOutput -ABSLOG="$PWD/run.log"
```

Then, every time:

1. **Commandlet or full editor.** `-run=pythonscript -script=` loads no level: load one with
   `LevelEditorSubsystem.load_level` first. `-ExecutePythonScript=` runs after the startup level
   loads. The editor shuts down after the script in both.
2. **Bound it with a wall clock**, from the calling script; macOS has no `timeout` command.
3. **Data out through a file** named in an environment variable, never by scraping stdout.
4. **The sentinel last:** `unreal.log("UNREAL_DEV_DONE <tool> <summary>")`, or
   `UNREAL_DEV_FAIL <tool> <reason>` from an `except` block.
5. **Judge the log file**, not the console: `Log` verbosity lines reach only the file.
6. **The Python Editor Script Plugin is enabled** in the project, or no script runs.

## Write a script that can be judged

`templates/courier_asset_report.py` is the shape: read inputs from the environment, check
preconditions and fail with a reason (`UNREAL_DEV_FAIL courier_asset_report no content folder ...`),
do the work, write the JSON to `UNREAL_DEV_OUT`, log the sentinel, and wrap it all so an exception
still ends in a `UNREAL_DEV_FAIL` line. Look every `unreal.` member up for the engine in use
(`unreal-project` → `reference/api-lookup.md`).

## Discipline

- **Exit 0 is not a verdict.** The sentinel, the JSON file and the log are.
- **One editor per project at a time.** Close the open editor, or run on a copy: two processes
  saving one project's files overwrite each other.
- **Keep `init_unreal.py` small.** It runs at every start, headless runs included.
- **A timeout is UNVERIFIED.** Raise `--timeout` for a big project; never read a killed run as clean.
- **Python first, a commandlet when Python does not reach** (`reference/commandlets.md`).

Files in this skill

  • SKILL.md5.9 KB
  • reference/commandlets.md4.9 KB
  • reference/headless-runs.md7.6 KB
  • reference/unreal-module.md4.5 KB
  • scripts/editor_run.py27.8 KB
  • templates/RouteAuditCommandlet.cpp1.6 KB
  • templates/RouteAuditCommandlet.h849 B
  • templates/courier_asset_report.py2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.