Language:
Discover
By Skill Level
By Category

UMeshComponent

Choose your OS:

Inheritance Hierarchy

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

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

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

int32

 

GetMaterialIndex

(
    FName MaterialSlotName
)

Public function

FMaterialRel ...

 

GetMaterialRelevance

(
    ERHIFeatureLevel::Type InFeatureLev...
)

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

Public function Virtual

TArray < clas...

 

GetMaterials()

Public function Virtual

TArray < FNam ...

 

GetMaterialSlotNames()

Public function Virtual

bool

 

GetMaterialStreamingData

(
    int32 MaterialIndex,
    FPrimitiveMaterialInfo & MaterialDa...
)

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

Public function Virtual

int32

 

GetNumOverrideMaterials()

Returns override Materials count

Public function

float

 

GetScalarParameterDefaultValue

(
    const FName ParameterName
)

Returns default value for the parameter input.

Public function

void

 

GetStreamingTextureInfoInner

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

Generate streaming data for all materials.

Public function Virtual

bool

 

IsMaterialSlotNameValid

(
    FName MaterialSlotName
)

Public function Virtual

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

UMaterialInt ...

 

GetMaterial

(
    int32 ElementIndex
)

Returns the material used by the element at the specified index

Public function Virtual

int32

 

GetNumMaterials()

Number of material elements in this primitive

Public function Virtual

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

References

Module

Engine

Header

Runtime/Engine/Classes/Components/MeshComponent.h