Files
UnrealEngineUWP/Engine/Source/Runtime/MovieScene/Private/EntitySystem/MovieSceneInitialValueCache.cpp
Andrew Rodham 1ff0401590 Sequencer: Initial Values are now shared between FSequencer instances and Interrogators
- This ensures that exports and trail rendering share the same initial value data despite objects potentially being in animated states when an interrogation is performed.
  - All initial value processing is now handled by a new system, UMovieSceneInitialValueSystem, rather than the property instantiator. This means the same system can initialize the correct initial values for interrogators and runtime properties.
  - This change introduces 2 new linker extensions (one for the interrogator, and one for the shared initial value storage) which allows the initial value system to perform optimally when the extensions are not present, but also use the initial value cache storage when it present in-editor.

#jira UE-102858
#rb Max.Chen, Ludovic.Chabant

[CL 15153737 by Andrew Rodham in ue5-main branch]
2021-01-21 09:19:08 -04:00

34 lines
832 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "EntitySystem/MovieSceneInitialValueCache.h"
#include "EntitySystem/MovieSceneEntitySystemLinker.h"
namespace UE
{
namespace MovieScene
{
TEntitySystemLinkerExtensionID<FInitialValueCache> FInitialValueCache::GetExtensionID()
{
static TEntitySystemLinkerExtensionID<FInitialValueCache> ID = UMovieSceneEntitySystemLinker::RegisterExtension<FInitialValueCache>();
return ID;
}
TSharedPtr<FInitialValueCache> FInitialValueCache::GetGlobalInitialValues()
{
static TWeakPtr<FInitialValueCache> GSharedInitialValues = MakeShared<FInitialValueCache>();
TSharedPtr<FInitialValueCache> Ptr = GSharedInitialValues.Pin();
if (!Ptr)
{
Ptr = MakeShared<FInitialValueCache>();
GSharedInitialValues = Ptr;
}
return Ptr;
}
} // namespace MovieScene
} // namespace UE