Python Script Editor

Python script editor plugin for Unreal Engine

Developer Guide

Architecture Overview

The Python Script Editor is structured as a standard Unreal Engine plugin with clear separation of concerns:

Core Components

Key Classes

Environment Variables

Building from Source

  1. Clone the repository
  2. Copy to your project’s Plugins directory
  3. Regenerate project files
  4. Build the project

Settings System

The PythonScriptEditorSettings class manages:

Default Paths

Default user data path: [ProjectContent]/PythonScriptEditor/

Contributing Guidelines

  1. Follow Unreal Engine coding standards
  2. Add proper documentation for new features
  3. Include unit tests where applicable
  4. Update architecture decision records (ADRs)

Plugin Structure

Source/
β”œβ”€β”€ Private/
β”‚   β”œβ”€β”€ Core/                   # Core plugin functionality
β”‚   β”‚   β”œβ”€β”€ PythonScriptEvaluator.h   # Python execution engine
β”‚   β”‚   └── ScriptRegistry.h          # Script management
β”‚   β”œβ”€β”€ Components/            # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ STabWidget.h      # Custom tab management system
β”‚   β”‚   └── SInteractiveEditableText.h # Base for I/O panels
β”‚   β”œβ”€β”€ Dialogs/              # Modal windows and dialogs
β”‚   β”‚   β”œβ”€β”€ Settings/         # Settings UI
β”‚   β”‚   └── About/            # About dialog
β”‚   β”œβ”€β”€ Interfaces/           # Plugin interfaces
β”‚   β”‚   β”œβ”€β”€ IPythonRunner.h   # Python execution interface
β”‚   β”‚   └── ISettingsProvider.h # Settings management
β”‚   β”œβ”€β”€ Marshallers/          # Data conversion and formatting
β”‚   β”‚   β”œβ”€β”€ SyntaxHighlight/  # Syntax highlighting
β”‚   β”‚   └── OutputFormatter/   # Output formatting
β”‚   └── Widgets/              # Main UI widgets
β”‚       β”œβ”€β”€ SPythonTextEditor.h # Main editor (links to PythonScriptEvaluator)
β”‚       └── SOutputLogPanel.h   # Output display
└── Public/                    # Public API
    β”œβ”€β”€ PythonScriptEditorDefs.h
    └── PythonScriptEditorModule.h

Component Architecture

Main Window Structure

Key Component Relationships

SPythonScriptEditorWindow
β”œβ”€β”€ Toolbar
β”œβ”€β”€ SOutputLogPanel
└── STabWidget (Tab Container)
  └── Multiple SPythonTextEditor instances

Execution Flow

  1. User input captured in SPythonTextEditor
  2. Code passed to PythonScriptEvaluator
  3. Results processed through OutputFormatter
  4. Display updated via SOutputLogPanel