Files
UnrealEngineUWP/Engine/Source/Editor/CurveEditor/Private/CurveModel.cpp
bryan sefcik 8cc129f2b6 IWYU Pass 1 - Engine/Source/Editor/...
#jira
#preflight 6306736ac85b7fef22be7751

[CL 21558583 by bryan sefcik in ue5-main branch]
2022-08-24 22:45:13 -04:00

34 lines
949 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);
}
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;
}