UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieScenePropertySystemTypes.inl
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreTypes.h"
7#include "UObject/NameTypes.h"
18
19
20namespace UE::MovieScene
21{
22
23template<typename PropertyTraits, typename ...MetaDataTypes>
24void TSetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
25 UObject* InObject,
26 FCustomPropertyIndex CustomIndex,
29{
30 Traits->SetObjectPropertyValue(InObject, MetaData..., CustomAccessors[CustomIndex.Value], ValueToSet);
31}
32
33template<typename PropertyTraits, typename ...MetaDataTypes>
34void TSetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
35 UObject* InObject,
36 uint16 PropertyOffset,
39{
40 // Would really like to avoid branching here, but if we encounter this data the options are either handle it gracefully, stomp a vtable, or report a fatal error.
41 if (ensureAlwaysMsgf(PropertyOffset != 0, TEXT("Invalid property offset specified (ptr+%d bytes) for property on object %s. This would otherwise overwrite the object's vfptr."), PropertyOffset, *InObject->GetName()))
42 {
43 Traits->SetObjectPropertyValue(InObject, MetaData..., PropertyOffset, ValueToSet);
44 }
45}
46
47template<typename PropertyTraits, typename ...MetaDataTypes>
48void TSetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
49 UObject* InObject,
50 const TSharedPtr<FTrackInstancePropertyBindings>& PropertyBindings,
53{
54 Traits->SetObjectPropertyValue(InObject, MetaData..., PropertyBindings.Get(), ValueToSet);
55}
56
57template<typename PropertyTraits, typename ...MetaDataTypes>
58void TSetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachAllocation(
59 const FEntityAllocation* Allocation,
62 TRead<MetaDataTypes>... MetaDataComponents,
64{
65 const int32 Num = Allocation->Num();
67 {
68 for (int32 Index = 0; Index < Num; ++Index)
69 {
70 ForEachEntity(BoundObjectComponents[Index], Custom[Index], MetaDataComponents[Index]..., PropertyValueComponents[Index]);
71 }
72 }
73 else if (const uint16* Fast = ResolvedPropertyComponents.template Get<1>())
74 {
75 for (int32 Index = 0; Index < Num; ++Index)
76 {
77 ForEachEntity(BoundObjectComponents[Index], Fast[Index], MetaDataComponents[Index]..., PropertyValueComponents[Index]);
78 }
79 }
81 {
82 for (int32 Index = 0; Index < Num; ++Index)
83 {
84 ForEachEntity(BoundObjectComponents[Index], Slow[Index], MetaDataComponents[Index]..., PropertyValueComponents[Index]);
85 }
86 }
87}
88
89template<typename PropertyTraits, typename ...MetaDataTypes>
90void TSetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachAllocation(
91 const FEntityAllocation* Allocation,
94 TRead<MetaDataTypes>... MetaDataComponents,
96{
97 const int32 Num = Allocation->Num();
98 if (const uint16* Fast = ResolvedPropertyComponents.template Get<0>())
99 {
100 for (int32 Index = 0; Index < Num; ++Index)
101 {
102 ForEachEntity(BoundObjectComponents[Index], *Fast++, MetaDataComponents[Index]..., PropertyValueComponents[Index]);
103 }
104 }
106 {
107 for (int32 Index = 0; Index < Num; ++Index)
108 {
109 ForEachEntity(BoundObjectComponents[Index], *Slow++, MetaDataComponents[Index]..., PropertyValueComponents[Index]);
110 }
111 }
112}
113
114template<typename PropertyTraits, typename ...MetaDataTypes>
115void TGetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
116 UObject* InObject,
117 FCustomPropertyIndex CustomPropertyIndex,
119 StorageType& OutValue) const
120{
121 Traits->GetObjectPropertyValue(InObject, MetaData..., CustomAccessors[CustomPropertyIndex.Value], OutValue);
122}
123
124template<typename PropertyTraits, typename ...MetaDataTypes>
125void TGetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
126 UObject* InObject,
127 uint16 PropertyOffset,
129 StorageType& OutValue) const
130{
131 // Would really like to avoid branching here, but if we encounter this data the options are either handle it gracefully, stomp a vtable, or report a fatal error.
132 if (ensureAlwaysMsgf(PropertyOffset != 0, TEXT("Invalid property offset specified (ptr+%d bytes) for property on object %s. This would otherwise overwrite the object's vfptr."), PropertyOffset, *InObject->GetName()))
133 {
134 Traits->GetObjectPropertyValue(InObject, MetaData..., PropertyOffset, OutValue);
135 }
136}
137
138template<typename PropertyTraits, typename ...MetaDataTypes>
139void TGetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachEntity(
140 UObject* InObject,
141 const TSharedPtr<FTrackInstancePropertyBindings>& PropertyBindings,
143 StorageType& OutValue) const
144{
145 Traits->GetObjectPropertyValue(InObject, MetaData..., PropertyBindings.Get(), OutValue);
146}
147
148template<typename PropertyTraits, typename ...MetaDataTypes>
149void TGetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachAllocation(
150 const FEntityAllocation* Allocation,
155{
156 const int32 Num = Allocation->Num();
158 {
159 for (int32 Index = 0; Index < Num; ++Index)
160 {
162 }
163 }
164 else if (const uint16* Fast = ResolvedPropertyComponents.template Get<1>())
165 {
166 for (int32 Index = 0; Index < Num; ++Index)
167 {
169 }
170 }
172 {
173 for (int32 Index = 0; Index < Num; ++Index)
174 {
176 }
177 }
178}
179
180template<typename PropertyTraits, typename ...MetaDataTypes>
181void TGetPropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>>::ForEachAllocation(
182 const FEntityAllocation* Allocation,
187{
188 const int32 Num = Allocation->Num();
189 if (const uint16* Fast = ResolvedPropertyComponents.template Get<0>())
190 {
191 for (int32 Index = 0; Index < Num; ++Index)
192 {
194 }
195 }
197 {
198 for (int32 Index = 0; Index < Num; ++Index)
199 {
201 }
202 }
203}
204
205
206template<typename PropertyTraits, typename... MetaDataTypes, typename... CompositeTypes>
207void TSetCompositePropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, CompositeTypes...>::ForEachEntity(
208 UObject* InObject,
209 FCustomPropertyIndex CustomPropertyIndex,
212{
213 StorageType Result = Traits->CombineComposites(MetaData..., CompositeResults...);
214 Traits->SetObjectPropertyValue(InObject, MetaData..., CustomAccessors[CustomPropertyIndex.Value], Result);
215}
216
217template<typename PropertyTraits, typename... MetaDataTypes, typename... CompositeTypes>
218void TSetCompositePropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, CompositeTypes...>::ForEachEntity(
219 UObject* InObject,
220 uint16 PropertyOffset,
223{
224 // Would really like to avoid branching here, but if we encounter this data the options are either handle it gracefully, stomp a vtable, or report a fatal error.
225 if (ensureAlwaysMsgf(PropertyOffset != 0, TEXT("Invalid property offset specified (ptr+%d bytes) for property on object %s. This would otherwise overwrite the object's vfptr."), PropertyOffset, *InObject->GetName()))
226 {
227 StorageType Result = Traits->CombineComposites(MetaData..., CompositeResults...);
228 Traits->SetObjectPropertyValue(InObject, MetaData..., PropertyOffset, Result);
229 }
230}
231
232template<typename PropertyTraits, typename... MetaDataTypes, typename... CompositeTypes>
233void TSetCompositePropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, CompositeTypes...>::ForEachEntity(
234 UObject* InObject,
235 const TSharedPtr<FTrackInstancePropertyBindings>& PropertyBindings,
238{
239 StorageType Result = Traits->CombineComposites(MetaData..., CompositeResults...);
240 Traits->SetObjectPropertyValue(InObject, MetaData..., PropertyBindings.Get(), Result);
241}
242
243template<typename PropertyTraits, typename... MetaDataTypes, typename... CompositeTypes>
244void TSetCompositePropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, CompositeTypes...>::ForEachAllocation(
245 const FEntityAllocation* Allocation,
250{
251 const int32 Num = Allocation->Num();
253 {
254 for (int32 Index = 0; Index < Num; ++Index )
255 {
257 }
258 }
259 else if (const uint16* Fast = ResolvedPropertyComponents.template Get<1>())
260 {
261 for (int32 Index = 0; Index < Num; ++Index )
262 {
264 }
265 }
267 {
268 for (int32 Index = 0; Index < Num; ++Index )
269 {
271 }
272 }
273}
274
275template<typename PropertyTraits, typename... MetaDataTypes, typename... CompositeTypes>
276void TSetCompositePropertyValuesImpl<PropertyTraits, TPropertyMetaData<MetaDataTypes...>, CompositeTypes...>::ForEachAllocation(
277 const FEntityAllocation* Allocation,
282{
283 const int32 Num = Allocation->Num();
284 if (const uint16* Fast = ResolvedPropertyComponents.template Get<0>())
285 {
286 for (int32 Index = 0; Index < Num; ++Index )
287 {
289 }
290 }
292 {
293 for (int32 Index = 0; Index < Num; ++Index )
294 {
296 }
297 }
298}
299
300} // namespace UE::MovieScene
#define ensureAlwaysMsgf(InExpression, InFormat,...)
Definition AssertionMacros.h:467
#define TEXT(x)
Definition Platform.h:1272
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 SharedPointer.h:692
UE_FORCEINLINE_HINT ObjectType * Get() const
Definition SharedPointer.h:1065
UE_FORCEINLINE_HINT FString GetName() const
Definition UObjectBaseUtility.h:439
Definition Object.h:95
Definition ConstraintsManager.h:14
U16 Index
Definition radfft.cpp:71
TCallTraitsParamTypeHelper< T, PassByValue >::ParamType ParamType
Definition UnrealTypeTraits.h:275
Definition MovieScenePropertySystemTypes.h:23
uint16 Value
Definition MovieScenePropertySystemTypes.h:24
Definition MovieSceneEntitySystemTypes.h:624
int32 Num() const
Definition MovieSceneEntitySystemTypes.h:813
typename PropertyTraits::StorageType StorageType
Definition MovieScenePropertySystemTypes.h:455
Definition MovieScenePropertySystemTypes.h:448
Definition MovieSceneComponentPtr.h:439
Definition MovieScenePropertyMetaData.h:19
Definition MovieSceneComponentPtr.h:195
typename PropertyTraits::StorageType StorageType
Definition MovieScenePropertySystemTypes.h:592
Definition MovieScenePropertySystemTypes.h:587
typename TCallTraits< typename PropertyTraits::StorageType >::ParamType InParamType
Definition MovieScenePropertySystemTypes.h:321
Definition MovieScenePropertySystemTypes.h:313
Definition MovieSceneComponentPtr.h:288