UMaterialParameterCollection

Asset class that contains a list of parameter names and their default values.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UMaterialParameterCollection

References

Module

Engine

Header

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

Include

#include "Materials/MaterialParameterCollection.h"

Syntax

class UMaterialParameterCollection : public UObject

Remarks

Asset class that contains a list of parameter names and their default values. Any number of materials can reference these parameters and get new values when the parameter values are changed.

Variables

Name Description

Public variable

TArray< FCollec...

 

ScalarParameters

Public variable

FGuid

 

StateId

Used by materials using this collection to know when to recompile.

Public variable

TArray< FCollec...

 

VectorParameters

Constructors

Name Description

Public function

UMaterialParameterCollection

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Const

FGuid

 

GetParameterId

(
    FName ParameterName
)

Finds a parameter id given a name, returns the default guid if the parameter was not found.

Public function Const

void

 

GetParameterIndex

(
    const FGuid& Id,
    int32& OutIndex,
    int32& OutComponentIndex
)

Gets a vector and component index for the given parameter, used when compiling materials, to know where to access a certain parameter.

Public function Const

FName

 

GetParameterName

(
    const FGuid& Id
)

Finds a parameter name given an Id, returns NAME_None if the parameter was not found.

Public function Const

void

 

GetParameterNames

(
    TArray< FName >& OutParameterNames,
    bool bVectorParameters
)

Populates an array with either scalar or vector parameter names.

Public function Const

const FColle...

 

GetScalarParameterByName

(
    FName ParameterName
)

Utility to find a scalar parameter struct given a parameter name. Returns NULL if not found.

Public function

float

 

GetScalarParameterDefaultValue

(
    FName ParameterName,
    bool& bParameterFound
)

Gets the default value of a scalar parameter from a material collection.

Public function

int32

 

GetScalarParameterIndexByName

(
    FName ParameterName
)

Get the index in the ScalarParameters array of the parameter matching the input parameter name, returns -1 if not found

Public function

TArray< FNam...

 

GetScalarParameterNames()

Returns an array of the names of all the scalar parameters in this Material Parameter Collection

Public function Const

const FShade...

 

GetUniformBufferStruct()

Accessor for the uniform buffer layout description.

Public function Const

const FColle...

 

GetVectorParameterByName

(
    FName ParameterName
)

Utility to find a vector parameter struct given a parameter name. Returns NULL if not found.

Public function

FLinearColor

 

GetVectorParameterDefaultValue

(
    FName ParameterName,
    bool& bParameterFound
)

Gets the default value of a scalar parameter from a material collection.

Public function

int32

 

GetVectorParameterIndexByName

(
    FName ParameterName
)

Get the index in the VectorParameters array of the parameter matching the input parameter name, returns -1 if not found

Public function

TArray< FNam...

 

GetVectorParameterNames()

Returns an array of the names of all the vector parameters in this Material Parameter Collection

Public function

bool

 

SetScalarParameterDefaultValue

(
    FName ParameterName,
    const float Value
)

Set the default value of a scalar parameter on the Material Parameter Collection asset itself by name

Public function

bool

 

SetScalarParameterDefaultValueByInfo

(
    FCollectionScalarParameter ScalarPa...
)

Set the default value of a scalar parameter on the Material Parameter Collection asset itself by struct

Public function

bool

 

SetVectorParameterDefaultValue

(
    FName ParameterName,
    const FLinearColor& Value
)

Set the default value of a vector parameter on the Material Parameter Collection asset itself by name

Public function

bool

 

SetVectorParameterDefaultValueByInfo

(
    FCollectionVectorParameter VectorPa...
)

Set the default value of a vector parameter on the Material Parameter Collection asset itself by struct

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

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

Public function Virtual

void

 

PreEditChange

(
    FProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Overridden from UObjectBaseUtility

Name Description

Public function Virtual Const

bool

 

CanBeInCluster()

Called during cluster construction if the object can be added to a cluster