UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SkinnedAsset.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
7#pragma once
8
9#include "CoreMinimal.h"
13#include "ReferenceSkeleton.h"
15#include "SkinnedAsset.generated.h"
16
23class ITargetPlatform;
24class UMeshDeformer;
26class UMorphTarget;
27class UPhysicsAsset;
28class USkeleton;
33
35
37{
38 None = 0,
39 ReadOnly = 1,
40 WriteOnly = 2,
41 ReadWrite = 3
42};
44
45UCLASS(hidecategories = Object, config = Engine, editinlinenew, abstract, MinimalAPI)
47{
49
50public:
52 ENGINE_API virtual ~USkinnedAsset();
53
55 virtual struct FReferenceSkeleton& GetRefSkeleton()
57 virtual const struct FReferenceSkeleton& GetRefSkeleton() const
59
62 PURE_VIRTUAL(USkinnedAsset::GetLODInfo, return nullptr;);
63 virtual const FSkeletalMeshLODInfo* GetLODInfo(int32 Index) const
64 PURE_VIRTUAL(USkinnedAsset::GetLODInfo, return nullptr;);
65
67 ENGINE_API virtual bool IsValidMaterialIndex(int32 Index) const;
68
70 ENGINE_API virtual int32 GetNumMaterials() const;
71
73 virtual UPhysicsAsset* GetShadowPhysicsAsset() const
74 PURE_VIRTUAL(USkinnedAsset::GetShadowPhysicsAsset, return nullptr;);
75
77 virtual FMatrix GetComposedRefPoseMatrix(FName InBoneName) const
78 PURE_VIRTUAL(USkinnedAsset::GetComposedRefPoseMatrix, return FMatrix::Identity;);
79
81 virtual FMatrix GetComposedRefPoseMatrix(int32 InBoneIndex) const
82 PURE_VIRTUAL(USkinnedAsset::GetComposedRefPoseMatrix, return FMatrix::Identity;);
83
91 virtual const FMeshUVChannelInfo* GetUVChannelData(int32 MaterialIndex) const
92 PURE_VIRTUAL(USkinnedAsset::GetUVChannelData, return nullptr;);
93
95 virtual bool GetSupportRayTracing() const
96 PURE_VIRTUAL(USkinnedAsset::GetSupportRayTracing, return false;);
97
99 virtual int32 GetRayTracingMinLOD() const
100 PURE_VIRTUAL(USkinnedAsset::GetRayTracingMinLOD, return 0;);
101
103 virtual TArray<FMatrix44f>& GetRefBasesInvMatrix()
104 PURE_VIRTUAL(USkinnedAsset::GetRefBasesInvMatrix, static TArray<FMatrix44f> Dummy; return Dummy;);
105 virtual const TArray<FMatrix44f>& GetRefBasesInvMatrix() const
106 PURE_VIRTUAL(USkinnedAsset::GetRefBasesInvMatrix, static const TArray<FMatrix44f> Dummy; return Dummy;);
107
109 UE_DEPRECATED(5.5, "Use GetLODInfo and GetLODNum instead.")
111 PURE_VIRTUAL(USkinnedAsset::GetLODInfoArray, return GetMeshLodInfoDummyArray(););
112 UE_DEPRECATED(5.5, "Use GetLODInfo and GetLODNum instead.")
113 virtual const TArray<FSkeletalMeshLODInfo>& GetLODInfoArray() const
114 PURE_VIRTUAL(USkinnedAsset::GetLODInfoArray, return GetMeshLodInfoDummyArray(););
115
117 virtual class FSkeletalMeshRenderData* GetResourceForRendering() const
118 PURE_VIRTUAL(USkinnedAsset::GetResourceForRendering, return nullptr;);
119
120 virtual int32 GetDefaultMinLod() const
121 PURE_VIRTUAL(USkinnedAsset::GetDefaultMinLod, return 0;);
122
123 virtual const FPerPlatformInt& GetMinLod() const
125
127 virtual bool IsMinLodQualityLevelEnable() const { return false; }
128
130 PURE_VIRTUAL(USkinnedAsset::GetPhysicsAsset, return nullptr;);
131
133 PURE_VIRTUAL(USkinnedAsset::GetMaterials, return GetSkeletalMaterialDummyArray(););
134 virtual const TArray<FSkeletalMaterial>& GetMaterials() const
135 PURE_VIRTUAL(USkinnedAsset::GetMaterials, return GetSkeletalMaterialDummyArray(););
136
137 virtual int32 GetLODNum() const
138 PURE_VIRTUAL(USkinnedAsset::GetLODNum, return 0;);
139
140 virtual bool IsMaterialUsed(int32 MaterialIndex) const
141 PURE_VIRTUAL(USkinnedAsset::IsMaterialUsed, return false;);
142
143 virtual FBoxSphereBounds GetBounds() const
144 PURE_VIRTUAL(USkinnedAsset::GetBounds, return FBoxSphereBounds(););
145
150 virtual TArray<class USkeletalMeshSocket*> GetActiveSocketList() const
151 PURE_VIRTUAL(USkinnedAsset::GetActiveSocketList, static TArray<class USkeletalMeshSocket*> Dummy; return Dummy;);
152
157 UFUNCTION(BlueprintCallable, Category = "Animation")
158 virtual USkeletalMeshSocket* FindSocket(FName InSocketName) const
159 PURE_VIRTUAL(USkinnedAsset::FindSocket, return nullptr;);
160
167 UFUNCTION(BlueprintCallable, Category = "Animation")
168 virtual USkeletalMeshSocket* FindSocketInfo(FName InSocketName, FTransform& OutTransform, int32& OutBoneIndex, int32& OutIndex) const
169 PURE_VIRTUAL(USkinnedAsset::FindSocketInfo, return nullptr;);
170
171 virtual USkeleton* GetSkeleton()
172 PURE_VIRTUAL(USkinnedAsset::GetSkeleton, return nullptr;);
173 virtual const USkeleton* GetSkeleton() const
174 PURE_VIRTUAL(USkinnedAsset::GetSkeleton, return nullptr;);
175 virtual void SetSkeleton(USkeleton* InSkeleton)
176 PURE_VIRTUAL(USkinnedAsset::SetSkeleton,);
177
178 virtual UMeshDeformer* GetDefaultMeshDeformer() const
179 PURE_VIRTUAL(USkinnedAsset::GetDefaultMeshDeformer, return nullptr;);
180
181 virtual UMeshDeformerCollection* GetTargetMeshDeformers() const
182 PURE_VIRTUAL(USkinnedAsset::GetTargetMeshDeformers, return nullptr;);
183
184 virtual bool HasHalfEdgeBuffer(int32 LODIndex) const
185 PURE_VIRTUAL(USkinnedAsset::HasHalfEdgeBuffer, return false;);
186
187 virtual class UMaterialInterface* GetOverlayMaterial() const
188 PURE_VIRTUAL(USkinnedAsset::GetOverlayMaterial, return nullptr;);
189 virtual float GetOverlayMaterialMaxDrawDistance() const
190 PURE_VIRTUAL(USkinnedAsset::GetOverlayMaterialMaxDrawDistance, return 0.f;);
191
193 virtual bool IsValidLODIndex(int32 Index) const
194 PURE_VIRTUAL(USkinnedAsset::IsValidLODIndex, return false;);
195
196 virtual int32 GetMinLodIdx(bool bForceLowestLODIdx = false) const
197 PURE_VIRTUAL(USkinnedAsset::GetMinLodIdx, return 0;);
198
201 { static TArray<TObjectPtr<UMorphTarget>> Dummy; return Dummy; }
203 { static const TArray<TObjectPtr<UMorphTarget>> Dummy; return Dummy; }
204
207 { return nullptr; }
208
210 virtual bool NeedCPUData(int32 LODIndex) const
212
214 virtual bool GetHasVertexColors() const
215 PURE_VIRTUAL(USkinnedAsset::GetHasVertexColors, return false;);
216
217 virtual int32 GetPlatformMinLODIdx(const ITargetPlatform* TargetPlatform) const
218 PURE_VIRTUAL(USkinnedAsset::GetPlatformMinLODIdx, return 0;);
219
220 virtual const FPerPlatformBool& GetDisableBelowMinLodStripping() const
221 PURE_VIRTUAL(USkinnedAsset::GetDisableBelowMinLodStripping, static const FPerPlatformBool Dummy; return Dummy;);
222
223 virtual void SetSkinWeightProfilesData(int32 LODIndex, struct FSkinWeightProfilesData& SkinWeightProfilesData) {}
224 virtual FSkinWeightProfilesData* GetSkinWeightProfilesData(int32 LODIndex) { return nullptr; }
225
227 ENGINE_API virtual ESkeletalMeshVertexFlags GetVertexBufferFlags() const;
228
235
236 //~ Begin UObject Interface
243 virtual FString GetDetailedInfoInternal() const override
244 { return GetPathName(nullptr); }
245
246 ENGINE_API virtual void PostLoad() override;
247 //~ End UObject Interface
248
250
252 static ENGINE_API FString GetLODPathName(const USkinnedAsset* Mesh, int32 LODIndex);
253
255#if WITH_EDITOR
256 ENGINE_API virtual bool IsCompiling() const override;
257#else
258 inline bool IsCompiling() const { return false; }
259#endif
262#if WITH_EDITOR
263 virtual FString BuildDerivedDataKey(const ITargetPlatform* TargetPlatform)
264 PURE_VIRTUAL(USkinnedAsset::BuildDerivedDataKey, return TEXT(""););
265
266 /* Return true if this asset was never build since its creation. */
267 virtual bool IsInitialBuildDone() const
269
270 /* Build a LOD model before creating its render data. */
271 UE_DEPRECATED(5.6, "Use or override the overload that takes FSkeletalMeshRenderData instead")
272 virtual void BuildLODModel(const ITargetPlatform* TargetPlatform, int32 LODIndex) final {}
273
274 /* Build a LOD model for the given render data. */
275 virtual void BuildLODModel(FSkeletalMeshRenderData& RenderData, const ITargetPlatform* TargetPlatform, int32 LODIndex) {}
276
278 virtual bool GetEnableLODStreaming(const ITargetPlatform* TargetPlatform) const
279 PURE_VIRTUAL(USkinnedAsset::GetEnableLODStreaming, return false;);
280
282 virtual int32 GetMaxNumStreamedLODs(const ITargetPlatform* TargetPlatform) const
283 PURE_VIRTUAL(USkinnedAsset::GetMaxNumStreamedLODs, return 0;);
284
285 virtual int32 GetMaxNumOptionalLODs(const ITargetPlatform* TargetPlatform) const
286 PURE_VIRTUAL(USkinnedAsset::GetMaxNumOptionalLODs, return 0;);
287
288 virtual bool HasCompileDependencies() const { return false; }
289 virtual bool HasAnyDependenciesCompiling() const { return false; }
290 virtual TArray<USkinnedAsset*> GetSkinnedAssetDependencies() const { return {}; }
291#endif // WITH_EDITOR
292
293#if WITH_EDITORONLY_DATA
294 UE_DEPRECATED(5.4, "This function and associated functionality is no longer supported.")
295 static bool GetUseLegacyMeshDerivedDataKey() { return false; }
296
298 virtual class FSkeletalMeshModel* GetImportedModel() const
300#endif // WITH_EDITORONLY_DATA
301
307 ENGINE_API void UpdateUVChannelData(bool bResetOverrides);
308
309protected:
310#if WITH_EDITORONLY_DATA
311 ENGINE_API virtual void UpdateMaterialUVChannelData(FMeshUVChannelInfo& UVChannelData, int32 MaterialIndex);
312#endif
313
318
324
325#if WITH_EDITOR
332
339
343 ENGINE_API virtual bool TryCancelAsyncTasks();
344
347#endif // WITH_EDITOR
348
349private:
351 virtual void BeginPostLoadInternal(FSkinnedAssetPostLoadContext& Context) {}
353 virtual void ExecutePostLoadInternal(FSkinnedAssetPostLoadContext& Context) {}
355 virtual void FinishPostLoadInternal(FSkinnedAssetPostLoadContext& Context) {}
356
358 virtual FString GetAsyncPropertyName(uint64 Property) const { return TEXT(""); }
359
360#if WITH_EDITOR
362 virtual void PrepareForAsyncCompilation() {}
364 virtual bool IsAsyncTaskComplete() const { return true; }
365
367 std::atomic<uint64> AccessedProperties;
369 std::atomic<uint64> ModifiedProperties;
370#endif // WITH_EDITOR
371
372 friend class FSkinnedAssetCompilingManager;
373 friend class FSkinnedAssetAsyncBuildWorker;
374
375 static ENGINE_API TArray<FSkeletalMeshLODInfo>& GetMeshLodInfoDummyArray();
376 static ENGINE_API TArray<FSkeletalMaterial>& GetSkeletalMaterialDummyArray();
377};
378
379#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_6
380#include "PSOPrecache.h"
381#endif
void AsyncTask(ENamedThreads::Type Thread, TUniqueFunction< void()> Function)
Definition Async.cpp:54
#define PURE_VIRTUAL(func,...)
Definition CoreMiscDefines.h:103
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
#define MAX_uint64
Definition NumericLimits.h:22
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
ESkeletalMeshVertexFlags
Definition SkeletalMeshTypes.h:26
ESkinnedAssetAsyncPropertyLockType
Definition SkinnedAsset.h:37
TArray< FPSOPrecacheVertexFactoryDataPerMaterialIndex, TInlineAllocator< 4 > > FPSOPrecacheVertexFactoryDataPerMaterialIndexList
Definition SkinnedAsset.h:32
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Engine.Build.cs:7
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
Definition UnrealType.h:3087
Definition SkeletalMeshRenderData.h:17
Definition SkinnedAssetAsyncCompileUtils.h:42
Definition SkinnedAssetAsyncCompileUtils.h:36
Definition SkinnedAssetAsyncCompileUtils.h:48
Definition VertexFactory.h:314
Definition Interface_AsyncCompilation.h:21
Definition Array.h:670
Definition UniquePtr.h:107
Definition MaterialInterface.h:296
Definition MeshDeformerCollection.h:14
Definition MeshDeformer.h:19
Definition MorphTarget.h:230
Definition PhysicsAsset.h:172
Definition SkeletalMeshSocket.h:14
Definition Skeleton.h:295
Definition SkinnedAsset.h:47
virtual FSkinWeightProfilesData * GetSkinWeightProfilesData(int32 LODIndex)
Definition SkinnedAsset.h:224
virtual UMorphTarget * FindMorphTarget(FName MorphTargetName) const
Definition SkinnedAsset.h:206
virtual const TArray< TObjectPtr< UMorphTarget > > & GetMorphTargets() const
Definition SkinnedAsset.h:202
virtual bool NeedCPUData(int32 LODIndex) const PURE_VIRTUAL(USkinnedAsset
Definition SkinnedAsset.h:210
virtual bool GetHasVertexColors() const PURE_VIRTUAL(USkinnedAsset
Definition SkinnedAsset.h:214
bool IsCompiling() const
Definition SkinnedAsset.h:258
virtual FString GetDetailedInfoInternal() const override
Definition SkinnedAsset.h:243
virtual UPhysicsAsset * GetPhysicsAsset() const PURE_VIRTUAL(USkinnedAsset
Definition SkinnedAsset.h:129
Definition SkinnedMeshComponent.h:258
Definition StreamableRenderAsset.h:37
Type
Definition RHIFeatureLevel.h:20
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition MeshUVChannelInfo.h:13
Definition PerPlatformProperties.h:384
Definition PerPlatformProperties.h:211
Definition ReferenceSkeleton.h:100
Definition SkinnedAssetCommon.h:370
Definition SkinnedAssetCommon.h:129
Definition SkinWeightProfile.h:238
Definition ObjectPtr.h:488
Definition BoxSphereBounds.h:25