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.
Header
#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.
| Group | Fields |
|---|---|
| Layout | float HorizontalSpacing (80), float VerticalSpacing (40), bool bInsertReroutes, bool bStraightenLinks |
| Comments | bool bCreateComments, int32 ClusterCommentThreshold (8), float CommentPadding (30), FLinearColor EventColor, InputColor, TimerColor, UIColor, NetworkColor, DefaultColor |
| Hygiene | bool bRemoveOrphanNodes, bool bRemoveNoOpReroutes, bool bMergeDuplicateCasts |
| Members | bool bSortVariables, bool bAutoCategorize, TArray<FUeaboCategoryRule> CategoryRules (FString Pattern, EUeaboMatch Match = Prefix/Suffix/Contains, FString Category), bool bEnforceBoolPrefix, bool bEnforcePascalCase, bool bSortFunctions |
| Report | int32 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:
| Field | Type | Meaning |
|---|---|---|
bSuccess | bool | Whether the pass completed. |
Error | FString | Set when bSuccess is false (for example a null graph). |
Before / After | FUeaboGraphStats | Nodes, Crossings, Comments, Orphans, taken before and after the pass. |
OrphansRemoved | int32 | Orphan nodes deleted. |
ReroutesRemoved / ReroutesInserted | int32 | No-op reroutes deleted / reroutes added around node bodies. |
CastsMerged | int32 | Duplicate casts merged. |
CommentsCreated / CommentsResized | int32 | Section comments added / existing comments resized. |
VariablesRenamed / VariablesRecategorized | int32 | Member renames (bool prefix, PascalCase) / categories assigned by rules. |
Suggestions | TArray<FString> | Refactoring candidates (long exec chains, deep branching, pure candidates). |
Notes | TArray<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.