Latest news
TutorialsUnreal EngineOMAMAS

Python Automation in Unreal Engine: Enable the Plugin and Run Your First Script

This guide walks you through enabling Python support in Unreal Editor, running code from the console or a script file, and using automation options. Python is available in the editor, not while a game is running.

Architectural visualization workspace evoking Python automationAI image
Representative image, generated with AI.Image: 3dsınıfı / FCA AI

In brief

  1. Python support is provided by the Python Editor Script Plugin, which must be enabled separately for each Unreal Engine project.
  2. According to the official documentation, the plugin includes an embedded version of Python 3.11.8; there’s no need to install Python separately on your computer.
  3. Python scripts can be run from the console, the File menu, the command line, startup scripts, or Blueprint nodes available only in editor classes.
  4. Python in Unreal Editor is not a gameplay programming language for use while a game is running; it is designed for editor and content-production automation.

What you’ll learn in this guide

To start using Python in Unreal Editor, first enable the relevant plugin for your project, then run your code using an appropriate method. This guide covers enabling the plugin, running code from the console, executing a Python file, and options for making automation repeatable. Epic Games’ documentation positions Python in the editor as a tool for tasks such as asset management, placing content in levels, and automating some time-consuming work.

The scope is important: this Python environment is for Unreal Editor. Python code cannot be used while the project is running in Play In Editor mode, as a standalone game, or as a packaged application. So the steps here are a starting point for editor and production-pipeline automation, not gameplay logic.

Requirements

  • An Unreal Engine project and Unreal Editor.

  • The Python Editor Script Plugin, enabled for the project.

  • The Editor Scripting Utilities plugin, recommended by the guide for common editor operations APIs.

  • No separate Python installation is required: according to Epic Games’ documentation, the Python Editor Script Plugin includes Python 3.11.8.

The Unreal Python API documentation is marked “5.8 (Experimental).” Epic Games also warns that the feature is experimental and should be used with care, especially when preparing a product for release. It’s therefore a good idea to test the steps here in a copy of your production project or in a test project first. The sources do not mention an account requirement.

Step by step: Enable Python and run code

1. Enable the plugins in your project

Open the target project in Unreal Editor and go to Edit > Plugins from the main menu. In the Scripting section of the Plugins window, find Python Editor Script Plugin and enable the Enabled option. Epic Games also recommends enabling Editor Scripting Utilities, which provides streamlined APIs for common editor operations.

This setting must be applied separately for each project. Restart the editor after enabling the plugins. Don’t skip this step: the guide calls for restarting the editor after installing the plugins.

2. Use Python mode in the console

To try out code line by line or run a short snippet right away, switch the console input in the Output Log panel to Python mode. You can also open the console input bar with the ~ key. Lines entered in Python mode run immediately; use Shift+Enter for multiple lines, or paste a multiline block from a text editor.

This is a convenient way to experiment interactively. Output from the print function is also sent to the Output Log panel. When the command console is in Cmd mode, you can use the py command to run the rest of the line as Python. Here’s an example of calling an existing script file this way:

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

The file path here is an example from the guide; replace it with the path to your own script.

3. Run a script file from the File menu

To select a file you haven’t run before, use File > Execute Python Script in the main window. You can select previously run files again from the Recent Python scripts list. The editor reads the file from disk each time, so it will run the latest changes you’ve made to the script.

This method lets you run code from a file without repeatedly pasting it into the console. The source does not specify an automated security or validation step for what the file does, so check the script and target project before running it.

4. Run with the full editor from the command line

If a script interacts with project content or a level that may take time to load, you can use the method that starts the full Unreal Editor. The editor opens the project, loads the default startup level, and runs the script once the environment is ready. The source guide’s Windows command-line example is:

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

The Editor Scripting Utilities plugin must be enabled for this option, and the Python Scripting Plugin must already be enabled in the project specified in the command. According to the guide, the editor closes after the script finishes.

5. Consider the headless commandlet option

The commandlet method offers faster execution without opening the editor interface—that is, it can run headlessly. The guide shows how to use the -run=pythonscript and -script arguments with UnrealEditor-Cmd.exe:

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

This method does not load levels automatically. If your script needs a level, the source says the level-loading call should be the first thing the script does:

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

The project, script, and level paths in the commandlet examples are sample values from the documentation; replace them with the paths used by your actual project.

6. Run recurring tasks at startup

If a team working with the same project or plugin needs the same setup code every time the editor opens, you can use init_unreal.py. If the editor finds a file with that name in its configured Python paths, it runs the file automatically. The guide says it can be placed in the project’s or plugin’s Content/Python folder.

To assign one or more files to run every time a project opens, go to Edit > Project Settings, then Plugins > Python, and add the scripts under Startup scripts. Restart the editor after changing the setting; the scripts run the next time the editor opens, once the default startup level has finished loading.

Common mistakes

  • Assuming it’s enough to enable the plugin just once: Python Editor Script Plugin must be enabled separately for each project.

  • Trying to use Python at runtime: This feature is for the editor; it is unavailable during Play In Editor, Standalone Game, or in a packaged application.

  • Assuming the commandlet will load the level automatically: The source explicitly says that commandlets do not load levels on their own.

  • Starting a script before the editor is ready: The guide advises against running a script with the py command in the ExecCmd startup parameter; the editor environment or startup level may not be ready yet.

  • Overlooking its experimental status: Python support is described as experimental. Test it in a controlled environment first, especially for projects approaching delivery or release.

Impact on architecture and visualization workflows

For architects, interior designers, and archviz teams building scenes in Unreal Engine, Python can provide a basis for scripting repetitive editor tasks, managing content, and placing content in levels. However, the sources don’t provide a specific architectural automation script; adapting Python to a workflow depends on the project’s content and the code written. The console is a good place for quick experiments, while running a file is a better starting point for reusable scripts.

The sources also do not mention requirements for a powerful graphics card, a paid license, or an account. So it isn’t possible to draw a firm conclusion about hardware or cost advantages. For teams, the key points to check are whether the plugins are enabled in the project, the editor context in which the script runs, and whether the experimental feature is suitable for the delivery process.

Next steps

Start by enabling the plugins in a test project and comparing the console and File menu methods. Then move one-off tasks into files, and consider project startup scripts for setup tasks that need to run regularly. If you need to use Python with Blueprint, remember that Python nodes are available only in editor classes such as Editor Utility Widget and Editor Utility Blueprint. According to the source, the Execute Python Script node runs a code snippet, not a file; Execute Python Command is available for a file or code. You can view error output in the Output Log panel.

Sources and licensing

This guide was prepared using Epic Games’ documentation on getting started with Python in Unreal Editor and the Python API. The source pages were provided under a free license for this content; the material has been adapted and rewritten in Turkish.

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 small archviz teams and students in Turkey, the ability to automate repetitive tasks in the editor may be useful, particularly for project setup and content management. Since the sources make no claims about startup costs or hardware requirements, it would not be accurate to present this approach as inherently cheaper or faster.

Offices should bear in mind that Python support is experimental and works only in the editor. A practical approach is to validate automation scripts in a copy of the project before sharing them with the team, document plugin settings, and check for unintended effects during delivery.

Frequently asked questions

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

According to Epic Games’ guide, the Python Editor Script Plugin includes an embedded version of Python 3.11.8, so there’s no need to install Python separately.

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

No. The documentation says the Python environment is available in Unreal Editor, but not in Play In Editor, Standalone Game, or a packaged application.

Does the Python plugin need to be enabled separately for each Unreal project?

Yes. Python Editor Script Plugin must be enabled separately for each project where it will be used, and the editor must be restarted afterward.

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

Related news