UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DynamicVertexSkinWeightsAttribute.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7
8#include "BoneWeights.h"
9#include "HAL/UnrealMemory.h"
10#include "Misc/MemStack.h"
11
12namespace UE
13{
14namespace Geometry
15{
16
17template<typename ParentType>
19 public TDynamicAttributeChangeBase<ParentType>
20{
21 struct FChangeVertexBoneWeights
22 {
24 int VertexID;
25 };
26
27 TArray<FChangeVertexBoneWeights> OldVertexBoneWeights, NewVertexBoneWeights;
28
29public:
31
32 virtual ~TDynamicVertexSkinWeightsAttributeChange() override = default;
33
34 void SaveInitialVertex(const TDynamicAttributeBase<ParentType>* Attribute, int VertexID) override;
35
36 void StoreAllFinalVertices(const TDynamicAttributeBase<ParentType>* Attribute, const TSet<int>& VertexIDs) override;
37
38 bool Apply(TDynamicAttributeBase<ParentType>* Attribute, bool bRevert) const override;
39};
40
41
45template<typename ParentType>
47 public TDynamicAttributeBase<ParentType>
48{
49public:
52
53protected:
55
57 ParentType* Parent = nullptr;
58
60 // FIXME: Replace with a local slab allocator storage to avoid per-item TInlineAllocator
62
63public:
64
67
71 {
72 if (bAutoInit)
73 {
74 Initialize();
75 }
76 }
77
79
81 const ParentType* GetParent() const { return Parent; }
83 ParentType* GetParent() { return Parent; }
84private:
85 void Reparent(ParentType* NewParent) override { Parent = NewParent; }
86public:
99
106
114
116 {
117 for (int32 VID = 0, NumVID = CompactMaps.NumVertexMappings(); VID < NumVID; VID++)
118 {
119 const int32 ToVID = CompactMaps.GetVertexMapping(VID);
121 {
122 continue;
123 }
124 if (ensure(ToVID <= VID))
125 {
126 CopyValue(VID, ToVID);
127 }
128 }
129 VertexBoneWeights.Resize(Parent->MaxVertexID());
130 }
131
133 {
135 check(CompactMaps.NumVertexMappings() >= VertexBoneWeights.Num());
136 FBoneWeights Data;
137 for (int32 VID = 0, NumVID = CompactMaps.NumVertexMappings(); VID < NumVID; VID++)
138 {
139 const int32 ToVID = CompactMaps.GetVertexMapping(VID);
141 {
142 continue;
143 }
144 ToCopy.GetValue(VID, Data);
145 SetValue(ToVID, Data);
146 }
147 }
148
150 void Initialize(const FBoneWeights InitialValue = {})
151 {
152 check(Parent != nullptr);
153 VertexBoneWeights.Resize(Parent->MaxVertexID());
154 VertexBoneWeights.Fill(InitialValue);
155 }
156
161
162
182 {
183 if (VertexBoneWeights.Num() == 0)
184 {
185 return true; // empty weights, nothing to do
186 }
187
189 {
190 return true; // skeletons are the same, nothing to do
191 }
192
193 // Create a map from bone name to bone index for the ToRefSkeleton so we can
194 // check if bone with a given name in FromRefSkeleton exists in ToRefSkeleton
195 // and at what index
197 NameToIndex.Reserve(ToRefSkeleton.Num());
198 for (int BoneID = 0; BoneID < ToRefSkeleton.Num(); ++BoneID)
199 {
200 const FName& BoneName = ToRefSkeleton[BoneID];
201 if (NameToIndex.Contains(BoneName))
202 {
203 return false; // there should be no duplicates in ToRefSkeleton
204 }
205 NameToIndex.Add(BoneName, BoneID);
206 }
207
208 // Store temporary results of reindexing in a new dynamic vector
209 TDynamicVector<FBoneWeights> NewVertexBoneWeights;
210 NewVertexBoneWeights.Resize(VertexBoneWeights.Num());
211
212 // Since we are only changing indicies, make sure we don't do any re-normalization on the weights
215
216 // Iterate over every skin weight of every vertex and remap it's bone index from FromRefSkeleton to ToRefSkeleton
217 for (int VertexID = 0; VertexID < VertexBoneWeights.Num(); ++VertexID)
218 {
219 FBoneWeights BoneWeights = VertexBoneWeights[VertexID];
220 if (BoneWeights.Num() == 0)
221 {
222 continue; // vertex has no weights
223 }
224
226 for (int32 Idx = 0; Idx < BoneWeights.Num(); ++Idx)
227 {
228 const FBoneWeight& BoneWeight = BoneWeights[Idx];
229 if (BoneWeight.GetBoneIndex() >= FromRefSkeleton.Num())
230 {
231 return false; // invalid FromRefSkeleton
232 }
233
234 const FName& FromName = FromRefSkeleton[BoneWeight.GetBoneIndex()];
235 const uint16 FromWeight = BoneWeight.GetRawWeight();
236
237 const int32* ToIdx = NameToIndex.Find(FromName);
238 if (ToIdx)
239 {
240 NewWeights.SetBoneWeight(FBoneWeight(static_cast<FBoneIndexType>(*ToIdx), FromWeight), BoneSettings);
241 NewVertexBoneWeights[VertexID] = NewWeights;
242 }
243 else
244 {
245 return false; // ToRefSkeleton must be a superset of all the bones referenced in FromRefSkeleton by the skinning weights
246 }
247 }
248 }
249
250 VertexBoneWeights = MoveTemp(NewVertexBoneWeights);
251
252 return true;
253 }
254
255 //
256 // Accessors/Queries
257 //
258
263 {
264 if (VertexBoneWeights.Num() == 0)
265 {
266 return {}; // No weights defined, return the empty set.
267 }
268
270 for (int VertexID = 0; VertexID < VertexBoneWeights.Num(); ++VertexID)
271 {
272 for (FBoneWeight BoneWeight: VertexBoneWeights[VertexID])
273 {
274 UniqueBoneIndices.Add(BoneWeight.GetBoneIndex());
275 }
276 }
277 return UniqueBoneIndices;
278 }
279
281 {
282 // Don't snarf the FBoneWeight as a concrete object, since it _may_ contain a pointer
283 // and we don't want it to destruct.
284 constexpr int32 BufferSize = sizeof(FBoneWeights);
285 int8 BufferData[BufferSize];
286 for (const TPair<int32, int32>& MapVID : Mapping.GetVertexMap().GetForwardMap())
287 {
288 if (!ensure(Source->CopyOut(MapVID.Key, &BufferData, BufferSize)))
289 {
290 return false;
291 }
292 SetValue(MapVID.Value, *reinterpret_cast<FBoneWeights *>(BufferData));
293 }
294 return true;
295 }
296
298 {
299 // Don't snarf the FBoneWeight as a concrete object, since it _may_ contain a pointer
300 // and we don't want it to destruct.
301 constexpr int32 BufferSize = sizeof(FBoneWeights);
302 int8 BufferData[BufferSize];
303
304 int32 NewMaxID = Info.NumVertex + Info.VertexOffset;
305 if (NewMaxID > VertexBoneWeights.Num())
306 {
308 }
309 for (int32 Idx = 0; Idx < Info.NumVertex; ++Idx)
310 {
311 if (!ensure(Source.CopyOut(Idx, BufferData, BufferSize)))
312 {
313 return false;
314 }
315 SetValue(Idx + Info.VertexOffset, *reinterpret_cast<FBoneWeights*>(BufferData));
316 }
317 return true;
318 }
319
321 {
322 int32 NewMaxID = Info.NumVertex + Info.VertexOffset;
323 VertexBoneWeights.SetMinimumSize(NewMaxID, FBoneWeights{});
324 }
325
326 bool CopyOut(int RawID, void* Buffer, int BufferSize) const override
327 {
328 if (sizeof(FBoneWeights) != BufferSize)
329 {
330 return false;
331 }
332
333 // Avoid the copy constructor.
335 return true;
336 }
337 bool CopyIn(int RawID, void* Buffer, int BufferSize) override
338 {
339 if (sizeof(FBoneWeights) != BufferSize)
340 {
341 return false;
342 }
343
344 // Ensure the copy constructor is called.
345 VertexBoneWeights[RawID] = *static_cast<FBoneWeights*>(Buffer);
346 return true;
347 }
348
350 void GetValue(int VertexID, FBoneWeights& Data) const
351 {
352 Data = VertexBoneWeights[VertexID];
353 }
354
356 template<typename AsType>
357 void GetValue(int VertexID, AsType& Data) const
358 {
359 Data = VertexBoneWeights[VertexID];
360 }
361
366 template<typename BoneIndexType, typename BoneFloatWeightType>
368 {
369 FBoneWeights BoneWeights;
370 GetValue(VertexID, BoneWeights);
371
372 const int32 NumEntries = BoneWeights.Num();
373
374 OutBones.SetNum(NumEntries, EAllowShrinking::No);
375 OutWeights.SetNum(NumEntries, EAllowShrinking::No);
376
377 for (int32 BoneIdx = 0; BoneIdx < NumEntries; ++BoneIdx)
378 {
379 OutBones[BoneIdx] = static_cast<BoneIndexType>(BoneWeights[BoneIdx].GetBoneIndex());
380 OutWeights[BoneIdx] = static_cast<BoneFloatWeightType>(BoneWeights[BoneIdx].GetWeight());
381 }
382 }
383
385 void SetValue(int VertexID, const FBoneWeights& Data)
386 {
387 VertexBoneWeights[VertexID] = Data;
388 }
389
391 template<typename ContainerAdapter>
393 {
394 VertexBoneWeights[VertexID] = FBoneWeights::Create(Data);
395 }
396
398 template<typename BoneIndexType, typename BoneFloatWeightType>
400 {
402
405
408
409 for (int32 Idx = 0; Idx < InNumEntries; ++Idx)
410 {
411 Bones[Idx] = static_cast<FBoneIndexType>(InBones[Idx]);
412 Weights[Idx] = static_cast<float>(InWeights[Idx]);
413 }
414
415 VertexBoneWeights[VertexID] = FBoneWeights::Create(Bones.GetData(), Weights.GetData(), InNumEntries);
416 }
417
425
426
427public:
428
431 {
433 SetBoneWeightsFromLerp(SplitInfo.NewVertex, SplitInfo.OriginalVertices.A, SplitInfo.OriginalVertices.B, SplitInfo.SplitT);
434 }
435
438 {
439 // vertices unchanged
440 }
441
444 {
445 SetBoneWeightsFromLerp(CollapseInfo.KeptVertex, CollapseInfo.KeptVertex, CollapseInfo.RemovedVertex, CollapseInfo.CollapseT);
446 }
447
448 void ResizeAttribStoreIfNeeded(int VertexID)
449 {
450 if (!ensure(VertexID >= 0))
451 {
452 return;
453 }
454 size_t NeededSize = (size_t(VertexID)+1);
455 if (NeededSize > VertexBoneWeights.Num())
456 {
458 }
459 }
460
461 void OnNewVertex(int VertexID, bool bInserted) override
462 {
464 }
465
468 {
469 FIndex3i Tri = PokeInfo.TriVertices;
471 SetBoneWeightsFromBary(PokeInfo.NewVertex, Tri.A, Tri.B, Tri.C, PokeInfo.BaryCoords);
472 }
473
476 {
477 // just blend the attributes?
478 if (MergeInfo.RemovedVerts.A != FDynamicMesh3::InvalidID)
479 {
480 SetBoneWeightsFromLerp(MergeInfo.KeptVerts.A, MergeInfo.KeptVerts.A, MergeInfo.RemovedVerts.A, MergeInfo.InterpolationT);
481 }
482 if (MergeInfo.RemovedVerts.B != FDynamicMesh3::InvalidID)
483 {
484 SetBoneWeightsFromLerp(MergeInfo.KeptVerts.B, MergeInfo.KeptVerts.B, MergeInfo.RemovedVerts.B, MergeInfo.InterpolationT);
485 }
486 }
487
490 {
491 SetBoneWeightsFromLerp(MergeInfo.KeptVertex, MergeInfo.KeptVertex, MergeInfo.RemovedVertex, MergeInfo.InterpolationT);
492 }
493
496 {
497 CopyValue(SplitInfo.OriginalVertex, SplitInfo.NewVertex);
498 }
499
504
512 {
513 // just check that the values buffer is big enough
514 if (Parent->MaxVertexID() > VertexBoneWeights.Num())
515 {
516 switch (FailMode)
517 {
519 check(false);
521 ensure(false);
522 default:
523 return false;
524 }
525 }
526
527 return true;
528 }
529
530 void Serialize(FArchive& Ar, const FCompactMaps* CompactMaps, bool bUseCompression)
531 {
533
534 Ar << bUseCompression;
535
536 const bool bUseVertexCompactMap = CompactMaps && CompactMaps->VertexMapIsSet();
537
538 if (!bUseCompression)
539 {
540 if (Ar.IsLoading() || !bUseVertexCompactMap)
541 {
542 VertexBoneWeights.Serialize<false, false>(Ar);
543 }
544 else
545 {
547 VertexBoneWeightsCompact.Resize(Parent->VertexCount());
548
549 for (int32 Vid = 0, Num = VertexBoneWeights.Num(); Vid < Num; ++Vid)
550 {
551 const int32 VidCompact = CompactMaps->GetVertexMapping(Vid);
553 {
555 }
556 }
557
558 VertexBoneWeightsCompact.Serialize<false, false>(Ar);
559 }
560 }
561 else
562 {
563 // To achieve better compression performance both w.r.t. size and speed, we copy everything into one big flat buffer.
564 // We take advantage of the fact that we can effectively store everything as int32 for both the vector/array sizes as well as the bone weights.
566
567 if (Ar.IsLoading())
568 {
569 // Serialize size of decompressed buffer to be able to hold all the compressed data in the archive, and allocate accordingly.
570 int32 BufferSize;
571 Ar << BufferSize;
572 Buffer.SetNumUninitialized(BufferSize);
573
574 // Decompress buffer from archive.
575 Ar.SerializeCompressedNew(Buffer.GetData(), Buffer.Num() * sizeof(int32), NAME_Oodle, NAME_Oodle, COMPRESS_NoFlags, false, nullptr);
576
577 // Restore bone weights arrays from decompressed buffer.
578 int32* BufferPtr = Buffer.GetData();
579 VertexBoneWeights.Resize(*BufferPtr++);
582 for (FBoneWeights& BoneWeights : VertexBoneWeights)
583 {
584 const int32 Num = *BufferPtr++;
585 for (int32 i = 0; i < Num; ++i)
586 {
587 BoneWeights.SetBoneWeight(reinterpret_cast<AnimationCore::FBoneWeight&>(*BufferPtr++), BoneWeightsSettings);
588 }
589 }
590 checkSlow(BufferPtr == Buffer.GetData() + Buffer.Num());
591 }
592 else
593 {
594 // Determine total number of individual bone weights.
595
596 auto CountBoneWeights = [](const FBoneWeights& BoneWeights, SIZE_T& NumBoneWeights)
597 {
598 NumBoneWeights += BoneWeights.Num();
599 };
600
601 SIZE_T NumBoneWeights = 0;
603 {
604 for (const FBoneWeights& BoneWeights : VertexBoneWeights)
605 {
606 CountBoneWeights(BoneWeights, NumBoneWeights);
607 }
608 }
609 else
610 {
611 for (int32 Vid = 0, Num = VertexBoneWeights.Num(); Vid < Num; ++Vid)
612 {
613 const int32 VidCompact = CompactMaps->GetVertexMapping(Vid);
615 {
616 CountBoneWeights(VertexBoneWeights[Vid], NumBoneWeights);
617 }
618 }
619 }
620
621 // Set buffer size to hold number of vertex bone weight arrays, size for vertex each bone weight array, and all individual bone weights.
622 // We also serialize out size of uncompressed buffer to allow for allocation to correct size during loading.
624 uint32 BufferSize = 1 + NumVertexBoneWeightArrays + IntCastChecked<uint32>(NumBoneWeights);
625 Buffer.SetNumUninitialized(BufferSize);
626 Ar << BufferSize;
627
628 // Write everything into the buffer.
629
630 auto WriteBoneWeights = [](const FBoneWeights& BoneWeights, int32*& BufferPtr)
631 {
632 const int32 Num = BoneWeights.Num();
633 *BufferPtr++ = Num;
634 if (Num > 0)
635 {
636 FMemory::Memcpy(BufferPtr, &BoneWeights[0], Num * sizeof(int32));
637 BufferPtr += Num;
638 }
639 };
640
641 int32* BufferPtr = Buffer.GetData();
642 *BufferPtr++ = NumVertexBoneWeightArrays;
644 {
645 for (const FBoneWeights& BoneWeights : VertexBoneWeights)
646 {
647 WriteBoneWeights(BoneWeights, BufferPtr);
648 }
649 }
650 else
651 {
652 for (int32 Vid = 0, Num = VertexBoneWeights.Num(); Vid < Num; ++Vid)
653 {
654 const int32 VidCompact = CompactMaps->GetVertexMapping(Vid);
656 {
658 }
659 }
660 }
661 checkSlow(BufferPtr == Buffer.GetData() + Buffer.Num());
662
663 // Compress buffer to archive.
664 Ar.SerializeCompressedNew(Buffer.GetData(), Buffer.Num() * sizeof(int32), NAME_Oodle, NAME_Oodle, COMPRESS_NoFlags, false, nullptr);
665 }
666 }
667 }
668
669 virtual SIZE_T GetByteCount() const override
670 {
671 return VertexBoneWeights.GetByteCount();
672 }
673
674protected:
675
676 // interpolation functions; default implementation assumes your attributes can be interpolated as reals
677
679 void SetBoneWeightsFromLerp(int SetAttribute, int AttributeA, int AttributeB, double Alpha)
680 {
681 Alpha = FMath::Clamp(Alpha, 0.0, 1.0);
683 }
684
689 void SetBoneWeightsFromBary(int SetAttribute, int AttributeA, int AttributeB, int AttributeC, const FVector3d& BaryCoords)
690 {
691 const float BaryX = static_cast<float>(BaryCoords.X);
692 const float BaryY = static_cast<float>(BaryCoords.Y);
693 const float BaryZ = static_cast<float>(BaryCoords.Z);
694
695 if (FMath::IsNearlyEqual(BaryX, 1.0f))
696 {
697 if (SetAttribute != AttributeA) // avoid unnecessary copy
698 {
700 }
701 }
702 else if (FMath::IsNearlyEqual(BaryY, 1.0f))
703 {
704 if (SetAttribute != AttributeB)
705 {
707 }
708 }
709 else if (FMath::IsNearlyEqual(BaryZ, 1.0f))
710 {
711 if (SetAttribute != AttributeC)
712 {
714 }
715 }
716 else
717 {
721 BaryX,
722 BaryY,
723 BaryZ);
724 }
725 }
726};
727
728
729class FDynamicMesh3;
731
732
733template<typename ParentType>
735{
736 FChangeVertexBoneWeights& Change = OldVertexBoneWeights.Emplace_GetRef();
737 Change.VertexID = VertexID;
739 AttribCast->GetValue(VertexID, Change.Weights);
740}
741
742template<typename ParentType>
744{
745 NewVertexBoneWeights.Reserve(NewVertexBoneWeights.Num() + VertexIDs.Num());
747 for (int VertexID : VertexIDs)
748 {
749 FChangeVertexBoneWeights& Change = NewVertexBoneWeights.Emplace_GetRef();
750 Change.VertexID = VertexID;
751 AttribCast->GetValue(VertexID, Change.Weights);
752 }
753}
754
755template<typename ParentType>
757{
758 const TArray<FChangeVertexBoneWeights> *Changes = bRevert ? &OldVertexBoneWeights : &NewVertexBoneWeights;
760 for (const FChangeVertexBoneWeights& Change : *Changes)
761 {
762 check(AttribCast->GetParent()->IsVertex(Change.VertexID));
763 AttribCast->SetValue(Change.VertexID, Change.Weights);
764 }
765 return true;
766}
767
768}
769}
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
#define ensure( InExpression)
Definition AssertionMacros.h:464
uint16 FBoneIndexType
Definition BoneIndices.h:7
@ COMPRESS_NoFlags
Definition CompressionFlags.h:28
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
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
@ Num
Definition MetalRHIPrivate.h:234
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint16_t uint16
Definition binka_ue_file_header.h:7
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
CORE_API void SerializeCompressedNew(void *V, int64 Length, FName CompressionFormatToEncode, FName CompressionFormatToDecodeOldV1Files, ECompressionFlags Flags=COMPRESS_NoFlags, bool bTreatBufferAsFileReader=false, int64 *OutPartialReadLength=nullptr)
Definition Archive.cpp:740
Definition NameTypes.h:617
Definition ArrayView.h:139
Definition Array.h:670
UE_NODEBUG UE_FORCEINLINE_HINT ElementType * GetData() UE_LIFETIMEBOUND
Definition Array.h:1027
void SetNumUninitialized(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2369
Definition UnrealString.h.inl:34
Definition UniquePtr.h:107
Definition BoneWeights.h:48
uint16 GetRawWeight() const
Definition BoneWeights.h:160
FBoneIndexType GetBoneIndex() const
Definition BoneWeights.h:125
Definition BoneWeights.h:229
FBoneWeightsSettings & SetNormalizeType(EBoneWeightNormalizeType InNormalizeType)
Definition BoneWeights.h:234
A simple container for per-vertex influence of bones and their weights.
Definition BoneWeights.h:526
static FBoneWeights Create(const FBoneIndexType InBones[MaxInlineBoneWeightCount], const uint16 InWeights[MaxInlineBoneWeightCount], const FBoneWeightsSettings &InSettings={})
Definition BoneWeights.h:1320
int32 Num() const
Definition BoneWeights.h:695
static FBoneWeights Blend(const FBoneWeights &InA, const FBoneWeights &InB, float InBias, const FBoneWeightsSettings &InSettings={})
Definition BoneWeights.h:1358
Definition BoneWeights.h:390
Definition CompactMaps.h:20
static constexpr int32 InvalidID
Definition CompactMaps.h:25
static constexpr int InvalidID
Definition DynamicMesh3.h:158
Definition DynamicMeshAttributeSet.h:84
Definition DynamicAttribute.h:67
virtual void CopyParentClassData(const TDynamicAttributeBase< ParentType > &Other)
Definition DynamicAttribute.h:249
Definition DynamicAttribute.h:24
Definition DynamicVector.h:27
void Resize(unsigned int Count)
Definition DynamicVector.h:603
Definition DynamicVertexSkinWeightsAttribute.h:20
void SaveInitialVertex(const TDynamicAttributeBase< ParentType > *Attribute, int VertexID) override
Definition DynamicVertexSkinWeightsAttribute.h:734
bool Apply(TDynamicAttributeBase< ParentType > *Attribute, bool bRevert) const override
Definition DynamicVertexSkinWeightsAttribute.h:756
virtual ~TDynamicVertexSkinWeightsAttributeChange() override=default
void StoreAllFinalVertices(const TDynamicAttributeBase< ParentType > *Attribute, const TSet< int > &VertexIDs) override
Definition DynamicVertexSkinWeightsAttribute.h:743
Definition DynamicVertexSkinWeightsAttribute.h:48
UE::AnimationCore::FBoneWeight FBoneWeight
Definition DynamicVertexSkinWeightsAttribute.h:51
void OnFlipEdge(const FDynamicMesh3::FEdgeFlipInfo &FlipInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:437
TDynamicVertexSkinWeightsAttribute(ParentType *ParentIn, bool bAutoInit=true)
Definition DynamicVertexSkinWeightsAttribute.h:69
void SetBoneWeightsFromLerp(int SetAttribute, int AttributeA, int AttributeB, double Alpha)
Definition DynamicVertexSkinWeightsAttribute.h:679
void CompactCopy(const FCompactMaps &CompactMaps, const TDynamicVertexSkinWeightsAttribute< ParentType > &ToCopy)
Definition DynamicVertexSkinWeightsAttribute.h:132
void SetBoneWeightsFromBary(int SetAttribute, int AttributeA, int AttributeB, int AttributeC, const FVector3d &BaryCoords)
Definition DynamicVertexSkinWeightsAttribute.h:689
void Serialize(FArchive &Ar, const FCompactMaps *CompactMaps, bool bUseCompression)
Definition DynamicVertexSkinWeightsAttribute.h:530
void OnSplitVertex(const FDynamicMesh3::FVertexSplitInfo &SplitInfo, const TArrayView< const int > &TrianglesToUpdate) override
Definition DynamicVertexSkinWeightsAttribute.h:495
void Initialize(const FBoneWeights InitialValue={})
Definition DynamicVertexSkinWeightsAttribute.h:150
void Copy(const TDynamicVertexSkinWeightsAttribute< ParentType > &Copy)
Definition DynamicVertexSkinWeightsAttribute.h:101
bool ReindexBoneIndicesToSkeleton(const TArray< FName > &FromRefSkeleton, const TArray< FName > &ToRefSkeleton)
Definition DynamicVertexSkinWeightsAttribute.h:181
void OnSplitEdge(const FDynamicMesh3::FEdgeSplitInfo &SplitInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:430
UE::AnimationCore::FBoneWeights FBoneWeights
Definition DynamicVertexSkinWeightsAttribute.h:50
void OnMergeEdges(const FDynamicMesh3::FMergeEdgesInfo &MergeInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:475
TDynamicAttributeBase< ParentType > * MakeCopy(ParentType *ParentIn) const override
Definition DynamicVertexSkinWeightsAttribute.h:93
ParentType * GetParent()
Definition DynamicVertexSkinWeightsAttribute.h:83
ParentType * Parent
Definition DynamicVertexSkinWeightsAttribute.h:57
TDynamicVector< FBoneWeights > VertexBoneWeights
Definition DynamicVertexSkinWeightsAttribute.h:61
void SetValue(int VertexID, const FBoneWeights &Data)
Definition DynamicVertexSkinWeightsAttribute.h:385
void GetValue(int VertexID, FBoneWeights &Data) const
Definition DynamicVertexSkinWeightsAttribute.h:350
void OnCollapseEdge(const FDynamicMesh3::FEdgeCollapseInfo &CollapseInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:443
TDynamicAttributeBase< ParentType > * MakeCompactCopy(const FCompactMaps &CompactMaps, ParentType *ParentTypeIn) const override
Definition DynamicVertexSkinWeightsAttribute.h:107
bool CopyThroughMapping(const TDynamicAttributeBase< ParentType > *Source, const FMeshIndexMappings &Mapping) override
Definition DynamicVertexSkinWeightsAttribute.h:280
void SetValue(int VertexID, const UE::AnimationCore::TBoneWeights< ContainerAdapter > &Data)
Definition DynamicVertexSkinWeightsAttribute.h:392
void SetValue(int VertexID, const TArray< BoneIndexType > &InBones, const TArray< BoneFloatWeightType > &InWeights, int32 InNumEntries)
Definition DynamicVertexSkinWeightsAttribute.h:399
TDynamicAttributeBase< ParentType > * MakeNew(ParentType *ParentIn) const override
Definition DynamicVertexSkinWeightsAttribute.h:87
void SetNewValue(int32 InNewVertexID, const FBoneWeights InBoneWeights)
Definition DynamicVertexSkinWeightsAttribute.h:157
TSet< int32 > GetBoundBoneIndices() const
Definition DynamicVertexSkinWeightsAttribute.h:262
void OnMergeVertices(const FDynamicMesh3::FMergeVerticesInfo &MergeInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:489
void ResizeAttribStoreIfNeeded(int VertexID)
Definition DynamicVertexSkinWeightsAttribute.h:448
void OnPokeTriangle(const FDynamicMesh3::FPokeTriangleInfo &PokeInfo) override
Definition DynamicVertexSkinWeightsAttribute.h:467
void GetValue(int VertexID, AsType &Data) const
Definition DynamicVertexSkinWeightsAttribute.h:357
void OnNewVertex(int VertexID, bool bInserted) override
Definition DynamicVertexSkinWeightsAttribute.h:461
bool CopyIn(int RawID, void *Buffer, int BufferSize) override
Definition DynamicVertexSkinWeightsAttribute.h:337
bool CopyOut(int RawID, void *Buffer, int BufferSize) const override
Definition DynamicVertexSkinWeightsAttribute.h:326
virtual SIZE_T GetByteCount() const override
Definition DynamicVertexSkinWeightsAttribute.h:669
const ParentType * GetParent() const
Definition DynamicVertexSkinWeightsAttribute.h:81
virtual void AppendDefaulted(const UE::Geometry::FDynamicMesh3::FAppendInfo &Info) override
Definition DynamicVertexSkinWeightsAttribute.h:320
bool CheckValidity(bool bAllowNonmanifold, EValidityCheckFailMode FailMode) const override
Definition DynamicVertexSkinWeightsAttribute.h:511
virtual bool Append(const TDynamicAttributeBase< ParentType > &Source, const UE::Geometry::FDynamicMesh3::FAppendInfo &Info) override
Definition DynamicVertexSkinWeightsAttribute.h:297
void GetValue(int VertexID, TArray< BoneIndexType > &OutBones, TArray< BoneFloatWeightType > &OutWeights) const
Definition DynamicVertexSkinWeightsAttribute.h:367
void CompactInPlace(const FCompactMaps &CompactMaps) override
Definition DynamicVertexSkinWeightsAttribute.h:115
TUniquePtr< TDynamicAttributeChangeBase< ParentType > > NewBlankChange() const override
Definition DynamicVertexSkinWeightsAttribute.h:500
void CopyValue(int FromVertexID, int ToVertexID)
Definition DynamicVertexSkinWeightsAttribute.h:421
TDynamicVertexSkinWeightsAttribute< FDynamicMesh3 > FDynamicMeshVertexSkinWeightsAttribute
Definition DynamicMeshAttributeSet.h:62
EValidityCheckFailMode
Definition GeometryTypes.h:72
Definition AdvancedWidgetsModule.cpp:13
Definition InfoTypes.h:181
Definition InfoTypes.h:171
Definition InfoTypes.h:155
Definition InfoTypes.h:197
Definition InfoTypes.h:216
Definition InfoTypes.h:229
Definition InfoTypes.h:242
static UE_FORCEINLINE_HINT bool IsNearlyEqual(float A, float B, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:388
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
static UE_FORCEINLINE_HINT void * Memcpy(void *Dest, const void *Src, SIZE_T Count)
Definition UnrealMemory.h:160
CORE_API static const FGuid GUID
Definition UE5MainStreamObjectVersion.h:22
Definition Tuple.h:652
Definition DynamicMesh3.h:309
Definition IndexTypes.h:158
int B
Definition IndexTypes.h:164
int A
Definition IndexTypes.h:163
int C
Definition IndexTypes.h:165
Definition MeshIndexMappings.h:22
FIndexMapi & GetVertexMap()
Definition MeshIndexMappings.h:60
TMap< IntType, IntType > & GetForwardMap()
Definition GeometryTypes.h:119
T Z
Definition Vector.h:68
T Y
Definition Vector.h:65
T X
Definition Vector.h:62