UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSkeletalMeshObjectCPUSkin Class Reference

#include <SkeletalRenderCPUSkin.h>

+ Inheritance diagram for FSkeletalMeshObjectCPUSkin:

Public Member Functions

ENGINE_API FSkeletalMeshObjectCPUSkin (const USkinnedMeshComponent *InMeshComponent, FSkeletalMeshRenderData *InSkelMeshRenderData, ERHIFeatureLevel::Type InFeatureLevel)
 
ENGINE_API FSkeletalMeshObjectCPUSkin (const FSkinnedMeshSceneProxyDesc &InMeshDesc, FSkeletalMeshRenderData *InSkelMeshRenderData, ERHIFeatureLevel::Type InFeatureLevel)
 
virtual ENGINE_API ~FSkeletalMeshObjectCPUSkin ()
 
virtual ENGINE_API void InitResources (const FSkinnedMeshSceneProxyDesc &InMeshDesc) override
 
virtual ENGINE_API void ReleaseResources () override
 
virtual ENGINE_API void Update (int32 LODIndex, const FSkinnedMeshSceneProxyDynamicData &InDynamicData, const FPrimitiveSceneProxy *InSceneProxy, const USkinnedAsset *InSkinnedAsset, const FMorphTargetWeightMap &InActiveMorphTargets, const TArray< float > &InMorphTargetWeights, EPreviousBoneTransformUpdateMode PreviousBoneTransformUpdateMode, const FExternalMorphWeightData &InExternalMorphWeightData) override
 
ENGINE_API void UpdateDynamicData_RenderThread (FRHICommandList &RHICmdList, FDynamicSkelMeshObjectDataCPUSkin *InDynamicData, uint64 FrameNumberToPrepare, uint32 RevisionNumber)
 
virtual ENGINE_API void EnableOverlayRendering (bool bEnabled, const TArray< int32 > *InBonesOfInterest, const TArray< UMorphTarget * > *InMorphTargetOfInterest) override
 
virtual ENGINE_API const FVertexFactoryGetSkinVertexFactory (const FSceneView *View, int32 LODIndex, int32 ChunkIdx, ESkinVertexFactoryMode VFMode=ESkinVertexFactoryMode::Default) const override
 
virtual ENGINE_API const FVertexFactoryGetStaticSkinVertexFactory (int32 LODIndex, int32 ChunkIdx, ESkinVertexFactoryMode VFMode) const override
 
virtual ENGINE_API TArray< FTransform > * GetComponentSpaceTransforms () const override
 
virtual ENGINE_API TConstArrayView< FMatrix44fGetReferenceToLocalMatrices () const override
 
virtual FSkinningSceneExtensionProxyCreateSceneExtensionProxy (const USkinnedAsset *InSkinnedAsset, bool bAllowScaling)
 
ENGINE_API void CacheVertices (int32 LODIndex, bool bForce, FRHICommandList &RHICmdList) const
 
virtual int32 GetLOD () const override
 
virtual bool HaveValidDynamicData () const override
 
virtual void GetResourceSizeEx (FResourceSizeEx &CumulativeResourceSize) override
 
virtual bool IsCPUSkinned () const override
 
virtual ENGINE_API void DrawVertexElements (FPrimitiveDrawInterface *PDI, const FMatrix &ToWorldSpace, bool bDrawNormals, bool bDrawTangents, bool bDrawBinormals) const override
 
const TArray< FFinalSkinVertex > & GetCachedFinalVertices () const
 
virtual ENGINE_API void UpdateSkinWeightBuffer (const TArrayView< const FSkelMeshComponentLODInfo > InLODInfo) override
 
- Public Member Functions inherited from FSkeletalMeshObject
ENGINE_API FSkeletalMeshObject (const USkinnedMeshComponent *InMeshComponent, FSkeletalMeshRenderData *InSkelMeshRenderData, ERHIFeatureLevel::Type FeatureLevel)
 
ENGINE_API FSkeletalMeshObject (const FSkinnedMeshSceneProxyDesc &InMeshDesc, FSkeletalMeshRenderData *InSkelMeshRenderData, ERHIFeatureLevel::Type FeatureLevel)
 
virtual ENGINE_API ~FSkeletalMeshObject ()
 
ENGINE_API void Update (int32 LODIndex, const USkinnedMeshComponent *InMeshComponent, const FMorphTargetWeightMap &InActiveMorphTargets, const TArray< float > &MorphTargetWeights, EPreviousBoneTransformUpdateMode PreviousBoneTransformUpdateMode, const FExternalMorphWeightData &InExternalMorphWeightData)
 
virtual void PreGDMECallback (FRHICommandList &RHICmdList, class FGPUSkinCache *GPUSkinCache, uint32 FrameNumber)
 
virtual const FSkinBatchVertexFactoryUserDataGetVertexFactoryUserData (const int32 LODIndex, int32 ChunkIdx, ESkinVertexFactoryMode VFMode) const
 
virtual bool IsGPUSkinMesh () const
 
virtual bool IsNaniteMesh () const
 
virtual const Nanite::FMaterialAuditGetNaniteMaterials () const
 
virtual TConstArrayView< FMatrix44fGetPrevReferenceToLocalMatrices () const
 
virtual const TArray< FMatrix3x4 > * GetCurrentBoneTransforms () const
 
virtual const TArray< FMatrix3x4 > * GetPreviousBoneTransforms () const
 
virtual bool GetCachedGeometry (FRDGBuilder &GraphBuilder, FCachedGeometry &OutCachedGeometry) const
 
bool GetCachedGeometry (FCachedGeometry &OutCachedGeometry) const
 
void UpdateSkinWeightBuffer (const USkinnedMeshComponent *InMeshComponent)
 
void UpdateMinDesiredLODLevel (const FSceneView *View, const FBoxSphereBounds &Bounds)
 
bool ShouldUsePerBoneMotionBlur () const
 
ENGINE_API const TArray< FSkelMeshRenderSection > & GetRenderSections (int32 InLODIndex) const
 
void SetHiddenMaterials (int32 InLODIndex, const TArray< bool > &HiddenMaterials)
 
bool IsMaterialHidden (int32 InLODIndex, int32 MaterialIdx) const
 
void InitLODInfos (const TArrayView< const FSkelMeshComponentLODInfo > InComponentLODInfo, const USkinnedAsset *InSkinnedAsset)
 
uint32 GetComponentId () const
 
TStatId GetStatId () const
 
FSkeletalMeshRenderDataGetSkeletalMeshRenderData () const
 
FColor GetSkinCacheVisualizationDebugColor (const FName &GPUSkinCacheVisualizationMode, uint32 SectionIndex) const
 
FName GetAssetPathName (int32 LODIndex=-1) const
 
virtual void SetTransform (const FMatrix &InNewLocalToWorld, uint32 FrameNumber)
 
virtual void RefreshClothingTransforms (const FMatrix &InNewLocalToWorld, uint32 FrameNumber)
 
FName GetDebugName () const
 
ERHIFeatureLevel::Type GetFeatureLevel () const
 
bool SupportsStaticRelevance () const
 
float GetScreenSize (int32 LODIndex) const
 
virtual const FSkinWeightVertexBufferGetSkinWeightVertexBuffer (int32 LODIndex) const
 
virtual int32 GetDynamicBoundsStartOffset (int32 LODIndex) const
 
- Public Member Functions inherited from FDeferredCleanupInterface
virtual ~FDeferredCleanupInterface ()
 

Protected Attributes

class FDynamicSkelMeshObjectDataCPUSkinDynamicData
 
- Protected Attributes inherited from FSkeletalMeshObject
FSkeletalMeshRenderDataSkeletalMeshRenderData
 
FGPUSkinCacheEntrySkinCacheEntry
 
FGPUSkinCacheEntrySkinCacheEntryForRayTracing
 
uint32 LastFrameNumber
 
UE::FMutex DesiredLODLevelMutex
 
bool bUsePerBoneMotionBlur
 
bool bSupportsStaticRelevance = false
 
TStatId StatId
 
ERHIFeatureLevel::Type FeatureLevel
 
uint32 ComponentId
 
FVector WorldScale = FVector::OneVector
 

Additional Inherited Members

- Static Public Member Functions inherited from FSkeletalMeshObject
static FSkinWeightVertexBufferGetSkinWeightVertexBuffer (FSkeletalMeshLODRenderData &LODData, const FSkelMeshComponentLODInfo *CompLODInfo)
 
static FColorVertexBufferGetColorVertexBuffer (FSkeletalMeshLODRenderData &LODData, const FSkelMeshComponentLODInfo *CompLODInfo)
 
- Public Attributes inherited from FSkeletalMeshObject
TArray< FSkelMeshObjectLODInfoLODInfo
 
TArray< FCapsuleShape3fShadowCapsuleShapes
 
int32 MinDesiredLODLevel
 
float MaxDistanceFactor
 
int32 WorkingMinDesiredLODLevel
 
float WorkingMaxDistanceFactor
 
bool bHasBeenUpdatedAtLeastOnce
 
FName DebugName
 

Detailed Description

Render data for a CPU skinned mesh

Constructor & Destructor Documentation

◆ FSkeletalMeshObjectCPUSkin() [1/2]

FSkeletalMeshObjectCPUSkin::FSkeletalMeshObjectCPUSkin ( const USkinnedMeshComponent InMeshComponent,
FSkeletalMeshRenderData InSkelMeshRenderData,
ERHIFeatureLevel::Type  InFeatureLevel 
)
Parameters
InSkeletalMeshComponent- skeletal mesh primitive we want to render

◆ FSkeletalMeshObjectCPUSkin() [2/2]

FSkeletalMeshObjectCPUSkin::FSkeletalMeshObjectCPUSkin ( const FSkinnedMeshSceneProxyDesc InMeshDesc,
FSkeletalMeshRenderData InSkelMeshRenderData,
ERHIFeatureLevel::Type  InFeatureLevel 
)

◆ ~FSkeletalMeshObjectCPUSkin()

FSkeletalMeshObjectCPUSkin::~FSkeletalMeshObjectCPUSkin ( )
virtual

Member Function Documentation

◆ CacheVertices()

void FSkeletalMeshObjectCPUSkin::CacheVertices ( int32  LODIndex,
bool  bForce,
FRHICommandList RHICmdList 
) const

Re-skin cached vertices for an LOD and update the vertex buffer. Note that this function is called from the render thread!

Parameters
LODIndex- index to LODs
bForce- force update even if LOD index hasn't changed

◆ CreateSceneExtensionProxy()

virtual FSkinningSceneExtensionProxy * FSkeletalMeshObjectCPUSkin::CreateSceneExtensionProxy ( const USkinnedAsset InSkinnedAsset,
bool  bAllowScaling 
)
inlinevirtual

Reimplemented from FSkeletalMeshObject.

◆ DrawVertexElements()

void FSkeletalMeshObjectCPUSkin::DrawVertexElements ( FPrimitiveDrawInterface PDI,
const FMatrix ToWorldSpace,
bool  bDrawNormals,
bool  bDrawTangents,
bool  bDrawBinormals 
) const
overridevirtual

Draw Normals/Tangents based on skinned vertex data

Parameters
PDI- Draw Interface
ToWorldSpace- Transform from component space to world space
bDrawNormals- Should draw vertex normals
bDrawTangents- Should draw vertex tangents
bDrawBinormals- Should draw vertex binormals

Reimplemented from FSkeletalMeshObject.

◆ EnableOverlayRendering()

void FSkeletalMeshObjectCPUSkin::EnableOverlayRendering ( bool  bEnabled,
const TArray< int32 > *  InBonesOfInterest,
const TArray< UMorphTarget * > *  MorphTargetOfInterest 
)
overridevirtual

Enable blend weight rendering in the editor

Parameters
bEnabled- turn on or off the rendering mode optional parameters will decide which one to draw
(optional)BonesOfInterest - array of bone indices to capture weights for
(optional)MorphTargetsOfInterest - array of morphtargets to render for

Reimplemented from FSkeletalMeshObject.

◆ GetCachedFinalVertices()

const TArray< FFinalSkinVertex > & FSkeletalMeshObjectCPUSkin::GetCachedFinalVertices ( ) const
inline

Access cached final vertices

◆ GetComponentSpaceTransforms()

TArray< FTransform > * FSkeletalMeshObjectCPUSkin::GetComponentSpaceTransforms ( ) const
overridevirtual

Get the array of component-space bone transforms. May include transforms that are inherited by follower components. Not safe to hold this point between frames, because it exists in dynamic data passed from main thread.

Implements FSkeletalMeshObject.

◆ GetLOD()

virtual int32 FSkeletalMeshObjectCPUSkin::GetLOD ( ) const
inlineoverridevirtual

Get the LOD to render this mesh at.

Implements FSkeletalMeshObject.

◆ GetReferenceToLocalMatrices()

TConstArrayView< FMatrix44f > FSkeletalMeshObjectCPUSkin::GetReferenceToLocalMatrices ( ) const
overridevirtual

Get the array of refpose->local matrices Not safe to hold this reference between frames, because it exists in dynamic data passed from main thread.

Implements FSkeletalMeshObject.

◆ GetResourceSizeEx()

virtual void FSkeletalMeshObjectCPUSkin::GetResourceSizeEx ( FResourceSizeEx CumulativeResourceSize)
inlineoverridevirtual

Returns the size of memory allocated by render data

Implements FSkeletalMeshObject.

◆ GetSkinVertexFactory()

const FVertexFactory * FSkeletalMeshObjectCPUSkin::GetSkinVertexFactory ( const FSceneView View,
int32  LODIndex,
int32  ChunkIdx,
ESkinVertexFactoryMode  VFMode = ESkinVertexFactoryMode::Default 
) const
overridevirtual
Parameters
View- View, must not be 0, allows to cull depending on showflags (normally not needed/used in SHIPPING)
LODIndex- each LOD has its own vertex data
ChunkIdx- not used
Returns
vertex factory for rendering the LOD, 0 to suppress rendering

Implements FSkeletalMeshObject.

◆ GetStaticSkinVertexFactory()

const FVertexFactory * FSkeletalMeshObjectCPUSkin::GetStaticSkinVertexFactory ( int32  LODIndex,
int32  ChunkIdx,
ESkinVertexFactoryMode  VFMode 
) const
overridevirtual

Called by DrawStaticElements to cache mesh draw commands for skeletal meshes.

Implements FSkeletalMeshObject.

◆ HaveValidDynamicData()

virtual bool FSkeletalMeshObjectCPUSkin::HaveValidDynamicData ( ) const
inlineoverridevirtual

Return true if this does have valid dynamic data to render

Implements FSkeletalMeshObject.

◆ InitResources()

void FSkeletalMeshObjectCPUSkin::InitResources ( const FSkinnedMeshSceneProxyDesc InMeshDesc)
overridevirtual

Initialize rendering resources for each LOD

Implements FSkeletalMeshObject.

◆ IsCPUSkinned()

virtual bool FSkeletalMeshObjectCPUSkin::IsCPUSkinned ( ) const
inlineoverridevirtual

Returns true if this mesh performs skinning on the CPU.

Reimplemented from FSkeletalMeshObject.

◆ ReleaseResources()

void FSkeletalMeshObjectCPUSkin::ReleaseResources ( )
overridevirtual

Release rendering resources for each LOD

Implements FSkeletalMeshObject.

◆ Update()

void FSkeletalMeshObjectCPUSkin::Update ( int32  LODIndex,
const FSkinnedMeshSceneProxyDynamicData InDynamicData,
const FPrimitiveSceneProxy InSceneProxy,
const USkinnedAsset InSkinnedAsset,
const FMorphTargetWeightMap InActiveMorphTargets,
const TArray< float > &  InMorphTargetWeights,
EPreviousBoneTransformUpdateMode  PreviousBoneTransformUpdateMode,
const FExternalMorphWeightData InExternalMorphWeightData 
)
overridevirtual

Implements FSkeletalMeshObject.

◆ UpdateDynamicData_RenderThread()

void FSkeletalMeshObjectCPUSkin::UpdateDynamicData_RenderThread ( FRHICommandList RHICmdList,
FDynamicSkelMeshObjectDataCPUSkin InDynamicData,
uint64  FrameNumberToPrepare,
uint32  RevisionNumber 
)

◆ UpdateSkinWeightBuffer()

void FSkeletalMeshObjectCPUSkin::UpdateSkinWeightBuffer ( const TArrayView< const FSkelMeshComponentLODInfo InLODInfo)
overridevirtual

Implements FSkeletalMeshObject.

Member Data Documentation

◆ DynamicData

class FDynamicSkelMeshObjectDataCPUSkin* FSkeletalMeshObjectCPUSkin::DynamicData
protected

Data that is updated dynamically and is needed for rendering


The documentation for this class was generated from the following files: