UMeshComponent

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

Windows
MacOS
Linux

Inheritance Hierarchy

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

TArray< class U...

 

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 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 stremaing. Return whether the data is valid or not.

Public function Virtual Const

int32

 

GetNumOverrideMaterials()

Returns override Materials count

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 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

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

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
Dismiss