FTypePromotion

Contains behavior needed to handle type promotion in blueprints.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FNoncopyable

FTypePromotion

References

Module

BlueprintGraph

Header

/Engine/Source/Editor/BlueprintGraph/Classes/BlueprintTypePromotion.h

Include

#include "BlueprintTypePromotion.h"

Syntax

class FTypePromotion : private FNoncopyable

Remarks

Contains behavior needed to handle type promotion in blueprints. Creates a map of "Operations" to any of their matching UFunctions so that we can find the best possible match given several pin types.

Constructors

No constructors are accessible with public or protected access.

Destructors

No destructors are accessible with public or protected access.

Functions

Name Description

Public function Static

void

 

ClearNodeSpawners()

Clear all registered node spawners for operators from the system.

Public function Static

UFunction &#...

 

FindBestMatchingFunc

(
    FName Operation,
    const TArray< UEdGraphPin* >&...
)

Find the function that is the best match given the pins to consider.

Public function Static

FTypePromoti...

 

Get()

Creates a new singleton instance of TypePromotion if there isn't one and returns a reference to it

Public function Static

void

 

GetAllFuncsForOp

(
    FName Operation,
    TArray< UFunction* >& OutFunc...
)

Returns all functions for a specific operation.

Public function Static

const TSet< ...

 

GetAllOpNames()

Get a set of the supported operator names for type promo. Ex: "Add", "Subtract", "Multiply"

Public function Static

const TArray...

 

GetAvailablePrimitivePromotions

(
    const FEdGraphPinType& Type
)

Get a pointer to an array of available promotion types to a given pin type

Public function Static

const TSet< ...

 

GetComparisonOpNames()

Set of comparison operator names (GreaterThan, LessThan, etc)

Public function Static

ETypeCompari...

 

GetHigherType

(
    const FEdGraphPinType& A,
    const FEdGraphPinType& B
)

Given the two pin types check which pin type is higher.

Public function Static

const FText ...

 

GetKeywordsForOperator

(
    const FName Operator
)

Get the keywords metadata for the given operator name

Public function Static

UBlueprintFu...

 

GetOperatorSpawner

(
    FName OpName
)

Function node spawner associated with this operation

Public function Static

FName

 

GetOpNameFromFunction

(
    UFunction const*const Func
)

Parse the name of the operator that this function matches to (Add, Subtract, etc)

Public function Static

const TMap< ...

 

GetPrimativePromotionTable()

Get the "Primitive Promotion Table" which represents what base Pin types can be promoted to others.

Public function Static

FEdGraphPinT...

 

GetPromotedType

(
    const TArray< UEdGraphPin* >&...
)

Determine what type a given set of wildcard pins would result in

Public function Static

const FText ...

 

GetUserFacingOperatorName

(
    const FName Operator
)

Get the user facing version of this operator name

Public function Static

bool

 

HasStructConversion

(
    const UEdGraphPin* InputPin,
    const UEdGraphPin* OutputPin
)

Returns true if the given input pin can correctly be converted to the output type as a struct

Public function Static

bool

 

IsComparisonFunc

(
    UFunction const*const Func
)

Returns true if the given function is a comparison operator

Public function Static

bool

 

IsComparisonOpName

(
    const FName OpName
)

Returns true if the given op name is a comparison operator name

Public function Static

bool

 

IsFunctionPromotionReady

(
    const UFunction*const FuncToCo...
)

Returns true if the given function has been registered within the operator table

Public function Static

bool

 

IsOperatorSpawnerRegistered

(
    UFunction const*const Func
)

Returns true if the given function has a registered operator node spawner

Public function Static

bool

 

IsValidPromotion

(
    const FEdGraphPinType& A,
    const FEdGraphPinType& B
)

Returns true if A can be promoted to type B correctly, or if the types are equal

Public function Static

void

 

RefreshPromotionTables

(
    EReloadCompleteReason Reason
)

Clear out the promotion table and rebuild it, reassessing each available UFunction.

Public function Static

void

 

RegisterOperatorSpawner

(
    FName OpName,
    UBlueprintFunctionNodeSpawner*...
)

Keep track of the operator that this function provides so that we don't add multiple to the BP context menu

Public function Static

void

 

Shutdown()

Deletes the singleton instance of type promotion if there is one

Enums

Name

Description

Public enum

ETypeComparisonResult

Represents the possible results when comparing two types for promotion

Typedefs

Name

Description

FFunctionsList

A single operator can have multiple functions associated with it; usually for handling different types (int*int, vs. int*vector), hence this array.

Constants

Name

Description

Instance