Latest news
TutorialsUnreal EngineOMA

Automating the Unreal Engine Editor with Python: A Step-by-Step Guide

Python scripts can automate tasks such as asset management and level editing in Unreal Editor. This guide covers plugin setup, ways to run code, and important limitations.

Workspace suggesting an automation workflow in an architectural visualization studioAI image
Representative image, generated with AI.Image: 3dsınıfı / FCA AI

In brief

  1. Python support is provided through the Python Editor Script Plugin, which must be enabled separately for each project.
  2. The Python version bundled with the editor is 3.11.8; no separate Python installation is required.
  3. Python can be used for automation inside Unreal Editor, but it is not a gameplay scripting language for use while a game is running.
  4. Epic’s Unreal Python API documentation marks version 5.8 as experimental.

What you’ll learn in this guide

Python support in Unreal Editor can be used to script repetitive production tasks and support pipelines that span different 3D applications. Examples in Epic’s documentation include automating asset management, generating LODs for Static Meshes, and procedurally populating a Level. Python can also be used to build custom interfaces for the editor.

In this guide, we’ll first configure the project, then run a short Python command and compare automation options using script files. The methods here are intended for editor automation: Python support is available while Unreal Editor is open, but not while a game is running in Play In Editor, Standalone Game, or a packaged executable.

Requirements

You’ll need an Unreal Engine project in which you can enable the Python Editor Script Plugin, as well as Unreal Editor. According to Epic’s guide, the plugin is enabled on a per-project basis; to use Python in another project, you’ll need to enable it there as well. It’s also recommended that you enable the Editor Scripting Utilities plugin, which provides simplified APIs for common editor operations.

The Python Editor Script Plugin bundles Python 3.11.8 inside Unreal Editor. That means you don’t need to install Python separately for the workflow described here. Using a different Python version requires setting the UE_PYTHON_DIR environment variable in your operating system and rebuilding Unreal Engine from source.

Epic’s Python API documentation marks Unreal Python 5.8 as “Experimental.” The main user guide also notes that the feature is experimental. It’s therefore a good idea to validate scripts in a copy of your production project or in a controlled test project first.

Step by step: enable the plugin and run your first command

  1. Open the project you’ll be working on in Unreal Editor. From the top menu, go to Edit > Plugins.

  2. In the Scripting section of the Plugins window, find Python Editor Script Plugin and check the Enabled box.

  3. Enable the Editor Scripting Utilities plugin in the same window. Restart the editor after making these changes.

  4. Open the Output Log panel and switch the console input to Python mode. Alternatively, press the ~ key to open the console input bar. Code entered in Python mode runs immediately in the editor.

  5. As a first test, use Python’s print function to display a message in the Output Log:

python
print("Python etkin")

Output from print is sent to the Output Log panel. To run multiple lines in the console, separate them with Shift+Enter or paste in multiline code. This method is useful for trying out individual lines and running simple checks.

Options for running script files

For repeatable tasks, keeping your code in a Python file makes for a more organized workflow. You can run it by specifying the script file’s path in the editor console:

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

The path shown here is the example from Epic’s documentation; replace it with the location of your own script. Alternatively, select a script from your computer using File > Execute Python Script in the main window. You can also rerun previously executed files from the Recent Python scripts list. Since the editor reads the file from disk again, it will run the latest changes made to it.

Running from the command line is another option for teams that want to add scripts to an automation pipeline. You can launch the full editor and run the script after the project and default startup level have loaded:

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

For this approach, Python Scripting Plugin and Editor Scripting Utilities must be enabled in the project. The editor closes after the script finishes.

For faster, headless execution, you can use the pythonscript commandlet:

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

This method does not load levels automatically. If the script needs access to a particular Level’s contents, you can use the loading call shown as the first line in Epic’s documentation; the path in it belongs to the example project and should be adjusted to match the Level path in your project:

python
unreal.get_editor_subsystem(unreal.LevelEditorSubsystem).load_level("/Game/maps/UVlayoutTest.UVlayoutTest")

Common mistakes and limitations

One of the easiest things to overlook is that the plugin must be enabled for each project. Don’t assume a script that works in one project will also work in another; check the plugin settings for the relevant project first. For the full-editor command-line method, remember that Editor Scripting Utilities is also required.

The commandlet and full-editor launch methods do not behave the same way. Since the commandlet does not load levels automatically, scripts that depend on level contents need to handle the loading step explicitly. With the full-editor method, the project opens and the script runs after the default startup level is ready.

Trying to use Python for gameplay logic is also not an appropriate use case. Epic’s documentation states that the Python environment is available in Unreal Editor and cannot be used in runtime modes. Blueprint nodes for running Python are also available only in editor-focused Blueprint classes such as Editor Utility Widget and Editor Utility Blueprint; they cannot be used in regular runtime classes.

Implications for architecture, interior design, and archviz workflows

For architecture firms and visualization teams, the most immediate benefit is being able to manage repetitive asset operations through scripts in the editor. Organizing asset management across a project, automating LOD generation, and populating a level are among the use cases explicitly described in the documentation. Using Python as a shared scripting language across pipelines that involve multiple 3D applications can also help connect workflows.

That said, this guide does not provide compatibility guarantees for any specific archviz plugin or project, nor does it cover hardware requirements or licensing models. For APIs marked experimental in particular, verify that the functions you plan to use work in your project’s Unreal version. Don’t move automation into production without testing how it affects level loading, editor plugins, and project settings for other team members.

Next steps

After running your first script, choose a small, reversible task—for example, verifying a command from within the editor or carefully automating an existing production step. Then save the operation as a file and try Execute Python Script or a suitable command-line method. For projects used by multiple people, you can also consider startup scripts: init_unreal.py can be placed in the project’s or plugin’s Content/Python folder and run automatically by the editor. You can also configure scripts to run on startup in the project settings.

As your workflow grows, consult the Unreal Python API documentation alongside the version you’re using; it provides references for modules, types, and API headers. Keep the feature’s experimental status and the editor-only nature of the scripts in mind as you expand the scope gradually.

Sources and license

This guide was adapted into Turkish based on Epic Games’ “Scripting the Unreal Editor Using Python” guide and “Unreal Python API Documentation” page. The sources are marked for free use; the text and example descriptions have been reorganized.

Sources

2 sources
D
dev.epicgames.comdev.epicgames.com/documentation/en-us/unreal-engine/scripting-the-unreal-editor-using-python
Summary
D
dev.epicgames.comdev.epicgames.com/documentation/en-us/unreal-engine/python-api
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 and visualization teams in Turkey, Python automation is a practical starting point for reducing repetitive editor work. Documented use cases such as asset management, LOD generation, and populating level content can be worth exploring in production workflows that span multiple applications.

However, this guide does not provide information on hardware costs, licensing terms, or compatibility with specific plugins. The feature is also marked experimental. A safer approach for firms is to test scripts in a project copy, check plugin settings for each project, and clarify runtime expectations.

Frequently asked questions

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

No. The Python Editor Script Plugin bundles Python 3.11.8 inside Unreal Editor. Using a different version requires setting an environment variable and rebuilding Unreal Engine from source.

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

No. According to Epic’s documentation, the Python environment is for Unreal Editor and cannot be used in runtime modes such as Play In Editor, Standalone Game, or a packaged executable.

Is the Python plugin enabled in every Unreal Editor project?

No. Python Editor Script Plugin must be enabled separately for each project. Epic also recommends enabling the Editor Scripting Utilities plugin.

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

Related news