Skip to main content

C++ API

Other plugins and project modules can call the organizer directly instead of going through the editor UI. The public surface is IUeaboOrganizer.h plus the types it uses, and it's stable across the 1.x series.

Dependency​

Add UeaboCore to your module's PublicDependencyModuleNames (or PrivateDependencyModuleNames) in your Build.cs file. Add UeaboEditor too if you build the options from the user's settings.

#include "IUeaboOrganizer.h"

Getting the module​

IUeaboOrganizer& Organizer = IUeaboOrganizer::Get();

Options​

#include "UeaboSettings.h" // UeaboEditor module: options from the user's saved settings
FUeaboOrganizeOptions Options = GetDefault<UUeaboSettings>()->ToOptions();

UUeaboSettings::ToOptions() (module UeaboEditor) builds the options from the user's Settings, so a plugin-driven pass behaves like the shortcut. FUeaboOrganizeOptions (module UeaboCore) can also be built by hand: its default constructor holds the same defaults as the settings, except CategoryRules, which starts empty (the settings ship with default rules). The core never reads editor settings, so it also works in commandlets and tests.

GroupFields
Layoutfloat HorizontalSpacing (80), float VerticalSpacing (40), bool bInsertReroutes, bool bStraightenLinks
Commentsbool bCreateComments, int32 ClusterCommentThreshold (8), float CommentPadding (30), FLinearColor EventColor, InputColor, TimerColor, UIColor, NetworkColor, DefaultColor
Hygienebool bRemoveOrphanNodes, bool bRemoveNoOpReroutes, bool bMergeDuplicateCasts
Membersbool bSortVariables, bool bAutoCategorize, TArray<FUeaboCategoryRule> CategoryRules (FString Pattern, EUeaboMatch Match = Prefix/Suffix/Contains, FString Category), bool bEnforceBoolPrefix, bool bEnforcePascalCase, bool bSortFunctions
Reportint32 LongChainThreshold (15), int32 BranchDepthThreshold (3)

Organizing​

FUeaboOrganizeResult OrganizeGraph(UEdGraph* Graph, const FUeaboOrganizeOptions& Options);
FUeaboOrganizeResult OrganizeBlueprint(UBlueprint* Blueprint, const FUeaboOrganizeOptions& Options);

OrganizeGraph organizes a single graph; OrganizeBlueprint organizes every graph in a Blueprint plus its members. Both run as a single undoable transaction, exactly like the editor shortcuts.

Result​

FUeaboOrganizeResult reports what happened:

FieldTypeMeaning
bSuccessboolWhether the pass completed.
ErrorFStringSet when bSuccess is false (for example a null graph).
Before / AfterFUeaboGraphStatsNodes, Crossings, Comments, Orphans, taken before and after the pass.
OrphansRemovedint32Orphan nodes deleted.
ReroutesRemoved / ReroutesInsertedint32No-op reroutes deleted / reroutes added around node bodies.
CastsMergedint32Duplicate casts merged.
CommentsCreated / CommentsResizedint32Section comments added / existing comments resized.
VariablesRenamed / VariablesRecategorizedint32Member renames (bool prefix, PascalCase) / categories assigned by rules.
SuggestionsTArray<FString>Refactoring candidates (long exec chains, deep branching, pure candidates).
NotesTArray<FString>Findings reported but not changed.

Node metrics​

#include "UeaboNodeMetrics.h" exposes the measurements the layout uses:

FVector2D UeaboNodeMetrics::GetNodeSize(const UEdGraphNode* Node); // rendered size, stored size, or estimate
FString UeaboNodeMetrics::GetTitleLine(const UEdGraphNode* Node); // first line of the node title

Stability​

This API is stable in the 1.x series: signatures in IUeaboOrganizer.h won't break across 1.x releases.