Navigation
API > API/Runtime > API/Runtime/Engine
A Material Function is a collection of material expressions that can be reused in different materials
| Name | UMaterialFunction |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Materials/MaterialFunction.h |
| Include Path | #include "Materials/MaterialFunction.h" |
Syntax
UCLASS (BlueprintType, HideCategories=object, MinimalAPI)
class UMaterialFunction : public UMaterialFunctionInterface
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMaterialFunctionInterface → UMaterialFunction
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMaterialFunction
(
const FObjectInitializer& ObjectInitializer |
Materials/MaterialFunction.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bAllExpressionsLoadedCorrectly | uint8 | Whether all expressions in the function loaded correctly. | Materials/MaterialFunction.h | |
| bEnableExecWire | uint8 | Materials/MaterialFunction.h |
|
|
| bEnableNewHLSLGenerator | uint8 | Materials/MaterialFunction.h |
|
|
| bExposeToLibrary | uint8 | Whether to list this function in the material function library, which is a window in the material editor that lists categorized functions. | Materials/MaterialFunction.h |
|
| bPrefixParameterNames | uint8 | Materials/MaterialFunction.h | ||
| DependentFunctionExpressionCandidates | TArray< TObjectPtr< class UMaterialExpressionMaterialFunctionCall > > | Materials/MaterialFunction.h | ||
| Description | FString | Description of the function which will be displayed as a tooltip wherever the function is used. | Materials/MaterialFunction.h |
|
| EditorMaterial | TObjectPtr< UMaterial > | The UMaterial which represents this function while the function itself is open in the material editor. | Materials/MaterialFunction.h | |
| LibraryCategoriesText | TArray< FText > | Categories that this function belongs to in the material function library. | Materials/MaterialFunction.h |
|
| MaterialGraph | UMaterialGraph * | Materials/MaterialFunction.h | ||
| ParentFunction | TObjectPtr< class UMaterialFunction > | Used in the material editor, points to the function asset being edited, which this function is just a preview for. | Materials/MaterialFunction.h |
|
| PreviewBlendMode | TEnumAsByte< enum EBlendMode > | Determines the blend mode when previewing a material function. | Materials/MaterialFunction.h |
|
| PreviewMaterial | TObjectPtr< UMaterial > | Materials/MaterialFunction.h |
|
|
| PreviewMaterialDomain | TEnumAsByte< enum EMaterialDomain > | The domain to use when previewing a material function. | Materials/MaterialFunction.h |
|
| UserExposedCaption | FString | Name of the function to be displayed on the node within the material editor instead of the asset name. | Materials/MaterialFunction.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bReentrantFlag | uint8 | Transient flag used to track re-entrance in recursive functions like IsDependent. | Materials/MaterialFunction.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AssignExpressionCollection
(
const FMaterialExpressionCollection& InCollection |
Materials/MaterialFunction.h | ||
void ConvertExpressionsBetweenLegacyAndSubstrate() |
Converts legacy Material Layer Functions to utilise Substrate | Materials/MaterialFunction.h | |
void GetAllCustomOutputExpressions
(
TArray< class UMaterialExpressionCustomOutput* >& OutCustomOutputs |
Retrieves an array of all custom output expressions in a Material Function | Materials/MaterialFunction.h | |
TConstArrayView< TObjectPtr< UMaterialExpressionComment > > GetEditorComments() |
Materials/MaterialFunction.h | ||
const UMaterialFunctionEditorOnlyData * GetEditorOnlyData () |
Materials/MaterialFunction.h | ||
| Materials/MaterialFunction.h | |||
| Materials/MaterialFunction.h | |||
| Materials/MaterialFunction.h | |||
TConstArrayView< TObjectPtr< UMaterialExpression > > GetExpressions() |
Materials/MaterialFunction.h | ||
bool GetReentrantFlag() |
Materials/MaterialFunction.h | ||
| Materials/MaterialFunction.h | |||
void SetMaterialFunctionUsage
(
EMaterialFunctionUsage Usage |
Materials/MaterialFunction.h | ||
bool SetParameterValueEditorOnly
(
const FName& ParameterName, |
Materials/MaterialFunction.h | ||
void SetReentrantFlag
(
bool bIsReentrant |
Materials/MaterialFunction.h | ||
bool SetRuntimeVirtualTextureParameterValueEditorOnly
(
FName ParameterName, |
Materials/MaterialFunction.h | ||
bool SetScalarParameterValueEditorOnly
(
FName ParameterName, |
Materials/MaterialFunction.h | ||
bool SetSparseVolumeTextureParameterValueEditorOnly
(
FName ParameterName, |
Materials/MaterialFunction.h | ||
| Materials/MaterialFunction.h | |||
| Materials/MaterialFunction.h | |||
| Materials/MaterialFunction.h | |||
bool SetVectorParameterValueEditorOnly
(
FName ParameterName, |
Materials/MaterialFunction.h | ||
virtual void UpdateDependentFunctionCandidates() |
Materials/MaterialFunction.h |
Overridden from UMaterialFunctionInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual int32 Compile
(
FMaterialCompiler* Compiler, |
Materials/MaterialFunction.h | ||
virtual void ForceRecompileForRendering
(
FMaterialUpdateContext& UpdateContext, |
Materials/MaterialFunction.h | ||
virtual const UMaterialFunction * GetBaseFunction
(
FMFRecursionGuard RecursionGuard |
Materials/MaterialFunction.h | ||
virtual UMaterialFunction * GetBaseFunction
(
FMFRecursionGuard RecursionGuard |
Materials/MaterialFunction.h | ||
virtual void GetDependentFunctions
(
TArray< UMaterialFunctionInterface* >& DependentFunctions |
Returns an array of the functions that this function is dependent on, directly or indirectly. | Materials/MaterialFunction.h | |
virtual const UClass * GetEditorOnlyDataClass() |
Materials/MaterialFunction.h | ||
virtual void GetInputsAndOutputs
(
TArray< struct FFunctionExpressionInput >& OutInputs, |
Get the inputs and outputs that this function exposes, for a function call expression to use. | Materials/MaterialFunction.h | |
virtual EMaterialFunctionUsage GetMaterialFunctionUsage() |
Materials/MaterialFunction.h | ||
virtual UMaterialInterface * GetPreviewMaterial() |
Materials/MaterialFunction.h | ||
virtual FString GetUserExposedCaption () |
Returns If returns an empty string, use the default class name for the material function. | Materials/MaterialFunction.h | |
virtual bool HasFlippedCoordinates() |
Checks whether a Material Function is arranged in the old style, with inputs flowing from right to left | Materials/MaterialFunction.h | |
virtual bool IsDependent
(
UMaterialFunctionInterface* OtherFunction |
Materials/MaterialFunction.h | ||
virtual bool IsUsingNewHLSLGenerator() |
Materials/MaterialFunction.h | ||
virtual bool IterateDependentFunctions
(
TFunctionRef< bool(UMaterialFunctionInterface*)> Predicate |
Iterates all functions that this function is dependent on, directly or indrectly. | Materials/MaterialFunction.h | |
virtual void LinkIntoCaller
(
const TArray< FFunctionExpressionInput >& CallerInputs |
Called during compilation before entering the function. | Materials/MaterialFunction.h | |
virtual void UnlinkFromCaller() |
Materials/MaterialFunction.h | ||
virtual void UpdateFromFunctionResource() |
Recursively update all function call expressions in this function, or in nested functions. | Materials/MaterialFunction.h | |
virtual void UpdateInputOutputTypes() |
Materials/MaterialFunction.h | ||
virtual bool ValidateFunctionUsage
(
FMaterialCompiler* Compiler, |
Materials/MaterialFunction.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Materials/MaterialFunction.h | ||
virtual void PostLoad() |
Materials/MaterialFunction.h | ||
virtual void PreSave
(
FObjectPreSaveContext ObjectSaveContext |
Materials/MaterialFunction.h | ||
virtual void Serialize
(
FArchive& Ar |
Materials/MaterialFunction.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
Materials/MaterialFunction.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| LibraryCategories_DEPRECATED | TArray< FString > | Categories that this function belongs to in the material function library. | Materials/MaterialFunction.h |
|