Navigation
API > API/Runtime > API/Runtime/Engine
MeshComponent is an abstract base for any component that is an instance of a renderable collection of triangles.
| Name | UMeshComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/MeshComponent.h |
| Include Path | #include "Components/MeshComponent.h" |
Syntax
UCLASS (Abstract, ShowCategories=(VirtualTexture), MinimalAPI)
class UMeshComponent : public UPrimitiveComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UPrimitiveComponent → UMeshComponent
Implements Interfaces
- IAsyncPhysicsStateProcessor
- IInterface_AssetUserData
- IInterface_AsyncCompilation
- INavRelevantInterface
- IPhysicsComponent
Derived Classes
UMeshComponent derived class hierarchy
- UBaseDynamicMeshComponent
- UCableComponent
- UCustomMeshComponent
- UGeometryCacheComponent
- UGeometryCollectionComponent
- UGroomComponent
- UGroomSolverComponent
- UHeterogeneousVolumeComponent
- ULineSetComponent
- UMeshWireframeComponent
- UPaperFlipbookComponent
- UPaperGroupedSpriteComponent
- UPaperSpriteComponent
- UPaperTileMapComponent
- UPointSetComponent
- UProceduralMeshComponent
- USkinnedMeshComponent
- UStaticMeshComponent
- UTriangleSetComponent
- UWaterMeshComponent
- UWidgetComponent
- UBasicLineSetComponentBase
- UBasicPointSetComponentBase
- UBasicTriangleSetComponentBase
- ULidarPointCloudComponent
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMeshComponent
(
const FObjectInitializer& ObjectInitializer |
Components/MeshComponent.h |
Structs
| Name | Remarks |
|---|---|
| FMaterialParameterCache | Struct containing information about a given parameter name |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bEnableMaterialParameterCaching | uint8 | Whether or not to cache material parameter to speed up setting scalar or vector value on materials | Components/MeshComponent.h |
|
| MaterialSlotsOverlayMaterial | TArray< TObjectPtr< class UMaterialInterface > > | Translucent material to blend on top of this mesh. | Components/MeshComponent.h |
|
| OverlayMaterial | TObjectPtr< class UMaterialInterface > | Translucent material to blend on top of this mesh. | Components/MeshComponent.h |
|
| OverlayMaterialMaxDrawDistance | float | The max draw distance for overlay material. | Components/MeshComponent.h |
|
| OverrideMaterials | TArray< TObjectPtr< class UMaterialInterface > > | Per-Component material overrides. | Components/MeshComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Make sure the MaterialSlotsOverlayMaterial is using only the space it should use. | Components/MeshComponent.h | ||
void CleanUpOverrideMaterials () |
Make sure the Override array is using only the space it should use. | Components/MeshComponent.h | |
void EmptyOverrideMaterials() |
This empties all override materials and used by editor when replacing preview mesh | Components/MeshComponent.h | |
const TArray< TObjectPtr< UMaterialInterface > > & GetComponentMaterialSlotsOverlayMaterial() |
Retrieve the material slots overly materials assigned to this component | Components/MeshComponent.h | |
virtual void GetDefaultMaterialSlotsOverlayMaterial
(
TArray< TObjectPtr< UMaterialInterface > >& OutMaterialSlotOverlayMaterials |
Get all default material slots overlay materials from the mesh. | Components/MeshComponent.h | |
virtual FMaterialRelevance GetMaterialRelevance
(
ERHIFeatureLevel::Type InFeatureLevel |
Accesses the scene relevance information for the materials applied to the mesh. | Components/MeshComponent.h | |
virtual TArray< class UMaterialInterface * > GetMaterials() |
Components/MeshComponent.h |
|
|
void GetMaterialSlotsOverlayMaterial
(
TArray< TObjectPtr< class UMaterialInterface > >& OutMaterialSlotOverlayMaterials |
Fill the array with every material slot overlay material use by this instance. | Components/MeshComponent.h | |
virtual bool GetMaterialStreamingData
(
int32 MaterialIndex, |
Get the material info for texture streaming. Return whether the data is valid or not. | Components/MeshComponent.h | |
virtual UTexture * GetMeshPaintTexture () |
Get the mesh paint texture set on this component. | Components/MeshComponent.h | |
virtual int32 GetMeshPaintTextureCoordinateIndex() |
Get the default coordinate index for painting to the mesh paint texture on this component. | Components/MeshComponent.h | |
virtual int32 GetNumOverrideMaterials() |
Returns override materials count | Components/MeshComponent.h | |
UMaterialInterface * GetOverlayMaterial() |
Get the overlay material used by this instance | Components/MeshComponent.h |
|
float GetOverlayMaterialMaxDrawDistance() |
Get the overlay material used by this instance | Components/MeshComponent.h |
|
float GetScalarParameterDefaultValue
(
const FName ParameterName |
Returns default value for the parameter input. | Components/MeshComponent.h | |
void GetStreamingTextureInfoInner
(
FStreamingTextureLevelContext& LevelContext, |
Generate streaming data for all materials. | Components/MeshComponent.h | |
FColor GetWireframeColorForSceneProxy() |
Returns the wireframe color to use for this component. | Components/MeshComponent.h | |
bool HasOverrideMaterials() |
Returns true if there are any override materials set for this component | Components/MeshComponent.h | |
virtual void LogMaterialsAndTextures
(
FOutputDevice& Ar, |
Output to the log which materials and textures are used by this component. | Components/MeshComponent.h | |
virtual bool PrestreamMeshLODs
(
float Seconds |
Tell the streaming system to start streaming in all LODs for the mesh. | Components/MeshComponent.h |
|
virtual void PrestreamTextures
(
float Seconds, |
Tell the streaming system to start loading all textures with all mip-levels. | Components/MeshComponent.h |
|
virtual void RegisterLODStreamingCallback
(
FLODStreamingCallback&& Callback, |
Register a one-time callback that will be called when criteria met | Components/MeshComponent.h | |
virtual void RegisterLODStreamingCallback
(
FLODStreamingCallback&& CallbackStreamingStart, |
Register a one-time callback that will be called when streaming starts or ends. | Components/MeshComponent.h | |
void SetColorParameterValueOnMaterials
(
const FName ParameterName, |
Set all occurrences of Vector Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue | Components/MeshComponent.h |
|
void SetMarkTextureAsEditorStreamingPool
(
bool bInMarkAsEditorStreamingPool |
Set the bMarkAsEditorStreamingPool on all textures used by this component. | Components/MeshComponent.h | |
virtual void SetMeshPaintTexture
(
UTexture* Texture |
Set the mesh paint texture on this component. | Components/MeshComponent.h | |
virtual void SetMeshPaintTextureOverride
(
UTexture* OverrideTexture |
Set a transient override mesh paint texture on this component. | Components/MeshComponent.h | |
void SetOverlayMaterial
(
UMaterialInterface* NewOverlayMaterial |
Change the overlay material used by this instance | Components/MeshComponent.h |
|
void SetOverlayMaterialMaxDrawDistance
(
float InMaxDrawDistance |
Change the overlay material max draw distance used by this instance | Components/MeshComponent.h |
|
void SetScalarParameterValueOnMaterials
(
const FName ParameterName, |
Set all occurrences of Scalar Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue | Components/MeshComponent.h |
|
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. | Components/MeshComponent.h | |
void SetVectorParameterValueOnMaterials
(
const FName ParameterName, |
Set all occurrences of Vector Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue | Components/MeshComponent.h |
|
virtual bool UseNaniteOverrideMaterials() |
Determines if we use the nanite overrides from any materials | Components/MeshComponent.h |
Overridden from UPrimitiveComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UMaterialInterface * GetMaterial
(
int32 ElementIndex |
Returns the material used by the element at the specified index | Components/MeshComponent.h | |
virtual UMaterialInterface * GetMaterialByName
(
FName MaterialSlotName |
Returns the material used by the element in the slot with the specified name. | Components/MeshComponent.h | |
virtual int32 GetNumMaterials() |
Return number of material elements in this primitive | Components/MeshComponent.h | |
virtual void GetUsedMaterials
(
TArray< UMaterialInterface* >& OutMaterials, |
Retrieves the materials used in this component | Components/MeshComponent.h | |
virtual void SetMaterial
(
int32 ElementIndex, |
Changes the material applied to an element of the mesh. | Components/MeshComponent.h | |
virtual void SetMaterialByName
(
FName MaterialSlotName, |
Changes the material applied to an element of the mesh. | Components/MeshComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
Components/MeshComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CacheMaterialParameterNameIndices() |
Retrieves all the (scalar/vector-)parameters from within the used materials on the SkeletalMesh, and stores material index vs parameter names | Components/MeshComponent.h | |
virtual UMaterialInterface * GetDefaultOverlayMaterial() |
Get the default overlay material used by a mesh | Components/MeshComponent.h | |
virtual float GetDefaultOverlayMaterialMaxDrawDistance() |
Get the default overlay material max draw distance | Components/MeshComponent.h | |
void MarkCachedMaterialParameterNameIndicesDirty() |
Mark cache parameters map as dirty, cache will be rebuild once SetScalar/SetVector functions are called | Components/MeshComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
Components/MeshComponent.h |