![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MeshComponent.h>
Inheritance diagram for UMeshComponent:Classes | |
| struct | FMaterialParameterCache |
Public Attributes | |
| TArray< TObjectPtr< class UMaterialInterface > > | OverrideMaterials |
| TObjectPtr< class UMaterialInterface > | OverlayMaterial |
| float | OverlayMaterialMaxDrawDistance |
| TArray< TObjectPtr< class UMaterialInterface > > | MaterialSlotsOverlayMaterial |
| uint8 | bEnableMaterialParameterCaching: 1 |
Protected Member Functions | |
| virtual ENGINE_API void | BeginDestroy () override |
| virtual UMaterialInterface * | GetDefaultOverlayMaterial () const |
| virtual float | GetDefaultOverlayMaterialMaxDrawDistance () const |
| ENGINE_API void | CacheMaterialParameterNameIndices () |
| ENGINE_API void | MarkCachedMaterialParameterNameIndicesDirty () |
Protected Attributes | |
| uint8 | bCachedMaterialParameterIndicesAreDirty: 1 |
| TSortedMap< FName, FMaterialParameterCache, FDefaultAllocator, FNameFastLess > | MaterialParameterCache |
MeshComponent is an abstract base for any component that is an instance of a renderable collection of triangles.
|
overrideprotectedvirtual |
Reimplemented in USkinnedMeshComponent.
|
protected |
Retrieves all the (scalar/vector-)parameters from within the used materials on the SkeletalMesh, and stores material index vs parameter names
| void UMeshComponent::EmptyOverrideMaterials | ( | ) |
This empties all override materials and used by editor when replacing preview mesh
| const TArray< TObjectPtr< UMaterialInterface > > & UMeshComponent::GetComponentMaterialSlotsOverlayMaterial | ( | ) | const |
Retrieve the material slots overly materials assigned to this component
|
inlinevirtual |
Get all default material slots overlay materials from the mesh.
Reimplemented in USkinnedMeshComponent.
|
inlineprotectedvirtual |
Get the default overlay material used by a mesh
Reimplemented in USkinnedMeshComponent.
|
inlineprotectedvirtual |
Get the default overlay material max draw distance
Reimplemented in USkinnedMeshComponent.
|
overridevirtual |
Reimplemented in UBaseDynamicMeshComponent, USkinnedMeshComponent, and UGeometryCollectionComponent.
|
overridevirtual |
Reimplemented in UBaseDynamicMeshComponent.
|
virtual |
Accesses the scene relevance information for the materials applied to the mesh. Valid from game thread only.
Reimplemented in UGeometryCollectionComponent, and UBaseDynamicMeshComponent.
|
virtual |
Reimplemented in UGeometryCollectionComponent, and UBaseDynamicMeshComponent.
|
virtual |
| void UMeshComponent::GetMaterialSlotsOverlayMaterial | ( | TArray< TObjectPtr< class UMaterialInterface > > & | OutMaterialSlotOverlayMaterials | ) | const |
Fill the array with every material slot overlay material use by this instance.
If this component material slot overlay material will be used if not null. If there is no valid component material slot overlay material, the mesh material slot overlay material will be used if not null. If there is no valid asset material slot overlay material, a null entry will be set for the material slot overlay material.
|
inlinevirtual |
Get the material info for texture streaming. Return whether the data is valid or not.
Reimplemented in USkinnedMeshComponent.
Get the mesh paint texture set on this component. This does not take into account any transient override.
Get the default coordinate index for painting to the mesh paint texture on this component.
|
overridevirtual |
Reimplemented in USkinnedMeshComponent, UGeometryCollectionComponent, and UBaseDynamicMeshComponent.
|
virtual |
Returns override materials count
| UMaterialInterface * UMeshComponent::GetOverlayMaterial | ( | ) | const |
Get the overlay material used by this instance
| float UMeshComponent::GetOverlayMaterialMaxDrawDistance | ( | ) | const |
Get the overlay material used by this instance
Returns default value for the parameter input.
NOTE: This is not reliable when cooking, as initializing the default value requires a render resource that only exists if the owning world is rendering.
| void UMeshComponent::GetStreamingTextureInfoInner | ( | FStreamingTextureLevelContext & | LevelContext, |
| const TArray< FStreamingTextureBuildInfo > * | PreBuiltData, | ||
| float | ComponentScaling, | ||
| TArray< FStreamingRenderAssetPrimitiveInfo > & | OutStreamingTextures | ||
| ) | const |
Generate streaming data for all materials.
|
overridevirtual |
Reimplemented in USkinnedMeshComponent, UGeometryCollectionComponent, and UBaseDynamicMeshComponent.
| FColor UMeshComponent::GetWireframeColorForSceneProxy | ( | ) | const |
Returns the wireframe color to use for this component.
| bool UMeshComponent::HasOverrideMaterials | ( | ) |
Returns true if there are any override materials set for this component
|
virtual |
Output to the log which materials and textures are used by this component.
| Indent | Number of tabs to put before the log. |
|
protected |
Mark cache parameters map as dirty, cache will be rebuild once SetScalar/SetVector functions are called
Tell the streaming system to start streaming in all LODs for the mesh. Note: this function may set bIgnoreStreamingMipBias on this component enable the FastForceResident system.
| Seconds | Number of seconds to force all LODs to be resident |
Reimplemented in USkinnedMeshComponent.
|
virtual |
Tell the streaming system to start loading all textures with all mip-levels.
| Seconds | Number of seconds to force all mip-levels to be resident |
| bPrioritizeCharacterTextures | Whether character textures should be prioritized for a while by the streaming system |
| CinematicTextureGroups | Bitfield indicating which texture groups that use extra high-resolution mips |
|
virtual |
Register a one-time callback that will be called when criteria met
| Callback | |
| LODIdx | The LOD index expected. Specify -1 for the MinLOD. |
| TimeoutSecs | Timeout in seconds |
| bOnStreamIn | To get notified when the expected LOD is streamed in or out |
Reimplemented in USkinnedMeshComponent.
|
virtual |
Register a one-time callback that will be called when streaming starts or ends.
| CallbackStreamingStart | The callback to notify when streaming new LODs in begins. The callback will not always be called if the asset is not streamable, or the asset or component is unloaded. |
| CallbackStreamingDone | The callback to notify when streaming is done. The callback will not be called if the start timeout expired. |
| TimeoutStartSecs | Timeout for streaming to start, in seconds |
| TimeoutDoneSecs | Timeout for streaming to end, in seconds |
Reimplemented in USkinnedMeshComponent.
| void UMeshComponent::SetColorParameterValueOnMaterials | ( | const FName | ParameterName, |
| const FLinearColor | ParameterValue | ||
| ) |
Set all occurrences of Vector Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue
|
overridevirtual |
Reimplemented in UBaseDynamicMeshComponent.
|
overridevirtual |
Set the mesh paint texture on this component.
|
inlinevirtual |
Set a transient override mesh paint texture on this component.
| void UMeshComponent::SetOverlayMaterial | ( | class UMaterialInterface * | NewOverlayMaterial | ) |
Change the overlay material used by this instance
Change the overlay material max draw distance used by this instance
| void UMeshComponent::SetScalarParameterValueOnMaterials | ( | const FName | ParameterName, |
| const float | ParameterValue | ||
| ) |
Set all occurrences of Scalar Material Parameters with ParameterName in the set of materials of the SkeletalMesh to ParameterValue
Tell the streaming system whether or not all mip levels of all textures used by this component should be loaded and remain loaded.
| bForceMiplevelsToBeResident | Whether textures should be forced to be resident or not. |
| void UMeshComponent::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
Determines if we use the nanite overrides from any materials
|
protected |
Flag whether or not the cached material parameter indices map is dirty (defaults to true, and is set from SetMaterial/Set(Skeletal)Mesh
| uint8 UMeshComponent::bEnableMaterialParameterCaching |
Whether or not to cache material parameter to speed up setting scalar or vector value on materials
|
protected |
| TArray<TObjectPtr<class UMaterialInterface> > UMeshComponent::MaterialSlotsOverlayMaterial |
Translucent material to blend on top of this mesh. Mesh will be rendered twice - once with a base material and once with overlay material. The difference with the global OverlayMaterial is those are per material slot, if the entry is null or doesn't exist the global OverlayMaterial will be use for sections using the material slot.
| TObjectPtr<class UMaterialInterface> UMeshComponent::OverlayMaterial |
Translucent material to blend on top of this mesh. Mesh will be rendered twice - once with a base material and once with overlay material
| float UMeshComponent::OverlayMaterialMaxDrawDistance |
The max draw distance for overlay material. A distance of 0 indicates that overlay will be culled using primitive max distance.
| TArray<TObjectPtr<class UMaterialInterface> > UMeshComponent::OverrideMaterials |
Per-Component material overrides. These must NOT be set directly or a race condition can occur between GC and the rendering thread.