UMeshComponent

MeshComponent is an abstract base for any component that is an instance of a renderable collection of triangles.

Inheritance Hierarchy

UObjectBase

UObjectBaseUtility

UObject

UActorComponent

USceneComponent

UPrimitiveComponent

UMeshComponent

PAPER2UPaperFlipbookComponent

PAPER2UPaperGroupedSpriteComponent

PAPER2UPaperSpriteComponent

PAPER2UPaperTileMapComponent

UBaseDynamicMeshComponent

UDynamicMeshComponent

UOctreeDynamicMeshComponent

UBasicLineSetComponentBase

UBasic2DLineSetComponent

UBasic3DLineSetComponent

UBasicPointSetComponentBase

UBasic2DPointSetComponent

UBasic3DPointSetComponent

UBasicTriangleSetComponentBase

UBasic2DTriangleSetComponent

UBasic3DTriangleSetComponent

UCableComponent

UCustomMeshComponent

UGeometryCacheComponent

UGeometryCacheAbcFileComponent

UGeometryCacheUsdComponent

UGeometryCollectionComponent

UGroomComponent

ULidarPointCloudComponent

ULineSetComponent

UMeshWireframeComponent

UPointCloudComponent

UPointSetComponent

UProceduralMeshComponent

UAppleARKitFaceMeshComponent

UCalibrationPointComponent

UDEPRECATED_GoogleARCoreFaceMeshComponent

USkinnedMeshComponent

UDestructibleComponent

UPoseableMeshComponent

UDEPRECATED_UOculusHandComponent

USkeletalMeshComponent

UDebugSkelMeshComponent

UInsightsSkeletalMeshComponent

USkeletalMeshComponentBudgeted

UStaticMeshComponent

UControlPointMeshComponent

UDisplayClusterScreenComponent

UGizmoHandleMeshComponent

UInstancedStaticMeshComponent

UHierarchicalInstancedStaticMeshComponent

UFoliageInstancedStaticMeshComponent

UGrassInstancedStaticMeshComponent

ULandscapeMeshProxyComponent

ULandscapeNaniteComponent

UMaterialEditorMeshComponent

UNaniteDisplacedMeshComponent

USplineMeshComponent

UXRDeviceVisualizationComponent

UTriangleSetComponent

UWaterMeshComponent

UWidgetComponent

References

Module

Engine

Header

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

Include

#include "Components/MeshComponent.h"

Syntax

class UMeshComponent : public UPrimitiveComponent

Remarks

MeshComponent is an abstract base for any component that is an instance of a renderable collection of triangles.

Variables

Name Description

Protected variable

uint8: 1

 

bCachedMaterialParameterIndicesAreDirty

Flag whether or not the cached material parameter indices map is dirty (defaults to true, and is set from SetMaterial/Set(Skeletal)Mesh

Protected variable

uint8: 1

 

bEnableMaterialParameterCaching

Protected variable

TSortedMap< FNa...

 

MaterialParameterCache

Public variable

TObjectPtr< cla...

 

OverlayMaterial

Translucent material to blend on top of this mesh.

Public variable

float

 

OverlayMaterialMaxDrawDistance

The max draw distance for overlay material.

Public variable

TArray< TObject...

 

OverrideMaterials

Per-Component material overrides.

Constructors

Name Description

Public function

UMeshComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function

void

 

CacheMaterialParameterNameIndices()

Retrieves all the (scalar/vector-)parameters from within the used materials on the SkeletalMesh, and stores material index vs parameter names

Public function

void

 

CleanUpOverrideMaterials()

Make sure the Override array is using only the space it should use.

Public function

void

 

EmptyOverrideMaterials()

This empties all override materials and used by editor when replacing preview mesh

Public function Virtual Const

int32

 

GetMaterialIndex

(
    FName MaterialSlotName
)

Public function Virtual Const

FMaterialRel...

 

GetMaterialRelevance

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Accesses the scene relevance information for the materials applied to the mesh.

Public function Virtual Const

TArray< clas...

 

GetMaterials()

Public function Virtual Const

TArray< FNam...

 

GetMaterialSlotNames()

Public function Virtual Const

bool

 

GetMaterialStreamingData

(
    int32 MaterialIndex,
    FPrimitiveMaterialInfo& MaterialDa...
)

Get the material info for texture streaming. Return whether the data is valid or not.

Public function Virtual Const

int32

 

GetNumOverrideMaterials()

Returns override materials count

Public function Const

UMaterialInt...

 

GetOverlayMaterial()

Get the overlay material used by this instance

Public function

float

 

GetScalarParameterDefaultValue

(
    const FName ParameterName
)

Returns default value for the parameter input.

Public function Const

void

 

GetStreamingTextureInfoInner

(
    FStreamingTextureLevelContext& Lev...,
    const TArray< FStreamingTextureBuil...,
    float ComponentScaling,
    TArray< FStreamingRenderAssetPrimit...
)

Generate streaming data for all materials.

Public function

bool

 

HasOverrideMaterials()

Returns true if there are any override materials set for this component

Public function Virtual Const

bool

 

IsMaterialSlotNameValid

(
    FName MaterialSlotName
)

Public function Virtual Const

void

 

LogMaterialsAndTextures

(
    FOutputDevice& Ar,
    int32 Indent
)

Output to the log which materials and textures are used by this component.

Protected function

void

 

MarkCachedMaterialParameterNameIndicesDirty()

Mark cache parameters map as dirty, cache will be rebuild once SetScalar/SetVector functions are called

Public function Virtual

void

 

PrestreamTextures

(
    float Seconds,
    bool bPrioritizeCharacterTextures,
    int32 CinematicTextureGroups
)

Tell the streaming system to start loading all textures with all mip-levels.

Public function Virtual

void

 

RegisterLODStreamingCallback

(
    FLODStreamingCallback&& Callback,
    int32 LODIdx,
    float TimeoutSecs,
    bool bOnStreamIn
)

Register a one-time callback that will be called when criteria met

Public function

void

 

SetOverlayMaterial

(
    UMaterialInterface* NewOverlay...
)

Change the overlay material used by this instance

Public function

void

 

SetOverlayMaterialMaxDrawDistance

(
    float InMaxDrawDistance
)

Change the overlay material max draw distance used by this instance

Public function

void

 

SetScalarParameterValueOnMaterials

(
    const FName ParameterName,
    const float ParameterValue
)

Material parameter setting and caching Set all occurrences of Scalar Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue

Public function Virtual

void

 

SetTextureForceResidentFlag

(
    bool bForceMiplevelsToBeResident
)

Tell the streaming system whether or not all mip levels of all textures used by this component should be loaded and remain loaded.

Public function

void

 

SetVectorParameterValueOnMaterials

(
    const FName ParameterName,
    const FVector ParameterValue
)

Set all occurrences of Vector Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue

Public function Virtual Const

bool

 

UseNaniteOverrideMaterials()

Determines if we use the nanite overrides from any materials

Overridden from UPrimitiveComponent

Name Description

Public function Virtual Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual Const

int32

 

GetNumMaterials()

Return number of material elements in this primitive

Public function Virtual Const

void

 

GetUsedMaterials

(
    TArray< UMaterialInterface* > ...,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface* Material
)

Changes the material applied to an element of the mesh.

Public function Virtual

void

 

SetMaterialByName

(
    FName MaterialSlotName,
    UMaterialInterface* Material
)

Changes the material applied to an element of the mesh.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent& Proper...
)

This alternate version of PostEditChange is called when properties inside structs are modified.

Classes

Name

Description

Protected struct

FMaterialParameterCache

Struct containing information about a given parameter name

See Also

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel