UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieScenePartialProperties.inl
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
8
9namespace UE
10{
11namespace MovieScene
12{
13
14
15template<typename PropertyTraits, typename ...MetaDataTypes, int ...CompositeIndices, typename ...CompositeTypes>
16void TSetPartialPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, TIntegerSequence<int, CompositeIndices...>, CompositeTypes...>::ForEachAllocation(
17 const FEntityAllocation* Allocation,
22{
23 // ----------------------------------------------------------------------------------------------------------------------------
24 // For partially animated composites, we first retrieve the current properties for the allocation, then go through and patch in
25 // All the animated values, then apply the properties to objects
26
27 const int32 Num = Allocation->Num();
28
30 {
31 ForEachCustom(Allocation, BoundObjectComponents.AsPtr(), Custom, InMetaData.AsPtr()..., InCompositeComponents.AsPtr()...);
32 }
33 else if (const uint16* Fast = PropertyBindingComponents.template Get<1>())
34 {
35 ForEachFast(Allocation, BoundObjectComponents.AsPtr(), Fast, InMetaData.AsPtr()..., InCompositeComponents.AsPtr()...);
36 }
38 {
39 ForEachSlow(Allocation, BoundObjectComponents.AsPtr(), Slow, InMetaData.AsPtr()..., InCompositeComponents.AsPtr()...);
40 }
41}
42
43
44template<typename PropertyTraits, typename ...MetaDataTypes, int ...CompositeIndices, typename ...CompositeTypes>
45void TSetPartialPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, TIntegerSequence<int, CompositeIndices...>, CompositeTypes...>::ForEachAllocation(
46 const FEntityAllocation* Allocation,
51{
52 // ----------------------------------------------------------------------------------------------------------------------------
53 // For partially animated composites, we first retrieve the current properties for the allocation, then go through and patch in
54 // All the animated values, then apply the properties to objects
55
56 const int32 Num = Allocation->Num();
57 if (const uint16* Fast = PropertyBindingComponents.template Get<0>())
58 {
59 ForEachFast(Allocation, BoundObjectComponents.AsPtr(), Fast, InMetaData.AsPtr()..., InCompositeComponents.AsPtr()...);
60 }
62 {
63 ForEachSlow(Allocation, BoundObjectComponents.AsPtr(), Slow, InMetaData.AsPtr()..., InCompositeComponents.AsPtr()...);
64 }
65}
66
67
68template<typename PropertyTraits, typename ...MetaDataTypes, int ...CompositeIndices, typename ...CompositeTypes>
69void TSetPartialPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, TIntegerSequence<int, CompositeIndices...>, CompositeTypes...>::ForEachCustom(
70 const FEntityAllocation* Allocation,
71 UObject* const* Objects,
73 const MetaDataTypes*... InMetaData,
75{
76 const int32 Num = Allocation->Num();
77
78 for (int32 Index = 0; Index < Num; ++Index)
79 {
80 const FCustomPropertyIndex PropertyIndex = Custom[Index];
81
82 StorageType Storage{};
83 Traits->GetObjectPropertyValue(Objects[Index], InMetaData[Index]..., CustomAccessors[PropertyIndex.Value], Storage);
84
85 PatchCompositeValue(CompositeDefinitions, &Storage, InCompositeComponents ? &InCompositeComponents[Index] : nullptr...);
86
87 Traits->SetObjectPropertyValue(Objects[Index], InMetaData[Index]..., CustomAccessors[PropertyIndex.Value], Storage);
88 }
89}
90
91
92template<typename PropertyTraits, typename ...MetaDataTypes, int ...CompositeIndices, typename ...CompositeTypes>
93void TSetPartialPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, TIntegerSequence<int, CompositeIndices...>, CompositeTypes...>::ForEachFast(
94 const FEntityAllocation* Allocation,
95 UObject* const* Objects,
96 const uint16* Fast,
97 const MetaDataTypes*... InMetaData,
99{
100 const int32 Num = Allocation->Num();
101
102 for (int32 Index = 0; Index < Num; ++Index)
103 {
104 const uint16 PropertyOffset = Fast[Index];
105 checkSlow(PropertyOffset != 0);
106
107 StorageType Storage{};
108 Traits->GetObjectPropertyValue(Objects[Index], InMetaData[Index]..., PropertyOffset, Storage);
109
110 PatchCompositeValue(CompositeDefinitions, &Storage, InCompositeComponents ? &InCompositeComponents[Index] : nullptr...);
111
112 Traits->SetObjectPropertyValue(Objects[Index], InMetaData[Index]..., PropertyOffset, Storage);
113 }
114}
115
116
117template<typename PropertyTraits, typename ...MetaDataTypes, int ...CompositeIndices, typename ...CompositeTypes>
118void TSetPartialPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, TIntegerSequence<int, CompositeIndices...>, CompositeTypes...>::ForEachSlow(
119 const FEntityAllocation* Allocation,
120 UObject* const* Objects,
122 const MetaDataTypes*... InMetaData,
124{
125 const int32 Num = Allocation->Num();
126
127 for (int32 Index = 0; Index < Num; ++Index)
128 {
129 FTrackInstancePropertyBindings* Bindings = Slow[Index].Get();
130
131 StorageType Storage{};
132 Traits->GetObjectPropertyValue(Objects[Index], InMetaData[Index]..., Bindings, Storage);
133
134 PatchCompositeValue(CompositeDefinitions, &Storage, InCompositeComponents ? &InCompositeComponents[Index] : nullptr...);
135
136 Traits->SetObjectPropertyValue(Objects[Index], InMetaData[Index]..., Bindings, Storage);
137 }
138}
139
140
141} // namespace MovieScene
142} // namespace UE
#define checkSlow(expr)
Definition AssertionMacros.h:332
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
uint16_t uint16
Definition binka_ue_file_header.h:7
Definition TrackInstancePropertyBindings.h:143
Definition MovieScene.Build.cs:6
Definition SharedPointer.h:692
Definition Object.h:95
int
Definition TestServer.py:515
void PatchCompositeValue(TArrayView< const FPropertyCompositeDefinition > CompositeDefinitions, void *OutValueAddress, const CompositeTypes *... Composites)
Definition MovieScenePartialProperties.h:39
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition IntegerSequence.h:9
Definition MovieScenePropertySystemTypes.h:23
uint16 Value
Definition MovieScenePropertySystemTypes.h:24
Definition MovieSceneEntitySystemTypes.h:624
int32 Num() const
Definition MovieSceneEntitySystemTypes.h:813
Definition MovieSceneComponentPtr.h:439
Definition MovieScenePropertyMetaData.h:19
Definition MovieSceneComponentPtr.h:208
Definition MovieSceneComponentPtr.h:195
Definition MovieScenePartialProperties.h:47