FKismetCompilerUtilities

This is a loose collection of utilities used when 'compiling' a new [UClass](API\Runtime\CoreUObject\UObject\UClass) from a K2 graph.

Windows
MacOS
Linux

References

Module

KismetCompiler

Header

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

Include

#include "KismetCompilerMisc.h"

Syntax

class FKismetCompilerUtilities

Remarks

This is a loose collection of utilities used when 'compiling' a new UClass from a K2 graph.

Functions

Name Description

Public function Static

FFieldVarian...

 

CheckPropertyNameOnScope

(
    UStruct* Scope,
    const FName& PropertyName
)

Checks that the property name isn't taken in the given scope (used by CreatePropertyOnScope())

Public function Static

void

 

CompileDefaultProperties

(
    UClass* Class
)

Public function Static

void

 

ConsignToOblivion

(
    UClass* OldClass,
    bool bForceNoResetLoaders
)

Rename a class and it's CDO into the transient package, and clear RF_Public on both of them.

Public function Static

void

 

CreateObjectAssignmentStatement

(
    FKismetFunctionContext& Context,
    UEdGraphNode* Node,
    FBPTerminal* SrcTerm,
    FBPTerminal* DstTerm
)

Create Kismet assignment statement with proper object <-> interface cast

Public function Static

FProperty &#...

 

CreatePrimitiveProperty

(
    FFieldVariant PropertyScope,
    const FName& ValidatedPropertyName,
    const FName& PinCategory,
    const FName& PinSubCategory,
    UObject* PinSubCategoryObject,
    UClass* SelfClass,
    bool bIsWeakPointer,
    const UEdGraphSchema_K2* Schem...,
    FCompilerResultsLog& MessageLog
)

Helper function for creating property for primitive types.

Public function Static

FProperty &#...

 

CreatePropertyOnScope

(
    UStruct* Scope,
    const FName& PropertyName,
    const FEdGraphPinType& Type,
    UClass* SelfClass,
    EPropertyFlags PropertyFlags,
    const UEdGraphSchema_K2* Schem...,
    FCompilerResultsLog& MessageLog,
    UEdGraphPin* SourcePin
)

Creates a property named PropertyName of type PropertyType in the Scope or returns NULL if the type is unknown, but does not link that property in

Public function Static

void

 

DetectValuesReturnedByRef

(
    const UFunction* Func,
    const UK2Node* Node,
    FCompilerResultsLog& MessageLog
)

Generate an error for non-const output parameters

Public function Static

FProperty &#...

 

FindNamedPropertyInScope

(
    UStruct* Scope,
    FName PropertyName,
    bool& bIsSparseProperty
)

Finds a property by name, starting in the specified scope, returning NULL if it's not found.

Public function Static

const UFunct...

 

FindOverriddenImplementableEvent

(
    const FName& EventName,
    const UClass* Class
)

Return function, that overrides BlueprintImplementableEvent with given name in given class (super-classes are not considered)

Public function Static

FProperty &#...

 

FindPropertyInScope

(
    UStruct* Scope,
    UEdGraphPin* Pin,
    FCompilerResultsLog& MessageLog,
    const UEdGraphSchema_K2* Schem...,
    UClass* SelfClass,
    bool& bIsSparseProperty,
    bool bSuppressMissingMemberErrors
)

Finds a property by name, starting in the specified scope; Validates property type and returns NULL along with emitting an error if there is a mismatch.

Public function Static

TArray< TSet...

 

FindUnsortedSeparateExecutionGroups

(
    const TArray< UEdGraphNode* > ...
)

Find groups of nodes, that can be executed separately.

Public function Static

UEdGraphPin ...

 

GenerateAssignmentNodes

(
    FKismetCompilerContext& CompilerCo...,
    UEdGraph* SourceGraph,
    UK2Node_CallFunction* CallBegi...,
    UEdGraphNode* SpawnNode,
    UEdGraphPin* CallBeginResult,
    const UClass* ForClass
)

Create 'set var by name' nodes and hook them up - used to set values when components are added or actor are created at run time.

Public function Static

bool

 

IsIntermediateFunctionGraphTrivial

(
    FName FunctionName,
    const UEdGraph* FunctionGraph
)

Public function Static

bool

 

IsMissingMemberPotentiallyLoading

(
    const UBlueprint* SelfBlueprin...,
    const UStruct* MemberOwner
)

Intended to avoid errors that come from checking for external member (function, variable, etc.) dependencies.

Public function Static

bool

 

IsStatementReducible

(
    EKismetCompiledStatementType Statem...
)

Public function Static

bool

 

IsTypeCompatibleWithProperty

(
    UEdGraphPin* SourcePin,
    FProperty* Property,
    FCompilerResultsLog& MessageLog,
    const UEdGraphSchema_K2* Schem...,
    UClass* SelfClass
)

Tests to see if a pin is schema compatible with a property.

Public function Static

void

 

LinkAddedProperty

(
    UStruct* Structure,
    FProperty* NewProperty
)

Public function Static

void

 

RemoveObjectRedirectorIfPresent

(
    UObject* Package,
    const FString& ClassName,
    UObject* ObjectBeingMovedIn
)

Public function Static

void

 

UpdateBlueprintSkeletonStubClassAfterFailedCompile

(
    UBlueprint* Blueprint,
    UClass* StubClass
)

Public function Static

void

 

UpdateDependentBlueprints

(
    UBlueprint* BP
)

Add this BP to any BPs that it in

Public function Static

void

 

ValidateEnumProperties

(
    UObject* DefaultObject,
    FCompilerResultsLog& MessageLog
)

Checks if enum variables from given object store proper indexes

Public function Static

void

 

ValidateProperEndExecutionPath

(
    FKismetFunctionContext& Context
)

Checks if each execution path ends with a Return node

Public function Static

bool

 

ValidateSelfCompatibility

(
    const UEdGraphPin* Pin,
    FKismetFunctionContext& Context
)

Checks if the specified pin can default to self

Constants

Name

Description

ConsignToOblivionCounter

Counter to ensure unique names in the transient package, to avoid GC collection issues with classes and their CDOs

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss