Files
UnrealEngineUWP/Engine/Source/Runtime/LevelSequence/Public/LevelSequenceLegacyObjectReference.h
andrew rodham 389412f945 Sequencer: Convert default binding mechanism to use universal object locators
Level Sequences now use UOLs for their bindings.
Level Sequence player context is now an ALevelSequenceActor if possible.
All bindings (including the extreme-legacy lazy object ptr bindings) are now upgraded to use the UOL binding mechanism.

Introduced a new concept for reasoning about object hierarchies in Sequencer: object schemas. Schemas allow customization of how Sequencer handles finding 'parent' and 'child' objects, which allows us to genericize lots of the hard-coded Actor-Component logic. This is just a first pass - there are still many places that directly deal with AActor and UActorComponent, which will be gradually migrated with upcoming work.

#jira UE-199305
#rb david.bromberg, ludovic.chabant

[CL 29932924 by andrew rodham in ue5-main branch]
2023-11-27 09:05:23 -05:00

62 lines
1.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Misc/Guid.h"
#include "UObject/Class.h"
#include "UObject/LazyObjectPtr.h"
#include "LevelSequenceLegacyObjectReference.generated.h"
/**
* Legacy method by which objects were referenced within a level sequence. No longer used. See FLevelSequenceBindingReference for up-to-date implementation.
*/
USTRUCT()
struct FLevelSequenceLegacyObjectReference
{
GENERATED_BODY();
/**
* Resolve this reference within the specified context
*
* @return The object (usually an Actor or an ActorComponent).
*/
UObject* Resolve(UObject* InContext) const;
/**
* Serialization operator
*/
friend FArchive& operator<<(FArchive& Ar, FLevelSequenceLegacyObjectReference& Ref)
{
Ar << Ref.ObjectId;
Ar << Ref.ObjectPath;
return Ar;
}
/** Primary method of resolution - object ID, stored as an annotation on the object in the world, resolvable through TLazyObjectPtr */
FUniqueObjectGuid ObjectId;
/** Secondary method of resolution - path to the object within the context */
FString ObjectPath;
};
USTRUCT()
struct FLevelSequenceObjectReferenceMap
{
public:
GENERATED_BODY();
/**
* Serialization function
*/
bool Serialize(FArchive& Ar);
TMap<FGuid, FLevelSequenceLegacyObjectReference> Map;
};
template<> struct TStructOpsTypeTraits<FLevelSequenceObjectReferenceMap> : public TStructOpsTypeTraitsBase2<FLevelSequenceObjectReferenceMap>
{
enum { WithSerializer = true };
};