Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Components
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- UActorComponent
- USceneComponent
- UPrimitiveComponent
- UMeshComponent
- UGeometryCacheComponent
- UGeometryCacheAbcFileComponent
- UGeometryCacheUsdComponent
- UGroomComponent
- UHeterogeneousVolumeComponent
- USkinnedMeshComponent
- UPoseableMeshComponent
- USkeletalMeshComponent
- UStaticMeshComponent
- UDisplayClusterScreenComponent
- UInstancedStaticMeshComponent
- UHierarchicalInstancedStaticMeshComponent
- UHLODInstancedStaticMeshComponent
- USplineMeshComponent
- UWaterBodyMeshComponent
- UWaterMeshComponent
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Components/MeshComponent.h |
Include | #include "Components/MeshComponent.h" |
Syntax
UCLASS (Abstract, ShowCategories=(VirtualTexture), MinimalAPI)
class UMeshComponent : public UPrimitiveComponent
Remarks
MeshComponent is an abstract base for any component that is an instance of a renderable collection of triangles.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
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 |
![]() ![]() ![]() ![]() |
uint8: 1 | bEnableMaterialParameterCaching | |
![]() |
TSortedMap< FName, FMaterialParameterCache, FDefaultAllocator, FNameFastLess > | MaterialParameterCache | |
![]() ![]() ![]() ![]() |
TObjectPtr< class UMaterialInterface > | OverlayMaterial | Translucent material to blend on top of this mesh. |
![]() ![]() ![]() ![]() |
float | OverlayMaterialMaxDrawDistance | The max draw distance for overlay material. |
![]() ![]() ![]() |
TArray< TObjectPtr< class UMaterialInterface > > | OverrideMaterials | Per-Component material overrides. |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
UMeshComponent
(
const FObjectInitializer& ObjectInitializer |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Retrieves all the (scalar/vector-)parameters from within the used materials on the SkeletalMesh, and stores material index vs parameter names | |
![]() |
void | Make sure the Override array is using only the space it should use. | |
![]() |
void | This empties all override materials and used by editor when replacing preview mesh | |
![]() ![]() ![]() |
UMaterialInterface * | Get the default overlay material used by a mesh | |
![]() ![]() ![]() |
float | Get the default overlay material max draw distance | |
![]() ![]() ![]() |
FMaterialRelevance | GetMaterialRelevance
(
ERHIFeatureLevel::Type InFeatureLevel |
Accesses the scene relevance information for the materials applied to the mesh. |
![]() ![]() ![]() ![]() ![]() |
TArray< class UMaterialInterface * > | GetMaterials () |
|
![]() ![]() ![]() |
bool | GetMaterialStreamingData
(
int32 MaterialIndex, |
Get the material info for texture streaming. Return whether the data is valid or not. |
![]() ![]() ![]() |
int32 | Returns override materials count | |
![]() ![]() ![]() ![]() |
UMaterialInterface * | Get the overlay material used by this instance | |
![]() ![]() ![]() ![]() |
float | Get the overlay material used by this instance | |
![]() |
float | GetScalarParameterDefaultValue
(
const FName ParameterName |
Returns default value for the parameter input. |
![]() ![]() |
void | GetStreamingTextureInfoInner
(
FStreamingTextureLevelContext& LevelContext, |
Generate streaming data for all materials. |
![]() |
bool | Returns true if there are any override materials set for this component | |
![]() ![]() ![]() |
void | LogMaterialsAndTextures
(
FOutputDevice& Ar, |
Output to the log which materials and textures are used by this component. |
![]() |
void | Mark cache parameters map as dirty, cache will be rebuild once SetScalar/SetVector functions are called | |
![]() ![]() ![]() ![]() |
bool | PrestreamMeshLODs
(
float Seconds |
Tell the streaming system to start streaming in all LODs for the mesh. |
![]() ![]() ![]() ![]() |
void | PrestreamTextures
(
float Seconds, |
Tell the streaming system to start loading all textures with all mip-levels. |
![]() ![]() |
void | RegisterLODStreamingCallback
(
FLODStreamingCallback&& Callback, |
Register a one-time callback that will be called when criteria met |
![]() ![]() |
void | RegisterLODStreamingCallback
(
FLODStreamingCallback&& CallbackStreamingStart, |
Register a one-time callback that will be called when streaming starts or ends. |
![]() ![]() ![]() |
void | SetOverlayMaterial
(
UMaterialInterface* NewOverlayMaterial |
Change the overlay material used by this instance |
![]() ![]() ![]() |
void | SetOverlayMaterialMaxDrawDistance
(
float InMaxDrawDistance |
Change the overlay material max draw distance used by this instance |
![]() ![]() ![]() |
void | SetScalarParameterValueOnMaterials
(
const FName ParameterName, |
Material parameter setting and caching Set all occurrences of Scalar Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue |
![]() ![]() |
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. |
![]() ![]() ![]() |
void | SetVectorParameterValueOnMaterials
(
const FName ParameterName, |
Set all occurrences of Vector Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue |
![]() ![]() ![]() |
bool | Determines if we use the nanite overrides from any materials |
Overridden from UPrimitiveComponent
Type | Name | Description | |
---|---|---|---|
![]() ![]() ![]() |
UMaterialInterface * | GetMaterial
(
int32 ElementIndex |
Returns the material used by the element at the specified index |
![]() ![]() ![]() |
UMaterialInterface * | GetMaterialByName
(
FName MaterialSlotName |
Returns the material used by the element in the slot with the specified name. |
![]() ![]() ![]() |
int32 | Return number of material elements in this primitive | |
![]() ![]() ![]() |
void | GetUsedMaterials
(
TArray< UMaterialInterface* >& OutMaterials, |
Retrieves the materials used in this component |
![]() ![]() |
void | SetMaterial
(
int32 ElementIndex, |
Changes the material applied to an element of the mesh. |
![]() ![]() |
void | SetMaterialByName
(
FName MaterialSlotName, |
Changes the material applied to an element of the mesh. |
Overridden from UObject
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | BeginDestroy () |
Called before destroying the object. |
![]() ![]() |
void | PostEditChangeChainProperty
(
FPropertyChangedChainEvent& PropertyChangedEvent |
This alternate version of PostEditChange is called when properties inside structs are modified. |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FMaterialParameterCache | Struct containing information about a given parameter name |