UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SkeletalMeshAttributes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6
7#include "Containers/Array.h"
8#include "HAL/Platform.h"
12#include "UObject/NameTypes.h"
13#include "UObject/UnrealNames.h"
14
15// Forward declarations
16template <typename AttributeType> class TArrayAttribute;
17struct FMeshDescription;
18
19// Add any skeletalmesh specific attributes here
20namespace MeshAttribute
21{
22 namespace Vertex
23 {
24 // Name of the default skin weights attribute.
26
28 }
29
30 namespace Bone
31 {
36 }
37
38 namespace SourceGeometryPart
39 {
42 }
43}
44
45
47{
48public:
50
53
56
59
62
64
67
70
79
80
87
88
89 // The name of the default skin weight profile.
91
93
94 //
95 // Skin Weights Methods
96 //
97
103
107
110
114
116
118
119 //
120 // Morph Target Methods
121 //
122
125
128
131
135
141
143
145
146 //
147 // Bones Methods
148 //
149
151
153
155
157
159
161
163 bool HasBones() const
164 {
165 return BoneElementsShared != nullptr;
166 }
167
170
173
175
177
179
181
182
183 //
185 {
186 return SourceGeometryPartElementsShared != nullptr;
187 }
188
190
192
194
196
198
200
201protected:
206
209
212
213private:
214 const FMeshDescription& MeshDescriptionShared;
215};
216
217
221{
222public:
223
225
226 SKELETALMESHDESCRIPTION_API virtual void Register(bool bKeepExistingAttribute = false) override;
227
241
242 //
248
254
255 //
256 // Skin Weights Methods
257 //
258
263
268
271
273
274 //
275 // Morph Target Methods
276 //
277
287
292
296
302
303 //
304 // Bones Methods
305 //
306
309
311
313
316
319
322
325
327
329
331
333
334
335 /* Source Geometry Parts */
336
341
343
345
347
349
351
353
354
355
356private:
357 FMeshElementChannels* BoneElements = nullptr;
358 FMeshElementChannels* SourceGeometryPartElements = nullptr;
359};
360
361
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
@ Vertex
Definition MetalRHIPrivate.h:223
Definition MeshElementContainer.h:367
Definition NameTypes.h:617
Definition SkeletalMeshAttributes.h:47
TMeshAttributesRef< FBoneID, FVector4f > FBoneColorAttributesRef
Definition SkeletalMeshAttributes.h:60
static SKELETALMESHDESCRIPTION_API bool IsSkinWeightAttribute(const FName InAttributeName)
Helper function that indicates whether an attribute name represents a skin weight attribute.
Definition SkeletalMeshAttributes.cpp:449
static SKELETALMESHDESCRIPTION_API FName SourceGeometryPartElementName
Definition SkeletalMeshAttributes.h:86
TMeshAttributesConstRef< FSourceGeometryPartID, FName > FSourceGeometryPartNameConstRef
Definition SkeletalMeshAttributes.h:66
SKELETALMESHDESCRIPTION_API FBoneParentIndexAttributesConstRef GetBoneParentIndices() const
Definition SkeletalMeshAttributes.cpp:591
SKELETALMESHDESCRIPTION_API bool HasMorphTargetNormalsAttribute(const FName InMorphTargetName) const
Definition SkeletalMeshAttributes.cpp:540
TMeshAttributesRef< FSourceGeometryPartID, TArrayView< int32 > > FSourceGeometryPartVertexOffsetAndCountRef
Definition SkeletalMeshAttributes.h:68
SKELETALMESHDESCRIPTION_API const FBoneArray & Bones() const
Definition SkeletalMeshAttributes.cpp:566
SKELETALMESHDESCRIPTION_API FBoneNameAttributesConstRef GetBoneNames() const
Definition SkeletalMeshAttributes.cpp:586
static SKELETALMESHDESCRIPTION_API bool IsValidSkinWeightProfileName(const FName InProfileName)
Definition SkeletalMeshAttributes.cpp:444
SKELETALMESHDESCRIPTION_API int32 GetNumBones() const
Definition SkeletalMeshAttributes.cpp:576
TMeshAttributesConstRef< FBoneID, FVector4f > FBoneColorAttributesConstRef
Definition SkeletalMeshAttributes.h:61
const FMeshElementChannels * BoneElementsShared
Definition SkeletalMeshAttributes.h:210
SKELETALMESHDESCRIPTION_API bool IsBoneValid(const FBoneID BoneID) const
Definition SkeletalMeshAttributes.cpp:581
SKELETALMESHDESCRIPTION_API FSourceGeometryPartNameConstRef GetSourceGeometryPartNames() const
Definition SkeletalMeshAttributes.cpp:640
SKELETALMESHDESCRIPTION_API TArray< FName > GetMorphTargetNames() const
Returns the list of all registered morph targets on this mesh.
Definition SkeletalMeshAttributes.cpp:495
SKELETALMESHDESCRIPTION_API bool IsSourceGeometryPartValid(const FSourceGeometryPartID InSourceGeometryPartID) const
Definition SkeletalMeshAttributes.cpp:631
SKELETALMESHDESCRIPTION_API bool HasMorphTargetPositionsAttribute(const FName InMorphTargetName) const
Definition SkeletalMeshAttributes.cpp:535
TMeshAttributesRef< FBoneID, FTransform > FBonePoseAttributesRef
Definition SkeletalMeshAttributes.h:57
TMeshElementContainer< FBoneID > FBoneArray
Definition SkeletalMeshAttributes.h:49
bool HasSourceGeometryParts() const
Definition SkeletalMeshAttributes.h:184
SKELETALMESHDESCRIPTION_API TArray< FName > GetSkinWeightProfileNames(const bool bInUserDefinedOnly=false) const
Definition SkeletalMeshAttributes.cpp:415
SKELETALMESHDESCRIPTION_API int32 GetNumSourceGeometryParts() const
Definition SkeletalMeshAttributes.cpp:626
SKELETALMESHDESCRIPTION_API FSkinWeightsVertexAttributesConstRef GetVertexSkinWeightsFromAttributeName(const FName InAttributeName=NAME_None) const
Definition SkeletalMeshAttributes.cpp:405
SKELETALMESHDESCRIPTION_API bool HasBonePoseAttribute() const
Definition SkeletalMeshAttributes.cpp:556
TMeshElementContainer< FSourceGeometryPartID > FSourceGeometryPartArray
Definition SkeletalMeshAttributes.h:63
static SKELETALMESHDESCRIPTION_API FName CreateSkinWeightAttributeName(const FName InProfileName)
Definition SkeletalMeshAttributes.cpp:473
TMeshAttributesConstRef< FSourceGeometryPartID, TArrayView< int32 > > FSourceGeometryPartVertexOffsetAndCountConstRef
Definition SkeletalMeshAttributes.h:69
SKELETALMESHDESCRIPTION_API bool HasBoneColorAttribute() const
Definition SkeletalMeshAttributes.cpp:546
SKELETALMESHDESCRIPTION_API FSourceGeometryPartVertexOffsetAndCountConstRef GetSourceGeometryPartVertexOffsetAndCounts() const
Definition SkeletalMeshAttributes.cpp:649
TMeshAttributesRef< FSourceGeometryPartID, FName > FSourceGeometryPartNameRef
Definition SkeletalMeshAttributes.h:65
SKELETALMESHDESCRIPTION_API const TAttributesSet< FBoneID > & BoneAttributes() const
Definition SkeletalMeshAttributes.cpp:571
TMeshAttributesRef< FBoneID, FName > FBoneNameAttributesRef
Definition SkeletalMeshAttributes.h:51
TMeshAttributesRef< FBoneID, int32 > FBoneParentIndexAttributesRef
Definition SkeletalMeshAttributes.h:54
bool HasBones() const
Definition SkeletalMeshAttributes.h:163
SKELETALMESHDESCRIPTION_API bool HasBoneNameAttribute() const
Definition SkeletalMeshAttributes.cpp:551
TMeshAttributesConstRef< FBoneID, int32 > FBoneParentIndexAttributesConstRef
Definition SkeletalMeshAttributes.h:55
TMeshAttributesConstRef< FBoneID, FName > FBoneNameAttributesConstRef
Definition SkeletalMeshAttributes.h:52
SKELETALMESHDESCRIPTION_API FBoneColorAttributesConstRef GetBoneColors() const
Definition SkeletalMeshAttributes.cpp:601
SKELETALMESHDESCRIPTION_API const TAttributesSet< FSourceGeometryPartID > & SourceGeometryPartAttributes() const
Definition SkeletalMeshAttributes.cpp:616
static SKELETALMESHDESCRIPTION_API bool IsMorphTargetAttribute(const FName InAttributeName)
Returns true if the given attribute name refers to a morph target attribute.
Definition SkeletalMeshAttributes.cpp:511
SKELETALMESHDESCRIPTION_API TVertexInstanceAttributesConstRef< FVector3f > GetVertexInstanceMorphNormalDelta(const FName InMorphTargetName) const
Definition SkeletalMeshAttributes.cpp:530
SKELETALMESHDESCRIPTION_API FSkinWeightsVertexAttributesConstRef GetVertexSkinWeights(const FName InProfileName=NAME_None) const
Definition SkeletalMeshAttributes.cpp:400
static SKELETALMESHDESCRIPTION_API FName GetMorphTargetNameFromAttribute(const FName InAttributeName)
Returns the name of a morph target given the attribute name. If the given attribute name is invalid,...
Definition SkeletalMeshAttributes.cpp:516
static SKELETALMESHDESCRIPTION_API FName BonesElementName
Definition SkeletalMeshAttributes.h:78
static SKELETALMESHDESCRIPTION_API FName DefaultSkinWeightProfileName
Definition SkeletalMeshAttributes.h:90
TMeshAttributesConstRef< FBoneID, FTransform > FBonePoseAttributesConstRef
Definition SkeletalMeshAttributes.h:58
const FMeshElementChannels * SourceGeometryPartElementsShared
Definition SkeletalMeshAttributes.h:211
SKELETALMESHDESCRIPTION_API bool HasBoneParentIndexAttribute() const
Definition SkeletalMeshAttributes.cpp:561
SKELETALMESHDESCRIPTION_API FBonePoseAttributesConstRef GetBonePoses() const
Definition SkeletalMeshAttributes.cpp:596
SKELETALMESHDESCRIPTION_API TVertexAttributesConstRef< FVector3f > GetVertexMorphPositionDelta(const FName InMorphTargetName) const
Definition SkeletalMeshAttributes.cpp:525
static SKELETALMESHDESCRIPTION_API FName CreateMorphTargetAttributeName(const FName InMorphTargetName)
Construct a name for a morph target attribute with the given a user-visible morph target name.
Definition SkeletalMeshAttributes.cpp:484
static SKELETALMESHDESCRIPTION_API FName GetProfileNameFromAttribute(const FName InAttributeName)
Definition SkeletalMeshAttributes.cpp:455
SKELETALMESHDESCRIPTION_API const FSourceGeometryPartArray & SourceGeometryParts() const
Definition SkeletalMeshAttributes.cpp:606
Definition SkeletalMeshAttributes.h:221
SKELETALMESHDESCRIPTION_API void UnregisterImportPointIndexAttribute()
Definition SkeletalMeshAttributes.cpp:106
SKELETALMESHDESCRIPTION_API bool RegisterSkinWeightAttribute(const FName InProfileName)
Definition SkeletalMeshAttributes.cpp:112
SKELETALMESHDESCRIPTION_API bool UnregisterMorphTargetAttribute(const FName InMorphTargetName)
Definition SkeletalMeshAttributes.cpp:222
SKELETALMESHDESCRIPTION_API bool RegisterImportPointIndexAttribute()
Definition SkeletalMeshAttributes.cpp:100
SKELETALMESHDESCRIPTION_API bool RegisterMorphTargetAttribute(const FName InMorphTargetName, const bool bIncludeNormals)
Definition SkeletalMeshAttributes.cpp:175
SKELETALMESHDESCRIPTION_API TAttributesSet< FSourceGeometryPartID > & SourceGeometryPartAttributes()
Definition SkeletalMeshAttributes.cpp:336
SKELETALMESHDESCRIPTION_API FBoneNameAttributesRef GetBoneNames()
Definition SkeletalMeshAttributes.cpp:295
SKELETALMESHDESCRIPTION_API TVertexInstanceAttributesRef< FVector3f > GetVertexInstanceMorphNormalDelta(const FName InMorphTargetName)
Definition SkeletalMeshAttributes.cpp:259
SKELETALMESHDESCRIPTION_API FSourceGeometryPartID CreateSourceGeometryPart()
Definition SkeletalMeshAttributes.cpp:346
SKELETALMESHDESCRIPTION_API void DeleteBone(const FBoneID BoneID)
Definition SkeletalMeshAttributes.cpp:290
SKELETALMESHDESCRIPTION_API FBoneColorAttributesRef GetBoneColors()
Definition SkeletalMeshAttributes.cpp:310
SKELETALMESHDESCRIPTION_API void DeleteSourceGeometryPart(FSourceGeometryPartID InSourceGeometryPartID)
Definition SkeletalMeshAttributes.cpp:356
SKELETALMESHDESCRIPTION_API FSourceGeometryPartArray & SourceGeometryParts()
Definition SkeletalMeshAttributes.cpp:326
SKELETALMESHDESCRIPTION_API FBoneID CreateBone()
Definition SkeletalMeshAttributes.cpp:280
SKELETALMESHDESCRIPTION_API FBonePoseAttributesRef GetBonePoses()
Definition SkeletalMeshAttributes.cpp:305
SKELETALMESHDESCRIPTION_API FSourceGeometryPartNameRef GetSourceGeometryPartNames()
Definition SkeletalMeshAttributes.cpp:364
SKELETALMESHDESCRIPTION_API FSkinWeightsVertexAttributesRef GetVertexSkinWeights(const FName InProfileName=NAME_None)
Returns the skin weight profile given by its name. NAME_None corresponds to the default profile.
Definition SkeletalMeshAttributes.cpp:156
SKELETALMESHDESCRIPTION_API TAttributesSet< FBoneID > & BoneAttributes()
Definition SkeletalMeshAttributes.cpp:270
SKELETALMESHDESCRIPTION_API void ReserveNewBones(const int InNumBones)
Definition SkeletalMeshAttributes.cpp:275
SKELETALMESHDESCRIPTION_API TVertexAttributesRef< FVector3f > GetVertexMorphPositionDelta(const FName InMorphTargetName)
Definition SkeletalMeshAttributes.cpp:253
SKELETALMESHDESCRIPTION_API FSkinWeightsVertexAttributesRef GetVertexSkinWeightsFromAttributeName(const FName InAttributeName=NAME_None)
Definition SkeletalMeshAttributes.cpp:162
SKELETALMESHDESCRIPTION_API void RegisterColorAttribute()
Definition SkeletalMeshAttributes.cpp:93
SKELETALMESHDESCRIPTION_API void RegisterSourceGeometryPartsAttributes()
Definition SkeletalMeshAttributes.cpp:315
SKELETALMESHDESCRIPTION_API FBoneArray & Bones()
Definition SkeletalMeshAttributes.cpp:265
static bool IsReservedAttributeName(const FName InAttributeName)
Definition SkeletalMeshAttributes.h:231
SKELETALMESHDESCRIPTION_API FBoneParentIndexAttributesRef GetBoneParentIndices()
Definition SkeletalMeshAttributes.cpp:300
SKELETALMESHDESCRIPTION_API bool UnregisterSkinWeightAttribute(const FName InProfileName)
Definition SkeletalMeshAttributes.cpp:133
SKELETALMESHDESCRIPTION_API FSourceGeometryPartVertexOffsetAndCountRef GetSourceGeometryPartVertexOffsetAndCounts()
Definition SkeletalMeshAttributes.cpp:373
Definition SkeletalMeshAttributes.h:365
FSkeletalMeshConstAttributes(const FMeshDescription &InMeshDescription)
Definition SkeletalMeshAttributes.h:368
Definition SkinWeightsAttributesRef.h:225
Definition SkinWeightsAttributesRef.h:159
Definition StaticMeshAttributes.h:54
static bool IsReservedAttributeName(const FName InAttributeName)
Definition StaticMeshAttributes.h:63
Definition StaticMeshAttributes.h:125
Definition AttributeArrayContainer.h:393
Definition Array.h:670
Definition MeshAttributeArray.h:1873
Definition MeshAttributeArray.h:836
Definition MeshElementContainer.h:246
const FName Name("Name")
Definition SkeletalMeshAttributes.h:32
const FName Color("Color")
Definition SkeletalMeshAttributes.h:35
const FName Pose("Pose")
Definition SkeletalMeshAttributes.h:34
const FName ParentIndex("ParentIndex")
Definition SkeletalMeshAttributes.h:33
const FName VertexOffsetAndCount("VertexOffsetAndCount")
Definition SkeletalMeshAttributes.h:41
const FName Name("Name")
Definition SkeletalMeshAttributes.h:40
const FName SkinWeights("SkinWeights")
Definition SkeletalMeshAttributes.h:25
const FName ImportPointIndex("ImportPointIndex")
Definition SkeletalMeshAttributes.h:27
Definition MeshAttributes.cpp:6
Definition SkeletalMeshElementTypes.h:11
Definition MeshDescription.h:94
Definition SkeletalMeshElementTypes.h:36