UPrimitiveComponent::SetMaterialByName

Changes the material applied to an element of the mesh.

Choose your operating system:

Windows

macOS

Linux

Override Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/PrimitiveComponent.h

Include

#include "Components/PrimitiveComponent.h"

Source

/Engine/Source/Runtime/Engine/Private/Components/PrimitiveComponent.cpp

Syntax

virtual void SetMaterialByName
(
    FName MaterialSlotName,
    class UMaterialInterface * Material
)

Remarks

Changes the material applied to an element of the mesh.

Returns

the material used by the indexed element of this mesh.

Parameters

Parameter

Description

MaterialSlotName

The slot name to access the material of.