UMaterialFunction

A Material Function is a collection of material expressions that can be reused in different materials

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Materials/MaterialFunction.h

Include

#include "Materials/MaterialFunction.h"

Syntax

class UMaterialFunction : public UMaterialFunctionInterface

Remarks

A Material Function is a collection of material expressions that can be reused in different materials

Variables

Name Description

Public variable

uint8 : 1

 

bExposeToLibrary

Whether to list this function in the material function library, which is a window in the material editor that lists categorized functions.

Public variable

uint8 : 1

 

bPrefixParameterNames

If true, parameters in this function will have a prefix added to their group name.

Public variable

TArray < class U ...

 

DependentFunctionExpressionCandidates

Public variable

FString

 

Description

Description of the function which will be displayed as a tooltip wherever the function is used.

Public variable

TArray < class U ...

 

FunctionEditorComments

Array of comments associated with this material; viewed in the material editor.

Public variable

TArray < UMateri ...

 

FunctionExpressions

Array of material expressions, excluding Comments. Used by the material editor.

Public variable

TArray < FText >

 

LibraryCategoriesText

Categories that this function belongs to in the material function library.

Public variable

UMaterialFuncti ...

 

ParentFunction

Used in the material editor, points to the function asset being edited, which this function is just a preview for.

Public variable

UMaterial *

 

PreviewMaterial

Constructors

Name Description

Public function

UMaterialFunction

(
    const FObjectInitializer & ObjectIn...
)

Functions

Name Description

Public function

bool

 

SetFontParameterValueEditorOnly

(
    FName ParameterName,
    UFont * InFontValue,
    int32 InFontPage
)

Public function

void

 

SetMaterialFunctionUsage

(
    EMaterialFunctionUsage Usage
)

Public function

bool

 

SetRuntimeVirtualTextureParameterValueEditorOnly

(
    FName ParameterName,
    URuntimeVirtualTexture * InValu...
)

Public function

bool

 

SetScalarParameterValueEditorOnly

(
    FName ParameterName,
    float InValue
)

Public function

bool

 

SetStaticComponentMaskParameterValueEditorOnly

(
    FName ParameterName,
    bool R,
    bool G,
    bool B,
    bool A,
    FGuid OutExpressionGuid
)

Public function

bool

 

SetStaticSwitchParameterValueEditorOnly

(
    FName ParameterName,
    bool OutValue,
    FGuid OutExpressionGuid
)

Public function

bool

 

SetTextureParameterValueEditorOnly

(
    FName ParameterName,
    UTexture * InValue
)

Public function

bool

 

SetVectorParameterValueEditorOnly

(
    FName ParameterName,
    FLinearColor InValue
)

Public function Virtual

void

 

UpdateDependentFunctionCandidates()

Overridden from UMaterialFunctionInterface

Name Description

Public function Virtual

int32

 

Compile

(
    FMaterialCompiler * Compiler,
    const FFunctionExpressionOutput & O...
)

Public function Virtual

UMaterialFun ...

 

GetBaseFunction()

Public function Virtual Const

const UMater ...

 

GetBaseFunction()

Public function Virtual Const

void

 

GetDependentFunctions

Returns an array of the functions that this function is dependent on, directly or indirectly.

Public function Virtual Const

const FStrin ...

 

GetDescription()

Public function Virtual Const

const TArray ...

 

GetFunctionExpressions()

Public function Virtual Const

void

 

GetInputsAndOutputs

(
    TArray < struct FFunctionExpressionI ...,
    TArray < struct FFunctionExpressionO ...
)

Get the inputs and outputs that this function exposes, for a function call expression to use.

Public function Virtual

EMaterialFun ...

 

GetMaterialFunctionUsage()

Public function Virtual

UMaterialInt ...

 

GetPreviewMaterial()

Public function Virtual Const

bool

 

GetReentrantFlag()

Public function Virtual Const

bool

 

HasFlippedCoordinates()

Checks whether a Material Function is arranged in the old style, with inputs flowing from right to left

Public function Virtual

bool

 

IsDependent

(
    UMaterialFunctionInterface * Ot...
)

Public function Virtual Const

bool

 

IterateDependentFunctions

(
    TFunctionRef < bool ...
)

Iterates all functions that this function is dependent on, directly or indrectly.

Public function Virtual

void

 

LinkIntoCaller

(
    const TArray < FFunctionExpressionIn ...
)

Called during compilation before entering the function.

Public function Virtual

void

 

SetReentrantFlag

(
    const bool bIsReentrant
)

Public function Virtual

void

 

UnlinkFromCaller()

Public function Virtual

void

 

UpdateFromFunctionResource()

Recursively update all function call expressions in this function, or in nested functions.

Public function Virtual

void

 

UpdateInputOutputTypes()

Public function Virtual

bool

 

ValidateFunctionUsage

(
    FMaterialCompiler * Compiler,
    const FFunctionExpressionOutput & O...
)

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent & PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive & Ar
)

Handles reading, writing, and reference collecting using FArchive .

Deprecated Variables

Name Description

Public variable

TArray < FString ...

 

LibraryCategories_DEPRECATED

Categories that this function belongs to in the material function library.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback