UMaterialEditingLibrary

Blueprint library for creating/editing Materials

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MaterialEditor

Header

/Engine/Source/Editor/MaterialEditor/Public/MaterialEditingLibrary.h

Include

#include "MaterialEditingLibrary.h"

Syntax

class UMaterialEditingLibrary : public UBlueprintFunctionLibrary

Remarks

Blueprint library for creating/editing Materials

Functions

Name Description

Public function Static

void

 

ClearAllMaterialInstanceParameters

(
    UMaterialInstanceConstant* Ins...
)

Clears all material parameters set by this Material Instance

Public function Static

bool

 

ConnectMaterialExpressions

(
    UMaterialExpression* FromExpre...,
    FString FromOutputName,
    UMaterialExpression* ToExpress...,
    FString ToInputName
)

Create connection between two material expressions

Public function Static

bool

 

ConnectMaterialProperty

(
    UMaterialExpression* FromExpre...,
    FString FromOutputName,
    EMaterialProperty Property
)

Connect a material expression output to one of the material property inputs (e.g. diffuse color, opacity etc)

Public function Static

UMaterialExp...

 

CreateMaterialExpression

(
    UMaterial* Material,
    TSubclassOf< UMaterialExpression > ...,
    int32 NodePosX,
    int32 NodePosY
)

Create a new material expression node within the supplied material

Public function Static

UMaterialExp...

 

CreateMaterialExpressionEx

(
    UMaterial* Material,
    UMaterialFunction* MaterialFun...,
    TSubclassOf< UMaterialExpression > ...,
    UObject* SelectedAsset,
    int32 NodePosX,
    int32 NodePosY
)

Create a new material expression node within the supplied material, optionally specifying asset to use @note If a MaterialFunction and Material are specified, expression is added to Material and not MaterialFunction, assuming Material is a preview that will be copied to Function later by user.

Public function Static

UMaterialExp...

 

CreateMaterialExpressionInFunction

(
    UMaterialFunction* MaterialFun...,
    TSubclassOf< UMaterialExpression > ...,
    int32 NodePosX,
    int32 NodePosY
)

Create a new material expression node within the supplied material function

Public function Static

void

 

DeleteAllMaterialExpressions

(
    UMaterial* Material
)

Delete all material expressions in the supplied material

Public function Static

void

 

DeleteAllMaterialExpressionsInFunction

(
    UMaterialFunction* MaterialFun...
)

Delete all material expressions in the supplied material function

Public function Static

void

 

DeleteMaterialExpression

(
    UMaterial* Material,
    UMaterialExpression* Expressio...
)

Delete a specific expression from a material. Will disconnect from other expressions.

Public function Static

void

 

DeleteMaterialExpressionInFunction

(
    UMaterialFunction* MaterialFun...,
    UMaterialExpression* Expressio...
)

Delete a specific expression from a material function. Will disconnect from other expressions.

Public function Static

UMaterialExp...

 

DuplicateMaterialExpression

(
    UMaterial* Material,
    UMaterialFunction* MaterialFun...,
    UMaterialExpression* Expressio...
)

Duplicates the provided material expression adding it to the same material / material function, and copying parameters.

Public function Static

void

 

GetChildInstances

(
    UMaterialInterface* Parent,
    TArray< FAssetData >& ChildInstanc...
)

Gets all direct child mat instances

Public function Static

TArray< UMat...

 

GetInputsForMaterialExpression

(
    UMaterial* Material,
    UMaterialExpression* MaterialE...
)

Get the set of nodes acting as inputs to a node from an active material editor

Public function Static

float

 

GetMaterialDefaultScalarParameterValue

(
    UMaterial* Material,
    FName ParameterName
)

Get the default scalar (float) parameter value from a Material

Public function Static

bool

 

GetMaterialDefaultStaticSwitchParameterValue

(
    UMaterial* Material,
    FName ParameterName
)

Get the default static switch parameter value from a Material

Public function Static

UTexture ...

 

GetMaterialDefaultTextureParameterValue

(
    UMaterial* Material,
    FName ParameterName
)

Get the default texture parameter value from a Material

Public function Static

FLinearColor

 

GetMaterialDefaultVectorParameterValue

(
    UMaterial* Material,
    FName ParameterName
)

Get the default vector parameter value from a Material

Public function Static

URuntimeVirt...

 

GetMaterialInstanceRuntimeVirtualTextureParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    EMaterialParameterAssociation Assoc...
)

Get the current texture parameter value from a Material Instance

Public function Static

float

 

GetMaterialInstanceScalarParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    EMaterialParameterAssociation Assoc...
)

Get the current scalar (float) parameter value from a Material Instance

Public function Static

bool

 

GetMaterialInstanceStaticSwitchParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    EMaterialParameterAssociation Assoc...
)

Get the current static switch parameter value from a Material Instance

Public function Static

UTexture ...

 

GetMaterialInstanceTextureParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    EMaterialParameterAssociation Assoc...
)

Get the current texture parameter value from a Material Instance

Public function Static

FLinearColor

 

GetMaterialInstanceVectorParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    EMaterialParameterAssociation Assoc...
)

Get the current vector parameter value from a Material Instance

Public function Static

UMaterialExp...

 

GetMaterialPropertyInputNode

(
    UMaterial* Material,
    EMaterialProperty Property
)

Get the node providing the output for a given material property from an active material editor

Public function Static

TSet< UObjec...

 

GetMaterialSelectedNodes

(
    UMaterial* Material
)

Get the set of selected nodes from an active material editor

Public function Static

int32

 

GetNumMaterialExpressions

(
    const UMaterial* Material
)

Returns number of material expressions in the supplied material

Public function Static

int32

 

GetNumMaterialExpressionsInFunction

(
    const UMaterialFunction* Mater...
)

Returns number of material expressions in the supplied material

Public function Static

void

 

GetScalarParameterNames

(
    UMaterialInterface* Material,
    TArray< FName >& ParameterNames
)

Gets all scalar parameter names

Public function Static

bool

 

GetScalarParameterSource

(
    UMaterialInterface* Material,
    const FName ParameterName,
    FSoftObjectPath& ParameterSource
)

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Public function Static

void

 

GetStaticSwitchParameterNames

(
    UMaterialInterface* Material,
    TArray< FName >& ParameterNames
)

Gets all static switch parameter names

Public function Static

bool

 

GetStaticSwitchParameterSource

(
    UMaterialInterface* Material,
    const FName ParameterName,
    FSoftObjectPath& ParameterSource
)

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Public function Static

FMaterialSta...

 

GetStatistics

(
    UMaterialInterface* Material
)

Returns statistics about the given material

Public function Static

void

 

GetTextureParameterNames

(
    UMaterialInterface* Material,
    TArray< FName >& ParameterNames
)

Gets all texture parameter names

Public function Static

bool

 

GetTextureParameterSource

(
    UMaterialInterface* Material,
    const FName ParameterName,
    FSoftObjectPath& ParameterSource
)

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Public function Static

TArray< UTex...

 

GetUsedTextures

(
    UMaterial* Material
)

Get the list of textures used by a material

Public function Static

void

 

GetVectorParameterNames

(
    UMaterialInterface* Material,
    TArray< FName >& ParameterNames
)

Gets all vector parameter names

Public function Static

bool

 

GetVectorParameterSource

(
    UMaterialInterface* Material,
    const FName ParameterName,
    FSoftObjectPath& ParameterSource
)

Returns the path of the asset where the parameter originated, as well as true/false if it was found

Public function Static

bool

 

HasMaterialUsage

(
    UMaterial* Material,
    EMaterialUsage Usage
)

Check if a particular usage is enabled for the supplied material (e.g. SkeletalMesh, ParticleSprite etc)

Public function Static

void

 

LayoutMaterialExpressions

(
    UMaterial* Material
)

Layouts the expressions in a grid pattern

Public function Static

void

 

LayoutMaterialFunctionExpressions

(
    UMaterialFunction* MaterialFun...
)

Layouts the expressions in a grid pattern

Public function Static

void

 

RebuildMaterialInstanceEditors

(
    UMaterial* BaseMaterial
)

Rebuilds dependent Material Instance Editors

Public function Static

void

 

RebuildMaterialInstanceEditors

(
    UMaterialFunction* BaseFunctio...
)

Rebuilds dependent Material Instance Editors

Public function Static

void

 

RecompileMaterial

(
    UMaterial* Material
)

Trigger a recompile of a material.

Public function Static

void

 

SetMaterialInstanceParent

(
    UMaterialInstanceConstant* Ins...,
    UMaterialInterface* NewParent
)

Set the parent Material or Material Instance to use for this Material Instance

Public function Static

bool

 

SetMaterialInstanceRuntimeVirtualTextureParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    URuntimeVirtualTexture* Value,
    EMaterialParameterAssociation Assoc...
)

Set the texture parameter value for a Material Instance

Public function Static

bool

 

SetMaterialInstanceScalarParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    float Value,
    EMaterialParameterAssociation Assoc...
)

Set the scalar (float) parameter value for a Material Instance

Public function Static

bool

 

SetMaterialInstanceStaticSwitchParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    bool Value,
    EMaterialParameterAssociation Assoc...
)

Set the static switch parameter value for a Material Instance

Public function Static

bool

 

SetMaterialInstanceTextureParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    UTexture* Value,
    EMaterialParameterAssociation Assoc...
)

Set the texture parameter value for a Material Instance

Public function Static

bool

 

SetMaterialInstanceVectorParameterValue

(
    UMaterialInstanceConstant* Ins...,
    FName ParameterName,
    FLinearColor Value,
    EMaterialParameterAssociation Assoc...
)

Set the vector parameter value for a Material Instance

Public function Static

bool

 

SetMaterialUsage

(
    UMaterial* Material,
    EMaterialUsage Usage,
    bool& bNeedsRecompile
)

Enable a particular usage for the supplied material (e.g. SkeletalMesh, ParticleSprite etc)

Public function Static

void

 

UpdateMaterialFunction

(
    UMaterialFunctionInterface* Ma...,
    UMaterial* PreviewMaterial
)

Update a Material Function after edits have been made.

Public function Static

void

 

UpdateMaterialInstance

(
    UMaterialInstanceConstant* Ins...
)

Called after making modifications to a Material Instance to recompile shaders etc.