Latest news
TutorialsUnreal EngineOMAMAS

Unreal Engine Python Editor Automation: Setup and Usage Guide

You can automate repetitive tasks in Unreal Editor using Python. This guide explains the essential steps, from installing the required plugins to running code in the editor or from the command line.

An architectural visualization workspace evoking editor automation with PythonAI image
Representative image, generated with AI.Image: 3dsınıfı / FCA AI

In brief

  1. To use Python, enable Python Editor Script Plugin for each project and restart the editor.
  2. According to Epic Games documentation, the Python version embedded in the editor is 3.11.8; there’s no need to install Python separately.
  3. Python can be used for automation inside Unreal Editor; it does not run during gameplay or in packaged applications.
  4. Scripts can be run from the Python console, the menu, the command line, and editor-focused Blueprint nodes.

What you'll learn in this guide

Using Python in Unreal Editor helps you automate repetitive production steps and editor tools with scripts. Epic Games documentation lists use cases including asset management, generating LODs for Static Meshes, placing content in levels, and creating custom editor interfaces for organizations. This guide covers enabling plugins for a project, running a small script, and command-line execution options.

One important limitation: Python is provided for scripting Unreal Editor, not for gameplay runtime. The official documentation states that the Python environment is unavailable while running Play In Editor, Standalone Game, or a packaged application. In addition, the Unreal Python 5.8 API reference is marked experimental, so it’s worth testing the features you plan to use in production on a copy of your project first.

Requirements

  • An Unreal Engine project and Unreal Editor where you’ll use Python support.

  • Python Editor Script Plugin, which must be enabled for each project individually.

  • Editor Scripting Utilities, recommended by Epic Games for editor automation. This plugin simplifies APIs for common editor operations.

  • There’s no need to install Python separately: the documented editor plugin includes embedded Python 3.11.8.

The documentation doesn’t specify any particular fee, licensing plan, or hardware requirements. Using a different Python version also isn’t a matter of changing an ordinary setting: the documentation says you need to set the UE_PYTHON_DIR environment variable and rebuild Unreal Engine from source.

Step-by-step setup and execution

  1. Enable the plugins. Open the project in Unreal Editor and go to Edit > Plugins in the main menu. Under the Scripting category, enable Python Editor Script Plugin. If you’re planning editor automation, enable Editor Scripting Utilities as well. Restart the editor after enabling the plugins.

  2. Start with a short test script. You can run an executable Python file for your project using one of the methods available in the editor. Keeping the first script small and checking the result in Output Log makes troubleshooting easier. According to Epic’s documentation, built-in Python print output is also sent to the Output Log panel.

  3. Run a file from the console. You can switch the console input in the Output Log panel to Python mode and run lines interactively. You can also use the py command in the console to call a script file. The line below is the example from the documentation; the file path is specific to the computer used in the example.

Prompt
py "C:\MyScripts\my_script.py"

This is useful for testing code while the editor is open. Use Shift + Enter to run multiple lines in the console, or paste a multiline block from a text editor. You can also browse for a file using File > Execute Python Script in the main menu; previously run files appear in the Recent Python scripts list.

  1. Consider timing when a script needs to load a level. There are two approaches to command-line execution. The full editor approach opens the project, loads the default startup level, and then runs the script; both scripting plugins must be enabled for the project. The other option is to run a Python commandlet through UnrealEditor-Cmd.exe. This can run headlessly, without opening the editor interface, but it does not load levels automatically.

The command-line example for the full editor option in the documentation is:

bat
UnrealEditor-Cmd.exe "C:\projects\MyProject.uproject" -ExecutePythonScript="c:\my_script.py"

The documented format for running a script file with a commandlet is:

bat
UnrealEditor-Cmd.exe "C:\projects\MyProject.uproject" -run=pythonscript -script="c:\\my_script.py"

If your commandlet script needs a level, the documentation recommends loading it at the start of the script through LevelEditorSubsystem. The line below uses the example path from the official documentation; for a real project, update the level path to match your project.

python
unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level("/Game/maps/UVlayoutTest.UVlayoutTest")
  1. Organize recurring startup tasks. An init_unreal.py file placed in Content/Python within a project or plugin can run automatically when the editor starts. To run files when a specific project opens, use the Plugins > Python > Startup scripts setting under Edit > Project Settings. These scripts run after the default startup level has finished loading.

  2. Consider using Python alongside visual tools. Python Editor Script Plugin provides nodes for running Python code from editor-focused Blueprint classes. The Execute Python Script node runs a code snippet; it doesn’t run a file. Execute Python Command can determine whether its input is code or a filename and run it accordingly. These nodes are available only in editor-focused classes such as Editor Utility Widgets and Editor Utility Blueprints, not in runtime Blueprint classes.

Uses in architecture and visualization workflows

For architecture firms and visualization teams, this approach is especially useful when the same editor steps need to be repeated across projects or assets. Asset management and LOD generation, both mentioned in the documentation, are examples that teams working with large content libraries could consider. Procedurally placing level content is another documented use case for those looking to organize scene preparation with scripts.

Before sharing an automation script with your team, check that the plugins are enabled for all project members and that the script runs with the right project and startup level. The file and project paths in the command-line examples won’t be the same on every computer, so they need to be adapted to local paths. The sources don’t provide hardware requirements, performance gains, or cost information. Decisions should therefore be based on whether the task is genuinely repetitive and whether the team can maintain its scripts.

Common mistakes

  • Enabling the plugin but not restarting the editor: The documentation calls for a restart after plugin setup.

  • Assuming it’s enough to enable the plugin for just one project: The Python plugin must be enabled separately for each project.

  • Trying to use Python at gameplay runtime: Supported use is editor automation; the Python environment isn’t available during gameplay or in packaged applications.

  • Assuming the commandlet will open a level automatically: This method doesn’t load levels automatically; you may need to add a level-loading step to the script.

  • Expecting Blueprint nodes to work in every class: Python execution nodes are limited to editor-focused Blueprint classes.

  • Using an example file path from the documentation without changing it: A command won’t work if the example paths don’t match your local project and script locations.

Next steps

Start by running a small script in the editor and checking the result in Output Log. Then choose a recurring asset-management or level-preparation task and assess whether it’s suitable for automation. If you’re building more comprehensive tools, explore the conveniences offered by Editor Scripting Utilities and the editor-focused Blueprint nodes. The class and type lists in the Unreal Python API reference are a useful starting point for researching available APIs; keep in mind that the 5.8 reference is marked experimental.

Sources and licensing

This guide is adapted into English from Epic Games’ official documentation on Scripting the Unreal Editor Using Python, Scripting and Automating the Unreal Editor, and the Unreal Python API. The sources are marked license=free in the provided information; as no specific Creative Commons license is named, no further licensing claim is made here.

Sources

3 sources
D
dev.epicgames.comdev.epicgames.com/documentation/en-us/unreal-engine/python-api
Summary
D
dev.epicgames.comdev.epicgames.com/documentation/unreal-engine/scripting-the-unreal-editor-using-python
Summary
D
dev.epicgames.comdev.epicgames.com/documentation/unreal-engine/scripting-and-automating-the-unreal-editor
Summary

Source texts are not republished; short quotes are marked, everything else is our own summary and commentary.

3dsınıfı’s take
3dEditor’s assessment

For architecture firms and visualization teams in Turkey, the practical value of Python automation lies in its potential to cut down on repetitive editor tasks. Starting work on broad tools without first choosing a specific workflow—such as asset organization, LOD generation, or level preparation—can increase the maintenance burden.

The sources don’t provide specific hardware requirements or pricing, so it’s not possible to draw conclusions about investment. Teams should first test project-by-project plugin setup and how scripts behave across different execution methods. The API reference is marked experimental, and scripts run only in the editor environment, making compatibility checks important before production use.

Frequently asked questions

Do I need to install Python separately to use it in Unreal Engine?

According to Epic Games documentation, Python Editor Script Plugin includes embedded Python 3.11.8, so there’s no need to install Python separately.

Can Unreal Engine Python scripts be used while a game is running?

No. The documentation states that the Python environment is available inside Unreal Editor, but not in Play In Editor, Standalone Game, or packaged applications.

How do I run an Unreal Editor Python script?

You can run a script from the Output Log console, the File menu, the command line, or editor-focused Blueprint nodes. The best method depends on whether the script needs access to a level and on the type of automation.

Comments and the forum are in Turkish.Join the discussion
+

Related news