UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DataflowContent.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "UObject/Interface.h"
9#include "DataflowContent.generated.h"
10
11#define UE_API DATAFLOWENGINE_API
12
13
15class USkeletalMesh;
16class USkeleton;
17class USkeletalMeshComponent;
18class UAnimationAsset;
20class FPreviewScene;
22
24{
25 // Return a new(or saved) content that can store the execution state of the graph.
26 template<class T>
28}
29
30UINTERFACE(MinimalAPI)
35
71
75UCLASS(MinimalAPI)
77{
79
80public:
83
86
89
94 bool IsConstructionDirty() const { return bIsConstructionDirty; }
95 UE_API void SetConstructionDirty(bool InDirty);
96
97 bool IsSimulationDirty() const { return bIsSimulationDirty; }
98 UE_API void SetSimulationDirty(bool InDirty);
99
104 UE_API void SetLastModifiedTimestamp(UE::Dataflow::FTimestamp InTimestamp, bool bMakeDirty =true);
105 const UE::Dataflow::FTimestamp& GetLastModifiedTimestamp() const { return LastModifiedTimestamp; }
106
111 UE_API virtual void SetDataflowContext(const TSharedPtr<UE::Dataflow::FEngineContext>& InContext) override;
112
114 UE_API void UpdateContentDatas();
115
117 virtual void AddContentObjects(FReferenceCollector& Collector) {}
118
120 UE_API virtual void SetActorProperties(TObjectPtr<AActor>& PreviewActor) const;
121
123 UE_API void SetDataflowOwner(const TObjectPtr<UObject>& InOwner);
124 UE_API TObjectPtr<UObject> GetDataflowOwner() const;
125
127 UE_API virtual void SetDataflowAsset(const TObjectPtr<UDataflow>& InAsset) override;
128
130 void SetDataflowTerminal(const FString& InPath) { DataflowTerminal = InPath; SetConstructionDirty(true); SetSimulationDirty(true);}
131 const FString& GetDataflowTerminal() const { return DataflowTerminal; }
132
134 void SetTerminalAsset(const TObjectPtr<UObject>& InAsset) { TerminalAsset = InAsset; SetConstructionDirty(true); SetSimulationDirty(true);}
135 const TObjectPtr<UObject>& GetTerminalAsset() const { return TerminalAsset;}
136
138 void SetPreviewClass(const TSubclassOf<AActor>& InPreviewClass) { PreviewClass = InPreviewClass; SetConstructionDirty(true); SetSimulationDirty(true);}
139 const TSubclassOf<AActor>& GetPreviewClass() const { return PreviewClass;}
140
142 UE_API virtual void Serialize(FArchive& Ar);
143
144 /* Context cache saving */
145 bool IsSaved() const { return bIsSaved; }
146 void SetIsSaved(bool bInSaved) { bIsSaved = bInSaved; }
147
148 //~ UObject interface
149 static UE_API void AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector);
150
151#if WITH_EDITOR
152 UE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
153#endif //if WITH_EDITOR
154
155protected:
156
158 UPROPERTY(Transient, SkipSerialization)
159 FString DataflowTerminal = "";
160
162 UPROPERTY(Transient, SkipSerialization)
163 TObjectPtr<UObject> TerminalAsset = nullptr;
164
166 UE::Dataflow::FTimestamp LastModifiedTimestamp = UE::Dataflow::FTimestamp::Invalid;
167
169 UPROPERTY()
170 bool bIsConstructionDirty = true;
171
173 UPROPERTY()
174 bool bIsSimulationDirty = true;
175
177 bool bIsSaved = false;
178
180 TSubclassOf<AActor> PreviewClass;
181
183 static UE_API void OverrideActorProperty(const TObjectPtr<AActor>& PreviewActor, TObjectPtr<UObject> PropertyValue, const FName& PropertyName);
184
186 template<typename StructType>
187 static void OverrideStructProperty(const TObjectPtr<AActor>& PreviewActor, const StructType& PropertyValue, const FName& PropertyName);
188};
189
190template<typename StructType>
191void UDataflowBaseContent::OverrideStructProperty(const TObjectPtr<AActor>& PreviewActor, const StructType& PropertyValue, const FName& PropertyName)
192{
193 if(PreviewActor)
194 {
195 if(const FProperty* DataflowProperty = PreviewActor->GetClass()->FindPropertyByName(PropertyName))
196 {
198 {
199 if(StructProperty->Struct == StructType::StaticStruct())
200 {
201 if(StructType* PropertyStruct = DataflowProperty->ContainerPtrToValuePtr<StructType>(PreviewActor))
202 {
203 (*PropertyStruct) = PropertyValue;
204 }
205 }
206 }
207 }
208 }
209}
210
214UCLASS(MinimalAPI)
216{
218
219public:
221 virtual ~UDataflowSkeletalContent() override{}
222
223#if WITH_EDITOR
224 UE_API virtual bool CanEditChange(const FProperty* InProperty) const override;
225 UE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
226#endif //if WITH_EDITOR
227
229 UE_API virtual void AddContentObjects(FReferenceCollector& Collector) override;
230
232 UE_API void SetSkeletalMesh(const TObjectPtr<USkeletalMesh>& InMesh, const bool bHideAsset = false);
234
236 UE_API void SetAnimationAsset(const TObjectPtr<UAnimationAsset>& InAnimation, const bool bHideAsset = false);
237 const TObjectPtr<UAnimationAsset>& GetAnimationAsset() const { return AnimationAsset; }
238
239 //~ UObject interface
240 static UE_API void AddReferencedObjects(UObject* InThis, FReferenceCollector& Collector);
241
243 UE_API virtual void SetActorProperties(TObjectPtr<AActor>& PreviewActor) const override;
244
245protected:
246
248 UPROPERTY(EditAnywhere, Category = "Preview", Transient, SkipSerialization)
250
252 UPROPERTY(EditAnywhere, Category = "Preview", Transient, SkipSerialization)
253 TObjectPtr<UAnimationAsset> AnimationAsset = nullptr;
254
256 bool bHideSkeletalMesh = false;
257
259 bool bHideAnimationAsset = false;
260};
261
262#undef UE_API
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_API
Definition DataflowContent.h:11
return true
Definition ExternalRpcRegistry.cpp:601
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UINTERFACE(...)
Definition ObjectMacros.h:780
#define UCLASS(...)
Definition ObjectMacros.h:776
Definition Actor.h:257
Definition Archive.h:1208
FFieldClass * GetClass() const
Definition Field.h:722
Definition NameTypes.h:617
Definition PreviewScene.h:19
Definition UnrealType.h:174
Definition UObjectGlobals.h:2492
Definition UnrealType.h:6306
Definition DataflowContent.h:40
DECLARE_MULTICAST_DELEGATE(FOnContentOwnerChanged)
virtual TObjectPtr< UDataflowBaseContent > CreateDataflowContent()=0
FOnContentOwnerChanged OnContentOwnerChanged
Definition DataflowContent.h:52
virtual void ReadDataflowContent(const TObjectPtr< UDataflowBaseContent > &DataflowContent)=0
UE_API TObjectPtr< UDataflowBaseContent > BuildDataflowContent()
Definition DataflowContent.cpp:243
virtual void WriteDataflowContent(const TObjectPtr< UDataflowBaseContent > &DataflowContent) const =0
void InvalidateDataflowContents() const
Definition DataflowContent.h:55
Definition SharedPointer.h:692
Definition SubclassOf.h:30
Definition AnimSingleNodeInstance.h:24
Definition AnimationAsset.h:1020
Definition DataflowContent.h:77
bool IsSaved() const
Definition DataflowContent.h:145
void SetTerminalAsset(const TObjectPtr< UObject > &InAsset)
Definition DataflowContent.h:134
void SetDataflowTerminal(const FString &InPath)
Definition DataflowContent.h:130
const TSubclassOf< AActor > & GetPreviewClass() const
Definition DataflowContent.h:139
const TObjectPtr< UObject > & GetTerminalAsset() const
Definition DataflowContent.h:135
bool IsSimulationDirty() const
Definition DataflowContent.h:97
void SetIsSaved(bool bInSaved)
Definition DataflowContent.h:146
const FString & GetDataflowTerminal() const
Definition DataflowContent.h:131
const UE::Dataflow::FTimestamp & GetLastModifiedTimestamp() const
Definition DataflowContent.h:105
FOnContentDataChanged OnContentDataChanged
Definition DataflowContent.h:88
void SetPreviewClass(const TSubclassOf< AActor > &InPreviewClass)
Definition DataflowContent.h:138
virtual void AddContentObjects(FReferenceCollector &Collector)
Definition DataflowContent.h:117
DECLARE_MULTICAST_DELEGATE_OneParam(FOnContentDataChanged, TObjectPtr< AActor > &SimulationActor)
bool IsConstructionDirty() const
Definition DataflowContent.h:94
Definition DataflowContent.h:32
Definition DataflowContextObject.h:27
Definition DataflowContent.h:216
const TObjectPtr< USkeletalMesh > & GetSkeletalMesh() const
Definition DataflowContent.h:233
const TObjectPtr< UAnimationAsset > & GetAnimationAsset() const
Definition DataflowContent.h:237
virtual ~UDataflowSkeletalContent() override
Definition DataflowContent.h:221
Definition Interface.h:19
Definition Object.h:95
Definition SkeletalMesh.h:440
Definition Skeleton.h:295
Definition DataflowContent.cpp:23
TObjectPtr< T > CreateNewDataflowContent(const TObjectPtr< UObject > &ContentOwner)
Definition DataflowContent.cpp:168
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
Definition UnrealType.h:6865
Definition ObjectPtr.h:488
Definition DataflowContextCache.h:40