BlueprintPseudocode guide

File layout

How a Blueprint's text is laid out: the header, the sections in their fixed order, and the notes that open an incomplete file.

Sections, in order

Sections always come in this order, and a section with nothing in it is left out. Inside a section, variables, functions, macros and event dispatchers come in the order the My Blueprint panel lists them, so dragging one there, or a category, moves it in the text too. Events come in three groups, each sorted by name: those that override a parent's event, then interface events, then the Blueprint's own. Components follow their attachment tree. Moving nodes around on the canvas doesn't change the text. A function with an empty body says // (empty), and so does an event graph that holds only the greyed-out events of a new Blueprint.

The first line names the text format, which changes only in a minor release (Text format).

Node, pin and enum names are written in English, whatever language the editor is set to, and as the engine version names them. So one Blueprint can read differently in 4.27 and UE5: UE5 has double and Multiply_DoubleDouble where 4.27 has float and Multiply_FloatFloat.

// Generated by the BlueprintPseudocode plugin, text format 1 - read-only view for code review.
// How to read this file: Docs/Guide.html in the BlueprintPseudocode plugin's folder, or online at https://jeremi247.github.io/BlueprintCodeReviewGuide/

class BP_Rifle extends BP_WeaponBase implements BPI_Interactable

// ===== Variables =====
// ===== Components =====
// ===== Class defaults (differ from BP_WeaponBase) =====
// ===== View models =====                  and the other MVVM sections
// ===== Functions =====
// ===== Interface BPI_Interactable =====
// ===== Event dispatchers =====
// ===== Event graph: EventGraph =====      one per event graph page
// ===== Macros =====

Notes at the top

A file that opens with // notes, above the header, is incomplete, and the notes say where. The plugin reads the Blueprint's file, and takes what only compiled C++ knows (class parents, function flags, enum names, struct defaults) from a metadata table.

  • Not in the metadata: ...: one line for each class, function, enum, struct or property the table lacks. Calls to them are still read, in a longer form: an operator as a call, an enum value as saved. A struct value it lacks says so at the end of its line.
  • The project has no metadata or is out of date: your project's table is missing or older than its C++.
  • The engine was not found: no engine install was found, and the project's generated data holds no engine archive. The engine's renames are not shown as redirect lines, and engine macros and assets are not read.
  • Unsaved changes are not included: you exported from the editor and chose not to save.

When a class or the project's table is missing, the last note says how to fix it. The editor writes your project's table, Metadata-Project.tsv, to Saved/BlueprintPseudocode/GeneratedData each time it starts, and beside it EngineContext.tar, the engine files the plugin reads, for a machine with no engine install. Tools/BlueprintReader.py -GenerateMetadata, run as on the command line, writes both without opening the editor window, for a build machine or a fresh checkout; add -Project=<folder or .uproject> unless the plugin is in your project's Plugins folder. Either way, your project's C++ must be built first.

A graph of a kind the table lacks is left out, with a line saying so. An animation graph is always left out, as a non-script graph. In a diff, the notes of both sides go in the right-hand file, so a change in what is missing shows as a changed line.

// Not in the metadata: class /Script/MyGame.MyCharacter
// Not in the metadata: function /Script/MyGame.MyLibrary:Heal
// Not in the metadata: struct MyStats
// The project has no metadata: calls and values of its C++ are incomplete
// Unsaved changes are not included
// Update the metadata by running the editor or Tools/BlueprintReader.py -GenerateMetadata

// Generated by the BlueprintPseudocode plugin - read-only view for code review.
...
MyStats Stats = (Health=50.0)  // struct MyStats: not in the metadata, unsaved fields are not filled in