FKismetCompilerContext

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

KismetCompiler

Header

/Engine/Source/Editor/KismetCompiler/Public/KismetCompiler.h

Include

#include "KismetCompiler.h"

Syntax

class FKismetCompilerContext : public FGraphCompilerContext

Variables

Name Description

Protected variable

int32

 

AverageNodeHeight

Protected variable

int32

 

AverageNodeWidth

Average node size for nodes with no size.

Public variable

bool

 

bAssignDelegateSignatureFunction

Flag to trigger FMulticastDelegateProperty::SignatureFunction resolution in CreateClassVariablesFromBlueprint:

Public variable

int32: 1

 

bIsFullCompile

Public variable

UBlueprint *...

 

Blueprint

Public variable

TMap< UEdGraphN...

 

CallsIntoUbergraph

Public variable

FNetNameMapping

 

ClassScopeNetNameMap

Map from a name to the number of times it's been 'created' (identical nodes create the same variable names, so they need something appended)

Protected variable

FKismetCompiler...

 

CompileOptions

This struct holds the various compilation options, such as which passes to perform, whether to save intermediate results, etc.

Public variable

UEdGraph *

 

ConsolidatedEventGraph

The ubergraph; valid from roughly the start of CreateAndProcessEventGraph.

Protected variable

TSet< FString >

 

CreatedFunctionNames

Names of functions created.

Protected variable

TMap< FName, FS...

 

DefaultPropertyValueMap

Map from UProperties to default object values, to be fixed up after compilation is complete.

Protected variable

TIndirectArray<...

 

FunctionList

List of functions currently allocated.

Protected variable

FOnFunctionList...

 

FunctionListCompiledEvent

Event that is broadcast immediately after the function list for this context has been compiled.

Protected variable

TArray< UEdGrap...

 

GeneratedFunctionGraphs

Set of function graphs generated for the class layout at compile time

Protected variable

int32

 

HorizontalNodePadding

Protected variable

int32

 

HorizontalSectionPadding

Padding.

Protected variable

UScriptStruct &...

 

LinearColorStruct

Public variable

TMap< UEdGraphN...

 

MacroGeneratedNodes

Map that can be used to find the macro node that spawned a provided node, if any.

Protected variable

int32

 

MacroRowMaxHeight

Maximum height encountered in this row; used to position the next row appropriately.

Protected variable

int32

 

MacroSpawnX

Used to space expanded macro nodes when saving intermediate results.

Protected variable

int32

 

MacroSpawnY

Protected variable

int32

 

MaximumSpawnX

Protected variable

int32

 

MinimumSpawnX

Maximum bounds of the spawning area.

Public variable

UBlueprintGener...

 

NewClass

Protected variable

TMap< TSubclass...

 

NodeHandlers

Map from node class to a handler functor.

Public variable

UObject *

 

OldCDO

Data that persists across CompileClassLayout/CompileFunctions calls:

Public variable

UBlueprintGener...

 

OldClass

Public variable

int32

 

OldGenLinkerIdx

Public variable

FLinkerLoad ...

 

OldLinker

Protected variable

UScriptStruct &...

 

RotatorStruct

Protected variable

UEdGraphSchema_...

 

Schema

Schema for the graph being compiled.

Public variable

TMap< UEdGraphN...

 

SourceNodeToExpansionEvent

Source pin to latent/delegate entry point.

Public variable

TMap< UEdGraphP...

 

SourcePinToExpansionEvent

Public variable

UBlueprintGener...

 

TargetClass

Protected variable

TMap< class UTi...

 

TimelineToMemberVariableMap

Map of properties created for timelines; to aid in debug data generation.

Protected variable

UScriptStruct &...

 

TransformStruct

Public variable

FKismetFunction...

 

UbergraphContext

The ubergraph context; valid from the end of CreateAndProcessEventGraph.

Protected variable

UScriptStruct &...

 

VectorStruct

Protected variable

int32

 

VerticalSectionPadding

Constructors

Name Description

Public function

FKismetCompilerContext

(
    UBlueprint* SourceSketch,
    FCompilerResultsLog& InMessageLog,
    const FKismetCompilerOptions& InCo...
)

Destructors

Name Description

Public function Virtual

~FKismetCompilerContext()

Functions

Name Description

Protected function Virtual

void

 

AddInterfacesFromBlueprint

(
    UClass* Class
)

Handles adding the implemented interface information to the class

Protected function

void

 

AdvanceMacroPlacement

(
    int32 Width,
    int32 Height
)

Advances the macro position tracking.

Protected function

void

 

AutoAssignNodePosition

(
    UEdGraphNode* Node
)

Protected function

void

 

BuildDynamicBindingObjects

(
    UBlueprintGeneratedClass* Clas...
)

Build the dynamic bindings objects used to tie events to delegates at runtime

Protected function

void

 

CheckConnectionResponse

(
    const FPinConnectionResponse& Resp...,
    const UEdGraphNode* Node
)

Checks a connection response, and errors if it didn't succeed (not public, users should be using MovePinLinksToIntermediate/CopyPinLinksToIntermediate instead of wrapping their own with this).

Protected function Virtual

void

 

CleanAndSanitizeClass

(
    UBlueprintGeneratedClass* Clas...,
    UObject*& OldCDO
)

Removes the properties and functions from a class, so that new ones can be created in its place

Public function

void

 

Compile()

Compile a blueprint into a class and a set of functions

Public function

void

 

CompileClassLayout

(
    EInternalCompilerFlags InternalFlag...
)

Compile the class layout of the blueprint

Protected function Virtual

void

 

CompileFunction

(
    FKismetFunctionContext& Context
)

Second phase of compiling a function graph

Public function

void

 

CompileFunctions

(
    EInternalCompilerFlags InternalFlag...
)

Compile the functions of the blueprint - must be done after compiling the class layout:

Public function

FPinConnecti...

 

CopyPinLinksToIntermediate

(
    UEdGraphPin& SourcePin,
    UEdGraphPin& IntermediatePin
)

Copies pin links over from the source-pin to the specified intermediate, and validates the result (additionally logs a redirect from the intermediate-pin back to the source so we can back trace for debugging, etc.)

Protected function Virtual

void

 

CopyTermDefaultsToDefaultObject

(
    UObject* DefaultObject
)

Copies default values cached for the terms in the DefaultPropertyValueMap to the final CDO

Protected function

void

 

CreateAndProcessUbergraph()

Merges pages and creates function stubs, etc...

Public function Virtual

void

 

CreateClassVariablesFromBlueprint()

Creates a class variable for each entry in the Blueprint NewVars array

Protected function

void

 

CreateCommentBlockAroundNodes

(
    const TArray< UEdGraphNode* > ...,
    UObject* SourceObject,
    UEdGraph* TargetGraph,
    FString CommentText,
    FLinearColor CommentColor,
    int32& Out_OffsetX,
    int32& Out_OffsetY
)

Protected function

FKismetFunct...

 

CreateFunctionContext()

Creates a new function context and adds it to the function list to be processed.

Protected function Virtual

void

 

CreateFunctionList()

Creates a list of functions to compile

Protected function

void

 

CreateFunctionStubForEvent

(
    UK2Node_Event* Event,
    UObject* OwnerOfTemporaries
)

Create a stub function graph for the event node, and have it invoke the correct point in the ubergraph

Protected function

void

 

CreateLocalVariablesForFunction

(
    FKismetFunctionContext& Context,
    FField**& FunctionProperty...
)

Creates the properties on a function that store the local and event graph (if applicable) variables

Protected function

void

 

CreateParametersForFunction

(
    FKismetFunctionContext& Context,
    UFunction* ParameterSignature,
    FField**& FunctionProperty...
)

Create the properties on a function for input/output parameters

Protected function

void

 

CreatePropertiesFromList

(
    UStruct* Scope,
    FField**& PropertyStorageL...,
    TIndirectArray< FBPTerminal >& Ter...,
    EPropertyFlags PropertyFlags,
    bool bPropertiesAreLocal,
    bool bPropertiesAreParameters
)

Creates a property with flags including PropertyFlags in the Scope structure for each entry in the Terms array

Protected function Virtual

UEdGraphSche...

 

CreateSchema()

Protected function Static

FProperty &#...

 

CreateUserDefinedLocalVariableForFunction

(
    const FBPVariableDescription& Vari...,
    UFunction* Function,
    UBlueprintGeneratedClass* Owni...,
    FField**& FunctionProperty...,
    const UEdGraphSchema_K2* Schem...,
    FCompilerResultsLog& MessageLog
)

Helper function for CreateUserDefinedLocalVariablesForFunction and compilation manager's FastGenerateSkeletonClass:

Protected function

void

 

CreateUserDefinedLocalVariablesForFunction

(
    FKismetFunctionContext& Context,
    FField**& FunctionProperty...
)

Creates user defined local variables for function

Protected function

FProperty &#...

 

CreateVariable

(
    const FName Name,
    const FEdGraphPinType& Type
)

Creates a class variable

Protected function Const

void

 

DetermineNodeExecLinks

(
    UEdGraphNode* SourceNode,
    TMap< UEdGraphPin*, UEdGraphPi...
)

Discovers exec pin links for the sourcenode

Protected function Virtual

void

 

EnsureProperGeneratedClass

(
    UClass*& TargetClass
)

Backwards Compatability: Ensures that the passed in TargetClass is of the proper type (e.g. BlueprintGeneratedClass, AnimBlueprintGeneratedClass), and NULLs the reference if it is not

Protected function

void

 

ExpandTimelineNodes

(
    UEdGraph* SourceGraph
)

Expand timeline nodes into necessary nodes

Protected function

void

 

ExpandTunnelsAndMacros

(
    UEdGraph* SourceGraph
)

Expands any macro instances and collapses any tunnels in the nodes of SourceGraph

Protected function

void

 

ExpansionStep

(
    UEdGraph* Graph,
    bool bAllowUbergraphExpansions
)

Expands out nodes that need it.

Protected function Const

const UK2Nod...

 

FindLocalEntryPoint

(
    const UFunction* Function
)

Scan FunctionList and return Entry point, for matching one

Protected function Virtual

void

 

FinishCompilingClass

(
    UClass* Class
)

Handles final post-compilation setup, flags, creates cached values that would normally be set during deserialization, etc...

Protected function

void

 

FinishCompilingFunction

(
    FKismetFunctionContext& Context
)

Handles final post-compilation setup, flags, creates cached values that would normally be set during deserialization, etc...

Public function Static

TSharedPtr< ...

 

GetCompilerForBP

(
    UBlueprint* BP,
    FCompilerResultsLog& InMessageLog,
    const FKismetCompilerOptions& InCo...
)

Public function

FName

 

GetEventStubFunctionName

(
    UK2Node_Event* SrcEventNode
)

Picks the name to use for an autogenerated event stub

Public function Const

FString

 

GetGuid

(
    const UEdGraphNode* Node
)

Public function Const

const UEdGra...

 

GetSchema()

Protected function Const

FName

 

GetUbergraphCallName()

Gets the unique name for this context's ExecuteUbergraph function

Protected function Virtual Const

bool

 

IsNodePure

(
    const UEdGraphNode* Node
)

Determines if a node is pure

Protected function

void

 

MapExpansionPathToTunnelInstance

(
    const UEdGraphNode* InnerExpan...,
    const UEdGraphNode* OuterTunne...
)

Maps the nodes in an intermediate tunnel expansion path back to the owning tunnel instance node.

Protected function Virtual

void

 

MergeUbergraphPagesIn

(
    UEdGraph* Ubergraph
)

Merges in any all ubergraph pages into the gathering ubergraph

Public function

FPinConnecti...

 

MovePinLinksToIntermediate

(
    UEdGraphPin& SourcePin,
    UEdGraphPin& IntermediatePin
)

Moves pin links over from the source-pin to the specified intermediate, and validates the result (additionally logs a redirect from the intermediate-pin back to the source so we can back trace for debugging, etc.)

Public function

FOnFunctionL...

 

OnFunctionListCompiled()

Broadcasts a notification immediately after the function list for this context has been compiled.

Protected function Virtual

void

 

OnNewClassSet

(
    UBlueprintGeneratedClass* Clas...
)

Protected function Virtual

void

 

OnPostCDOCompiled()

Public function

void

 

PostCDOCompiled()

Called after the CDO has been generated, allows assignment of cached/derived data:

Protected function Virtual

void

 

PostCompile()

Protected function Virtual

void

 

PostCompileDiagnostics()

Gives derived classes a chance to emit debug data.

Protected function Virtual

void

 

PostcompileFunction

(
    FKismetFunctionContext& Context
)

Final phase of compiling a function graph; called after all functions have had CompileFunction called

Protected function Virtual

void

 

PostCreateSchema()

Protected function Virtual

void

 

PostExpansionStep

(
    const UEdGraph* Graph
)

Gives derived classes a chance to process post-node expansion.

Protected function Virtual

void

 

PreCompile()

Gives derived classes a chance to hook up any custom logic.

Protected function Virtual

void

 

PrecompileFunction

(
    FKismetFunctionContext& Context,
    EInternalCompilerFlags InternalFlag...
)

First phase of compiling a function graph

Protected function Virtual

void

 

PreCompileUpdateBlueprintOnLoad

(
    UBlueprint* BP
)

Used for performing custom patching during stage IX of the compilation during load.

Protected function Const

void

 

PrintVerboseInformation

(
    UClass* Class
)

Protected function Const

void

 

PrintVerboseInfoStruct

(
    UStruct* Struct
)

Protected function

void

 

ProcessIntermediateTunnelBoundary

(
    UK2Node_Tunnel* TunnelInput,
    UK2Node_Tunnel* TunnelOutput
)

Processes an intermediate tunnel expansion boundary.

Protected function Virtual

void

 

ProcessOneFunctionGraph

(
    UEdGraph* SourceGraph,
    bool bInternalFunction
)

Merges macros/subgraphs into the graph and validates it, creating a function list entry if it's reasonable.

Protected function

void

 

PropagateValuesToCDO

(
    UObject* NewCDO,
    UObject* OldCDO
)

Non virtual wrapper to encapsulate functions that occur when the CDO is ready for values:

Protected function

void

 

PruneIsolatedNodes

(
    UEdGraph* InGraph,
    bool bInIncludeNodesThatCouldBeExpa...
)

Prune isolated nodes given the specified graph

Public function Static

void

 

RegisterCompilerForBP

(
    UClass* BPClass,
    CompilerContextFactoryFunction Fact...
)

Protected function Virtual

void

 

SaveSubObjectsFromCleanAndSanitizeClass

(
    FSubobjectCollection& SubObjectsTo...,
    UBlueprintGeneratedClass* Clas...
)

Saves any SubObjects on the blueprint that need to survive the clean

Protected function Virtual

void

 

SetCalculatedMetaDataAndFlags

(
    UFunction* Function,
    UK2Node_FunctionEntry* EntryNo...,
    const UEdGraphSchema_K2* Schem...
)

Adds metadata for a particular compiled function based on its characteristics

Protected function Const

void

 

SetCanEverTick()

Function works only if subclass of AActor or UActorComponent.

Protected function Static

void

 

SetDefaultInputValueMetaData

(
    UFunction* Function,
    const TArray< TSharedPtr< FUserPinI...
)

Reflects each pin's user set, default value into the function's metadata (so it can be queried for later by CallFunction nodes, etc.)

Public function

void

 

SetNewClass

(
    UBlueprintGeneratedClass* Clas...
)

Function used to assign the new class that will be used by the compiler

Protected function

void

 

SetPropertyDefaultValue

(
    const FProperty* PropertyToSet,
    FString& Value
)

Adds a default value entry into the DefaultPropertyValueMap for the property specified

Public function

NodeType ...

 

SpawnIntermediateEventNode

(
    UEdGraphNode* SourceNode,
    UEdGraphPin* SourcePin,
    UEdGraph* ParentGraph
)

Spawns an intermediate event node associated with the source node (for error purposes)

Public function

UEdGraph ...

 

SpawnIntermediateFunctionGraph

(
    const FString& InDesiredFunctionNa...
)

Spawn an intermediate function graph for this compilation using the specified desired name (which may be modified to make it unique

Public function

NodeType ...

 

SpawnIntermediateNode

(
    UEdGraphNode* SourceNode,
    UEdGraph* ParentGraph
)

Spawns an intermediate node associated with the source node (for error purposes)

Public function

UK2Node_Temp...

 

SpawnInternalVariable

(
    UEdGraphNode* SourceNode,
    FName Category,
    FName SubCategory,
    UObject* SubcategoryObject,
    EPinContainerType PinContainerType,
    const FEdGraphTerminalType& ValueT...
)

Protected function Virtual

void

 

SpawnNewClass

(
    const FString& NewClassName
)

Protected function Virtual

void

 

TransformNodes

(
    FKismetFunctionContext& Context
)

Performs transformations on specific nodes that require it according to the schema

Public function Const

bool

 

UsePersistentUberGraphFrame()

Public function

void

 

ValidateClassPropertyDefaults()

Ensures that all class reference Properties are legal overrides of the parent class by checking the default value set on any PC_Class variable types.

Public function

void

 

ValidateComponentClassOverrides()

Ensures that all component class overrides are legal overrides of the parent class

Protected function

void

 

ValidateFunctionGraphNames()

Ensures that all function graphs have valid names for compilation/replication

Protected function Virtual

bool

 

ValidateGeneratedClass

(
    UBlueprintGeneratedClass* Clas...
)

Validates the generated class

Protected function

void

 

ValidateNoWildcardPinsInGraph

(
    const UEdGraph* SourceGraph
)

Checks if pin types are unresolved (e.g. still wildcards).

Protected function

void

 

ValidateSelfPinsInGraph

(
    FKismetFunctionContext& Context
)

Checks if self pins are connected.

Protected function

void

 

ValidateTimelineNames()

Ensures that all timelines have valid names for compilation/replication

Public function

void

 

ValidateVariableNames()

Ensures that all variables have valid names for compilation/replication

Protected function

void

 

VerifyValidOverrideEvent

(
    const UEdGraph* Graph
)

If a function in the graph cannot be placed as event make sure that it is not.

Protected function

void

 

VerifyValidOverrideFunction

(
    const UEdGraph* Graph
)

If a function in the graph cannot be overridden make sure that it is not.

Overridden from FGraphCompilerContext

Name Description

Protected function Virtual Const

bool

 

CanIgnoreNode

(
    const UEdGraphNode* Node
)

Can this node be ignored for further processing?

Protected function Virtual Const

bool

 

PinIsImportantForDependancies

(
    const UEdGraphPin* Pin
)

Does this pin potentially participate in data dependencies?

Protected function Virtual

void

 

PruneIsolatedNodes

(
    const TArray< UEdGraphNode* > ...,
    TArray< UEdGraphNode* >& Grap...
)

Prunes any nodes that weren't visited from the graph, printing out a warning

Protected function Virtual Const

bool

 

ShouldForceKeepNode

(
    const UEdGraphNode* Node
)

Should this node be kept even if it's not reached?

Protected function Virtual Const

void

 

ValidateLink

(
    const UEdGraphPin* PinA,
    const UEdGraphPin* PinB
)

Validates that the interconnection between two pins is schema compatible

Protected function Virtual Const

void

 

ValidateNode

(
    const UEdGraphNode* Node
)

Validates that the node is schema compatible

Protected function Virtual Const

void

 

ValidatePin

(
    const UEdGraphPin* Pin
)

Validate that the wiring for a single pin is schema compatible

Classes

Typedefs

Name

Description

Super

Constants

Name

Description

OnPostCompile

OnPreCompile

Deprecated Functions

Name Description

Public function

UK2Node_Temp...

 

SpawnInternalVariable

(
    UEdGraphNode* SourceNode,
    const FString& Category,
    const FString& SubCategory,
    UObject* SubcategoryObject,
    bool bIsArray,
    bool bIsSet,
    bool bIsMap,
    const FEdGraphTerminalType& ValueT...
)

Use version that takes Category and SubCategory as FName, and PinContainerType instead of separate booleans for array, set, and map

Public function

UK2Node_Temp...

 

SpawnInternalVariable

(
    UEdGraphNode* SourceNode,
    const FNameParameterHelper Category,
    const TCHAR* SubCategory,
    UObject* SubcategoryObject,
    EPinContainerType PinContainerType,
    const FEdGraphTerminalType& ValueT...
)

Remove when removing versions that take subcategory as FString. Required to avoid ambiguity

Public function

UK2Node_Temp...

 

SpawnInternalVariable

(
    UEdGraphNode* SourceNode,
    const FNameParameterHelper Category,
    const FString& SubCategory,
    UObject* SubcategoryObject,
    EPinContainerType PinContainerType,
    const FEdGraphTerminalType& ValueT...
)

Use version that takes Category and SubCategory as FName