Files
UnrealEngineUWP/Engine/Source/Editor/CurveEditor/Private/CurveModel.cpp
Mike Zyracki 291e89c4bd Curve Editor: Performance: Add Curve caching so we only recreate the curves when something changes, giving us 30ms back in the specified jira test case.
Channels keep track if their owner's(MovieSceneSection) signature change, which we also now invalidate in the FCurveModel::Modify function.

InteractiveCurveView on Tick checks and sets a set of values to see if the view or something else has changed and then does a global recreate or checks each curve which then checks that new signature check to see if any individual curve was modified.
#jira UE-157989
#preflight 637d3b0c170bc34a93a6e6ab
#rb andrew.rodham

[CL 23379966 by Mike Zyracki in ue5-main branch]
2022-12-02 17:28:07 -05:00

34 lines
959 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CurveModel.h"
#include "Containers/Array.h"
#include "CurveDataAbstraction.h"
#include "Curves/KeyHandle.h"
#include "HAL/PlatformCrt.h"
void FCurveModel::SetKeyAttributes(TArrayView<const FKeyHandle> InKeys, const FKeyAttributes& InKeyAttributes, EPropertyChangeType::Type ChangeType)
{
TArray<FKeyAttributes> ExpandedAttributes;
ExpandedAttributes.Reserve(InKeys.Num());
for (FKeyHandle Handle : InKeys)
{
ExpandedAttributes.Add(InKeyAttributes);
}
SetKeyAttributes(InKeys, ExpandedAttributes);
Modify();
}
TOptional<FKeyHandle> FCurveModel::AddKey(const FKeyPosition& NewKeyPosition, const FKeyAttributes& InAttributes)
{
Modify();
TOptional<FKeyHandle> Handle;
TArrayView<TOptional<FKeyHandle>> Handles = MakeArrayView(&Handle, 1);
AddKeys(TArrayView<const FKeyPosition>(&NewKeyPosition, 1), TArrayView<const FKeyAttributes>(&InAttributes, 1), &Handles);
return Handle;
}