UMaterialInstanceConstant

Material Instances may be used to change the appearance of a material without incurring an expensive recompilation of the material.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "Materials/MaterialInstanceConstant.h"

Syntax

class UMaterialInstanceConstant : public UMaterialInstance

Remarks

Material Instances may be used to change the appearance of a material without incurring an expensive recompilation of the material. General modification of the material cannot be supported without recompilation, so the instances are limited to changing the values of predefined material parameters. The parameters are statically defined in the compiled material by a unique name, type and default value.

Variables

Name Description

Public variable

FGuid

 

ParameterStateId

Unique ID for this material instance's parameter set Updated on changes in the editor to allow those changes to be detected

Constructors

Name Description

Public function

UMaterialInstanceConstant

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

ClearParameterValuesEditorOnly()

Clear all parameter overrides on this material instance.

Public function

void

 

CopyMaterialUniformParametersEditorOnly

(
    UMaterialInterface* Source,
    bool bIncludeStaticParams
)

Copies the uniform parameters (scalar, vector and texture) from a material or instance hierarchy.

Public function

float

 

K2_GetScalarParameterValue

(
    FName ParameterName
)

Get the scalar (float) parameter value from an MIC

Public function

UTexture ...

 

K2_GetTextureParameterValue

(
    FName ParameterName
)

Get the MIC texture parameter value

Public function

FLinearColor

 

K2_GetVectorParameterValue

(
    FName ParameterName
)

Get the MIC vector parameter value

Public function

void

 

SetFontParameterValueEditorOnly

(
    const FMaterialParameterInfo& Para...,
    UFont* FontValue,
    int32 FontPage
)

Public function

void

 

SetParentEditorOnly

(
    UMaterialInterface* NewParent,
    bool RecacheShader
)

Set the parent of this material instance.

Public function

void

 

SetScalarParameterAtlasEditorOnly

(
    const FMaterialParameterInfo& Para...,
    FScalarParameterAtlasInstanceData A...
)

Public function

void

 

SetScalarParameterValueEditorOnly

(
    const FMaterialParameterInfo& Para...,
    float Value
)

Public function

void

 

SetTextureParameterValueEditorOnly

(
    const FMaterialParameterInfo& Para...,
    UTexture* Value
)

Public function

void

 

SetVectorParameterValueEditorOnly

(
    const FMaterialParameterInfo& Para...,
    FLinearColor Value
)

Set the value parameters.

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.

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