UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieSceneSpawnable.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
7#include "Misc/Guid.h"
9
10#include "MovieSceneSpawnable.generated.h"
11
15
16namespace UE::MovieScene
17{
18 struct FSharedPlaybackState;
19}
20
21UENUM()
23{
26 InnerSequence UMETA(DisplayName = "This Sequence"),
27
30
33};
34
38USTRUCT()
40{
42
44 : bContinuouslyRespawn(false)
45 , bNetAddressableName(false)
46 , ObjectTemplate(nullptr)
47 , Ownership(ESpawnOwnership::InnerSequence)
48#if WITH_EDITORONLY_DATA
50#endif
51 {
52 }
53
56 : bContinuouslyRespawn(false)
57 , bNetAddressableName(false)
58 , Guid(FGuid::NewGuid())
59 , Name(InitName)
60 , ObjectTemplate(&InObjectTemplate)
61 , Ownership(ESpawnOwnership::InnerSequence)
64#endif
65 {
66 MarkSpawnableTemplate(InObjectTemplate);
67 }
68
69public:
70
76 MOVIESCENE_API static bool IsSpawnableTemplate(const UObject& InObject);
77
82 MOVIESCENE_API static void MarkSpawnableTemplate(const UObject& InObject);
83
91 {
92 return ObjectTemplate;
93 }
94
102 {
103 return ObjectTemplate;
104 }
105
111 {
112 checkf(InObjectTemplate == nullptr || !InObjectTemplate->HasAnyFlags(RF_ClassDefaultObject), TEXT("Setting CDOs as object templates is not supported. Please use the class directly."));
113 ObjectTemplate = InObjectTemplate;
114 }
115
123
130 const FGuid& GetGuid() const
131 {
132 return Guid;
133 }
134
141 void SetGuid(const FGuid& InGuid)
142 {
143 Guid = InGuid;
144 }
145
152 const FString& GetName() const
153 {
154 return Name;
155 }
156
162 void SetName(const FString& InName)
163 {
164 Name = InName;
165 }
166
173 {
174 ChildPossessables.AddUnique(PossessableGuid);
175 }
176
183 {
184 ChildPossessables.Remove(PossessableGuid);
185 }
186
191 {
192 return ChildPossessables;
193 }
194
199 {
200 return Ownership;
201 }
202
207 {
208 Ownership = InOwnership;
209 }
210
212 UPROPERTY(EditAnywhere, AdvancedDisplay, Category = Actor)
213 FTransform SpawnTransform;
214
220 FName GetLevelName() const
221 {
222 return LevelName;
223 }
224
231 {
232 LevelName = InLevelName;
233 }
234
238 MOVIESCENE_API FName GetNetAddressableName(TSharedRef<const UE::MovieScene::FSharedPlaybackState> SharedPlaybackState, FMovieSceneSequenceID SequenceID) const;
239
240 UE_DEPRECATED(5.4, "Please use the FSharedPlaybackState version of this method")
241 MOVIESCENE_API FName GetNetAddressableName(IMovieScenePlayer& Player, FMovieSceneSequenceID SequenceID) const;
242
246 MOVIESCENE_API void AutoSetNetAddressableName();
247
248 /* For sorts and BinarySearch so we can search quickly by Guid */
249 inline bool operator<(const FMovieSceneSpawnable& RHS) const { return Guid < RHS.Guid; }
250 inline friend bool operator<(const FGuid& InGuid, const FMovieSceneSpawnable& RHS) { return InGuid < RHS.GetGuid(); }
251 inline bool operator<(const FGuid& InGuid) const { return Guid < InGuid; }
252
254 UPROPERTY(EditAnywhere, AdvancedDisplay, Category=Actor)
256
258 UPROPERTY(EditAnywhere, Category=Actor)
259 bool bContinuouslyRespawn;
260
262 UPROPERTY(EditAnywhere, Category=Actor)
263 bool bNetAddressableName;
264
265 // Property has been deprecated- 'Dynamic Bindings' are now handled by UMovieSceneReplaceableDirectorBlueprintBinding and the custom binding system
266 UPROPERTY()
267 FMovieSceneDynamicBinding DynamicBinding_DEPRECATED;
268
269private:
270
272 // @todo sequencer: Guids need to be handled carefully when the asset is duplicated (or loaded after being copied on disk).
273 // Sometimes we'll need to generate fresh Guids.
274 UPROPERTY()
275 FGuid Guid;
276
278 // @todo sequencer: Should be editor-only probably
279 UPROPERTY()
280 FString Name;
281
282 UPROPERTY()
283 TObjectPtr<UObject> ObjectTemplate;
284
286 // @todo sequencer: This should be a TSet, but they don't duplicate correctly atm
287 UPROPERTY()
288 TArray<FGuid> ChildPossessables;
289
291 UPROPERTY()
292 ESpawnOwnership Ownership;
293
294#if WITH_EDITORONLY_DATA
295public:
297 UPROPERTY()
299#endif
300
302 UPROPERTY()
303 FName LevelName;
304};
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
#define WITH_EDITORONLY_DATA
Definition CoreMiscDefines.h:24
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
ESpawnOwnership
Definition MovieSceneSpawnable.h:23
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
@ RF_ClassDefaultObject
This object is used as the default template for all instances of a class. One object is created for e...
Definition ObjectMacros.h:563
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
if(Failed) console_printf("Failed.\n")
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition NameTypes.h:617
Definition IMovieScenePlayer.h:90
Definition Array.h:670
Definition SharedPointer.h:153
Definition Class.h:3793
Definition MovieSceneSequence.h:73
Definition Object.h:95
Definition ConstraintsManager.h:14
@ false
Definition radaudio_common.h:23
Definition Guid.h:109
Definition MovieSceneDynamicBinding.h:36
Definition MovieSceneSequenceID.h:13
Definition MovieSceneSpawnable.h:40
FMovieSceneSpawnable(const FString &InitName, UObject &InObjectTemplate)
Definition MovieSceneSpawnable.h:55
void SetGuid(const FGuid &InGuid)
Definition MovieSceneSpawnable.h:141
void AddChildPossessable(const FGuid &PossessableGuid)
Definition MovieSceneSpawnable.h:172
void SetObjectTemplate(UObject *InObjectTemplate)
Definition MovieSceneSpawnable.h:110
void SetName(const FString &InName)
Definition MovieSceneSpawnable.h:162
friend bool operator<(const FGuid &InGuid, const FMovieSceneSpawnable &RHS)
Definition MovieSceneSpawnable.h:250
ESpawnOwnership GetSpawnOwnership() const
Definition MovieSceneSpawnable.h:198
const UObject * GetObjectTemplate() const
Definition MovieSceneSpawnable.h:101
void SetSpawnOwnership(ESpawnOwnership InOwnership)
Definition MovieSceneSpawnable.h:206
UObject * GetObjectTemplate()
Definition MovieSceneSpawnable.h:90
const FString & GetName() const
Definition MovieSceneSpawnable.h:152
bool operator<(const FGuid &InGuid) const
Definition MovieSceneSpawnable.h:251
const TArray< FGuid > & GetChildPossessables() const
Definition MovieSceneSpawnable.h:190
void RemoveChildPossessable(const FGuid &PossessableGuid)
Definition MovieSceneSpawnable.h:182
void SetLevelName(FName InLevelName)
Definition MovieSceneSpawnable.h:230
const FGuid & GetGuid() const
Definition MovieSceneSpawnable.h:130
Definition ObjectPtr.h:488