UMeshComponent::SetMaterialByName

Changes the material applied to an element of the mesh.

Windows
MacOS
Linux

Override Hierarchy

UPrimitiveComponent::SetMaterialByName()

UMeshComponent::SetMaterialByName()

References

Module

Engine

Header

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

Include

#include "Components/MeshComponent.h"

Source

/Engine/Source/Runtime/Engine/Private/Components/MeshComponent.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.

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