You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fixed adding keys to a curve model sometimes causing tangents to get incorrectly calculated. This was causing issues with Buffered curves.
#jira UE-75157 #rb Max.Chen #ROBOMERGE-SOURCE: CL 7269268 via CL 7269269 via CL 7269958 via CL 7270008 via CL 7275787 #ROBOMERGE-BOT: (v369-7254125) [CL 7275892 by matt hoffman in Main branch]
This commit is contained in:
@@ -41,6 +41,9 @@ void FRichCurveEditorModel::AddKeys(TArrayView<const FKeyPosition> InKeyPosition
|
||||
{
|
||||
Owner->Modify();
|
||||
|
||||
TArray<FKeyHandle> NewKeyHandles;
|
||||
NewKeyHandles.SetNumUninitialized(InKeyPositions.Num());
|
||||
|
||||
for (int32 Index = 0; Index < InKeyPositions.Num(); ++Index)
|
||||
{
|
||||
FKeyPosition Position = InKeyPositions[Index];
|
||||
@@ -49,20 +52,16 @@ void FRichCurveEditorModel::AddKeys(TArrayView<const FKeyPosition> InKeyPosition
|
||||
FKeyHandle NewHandle = RichCurve->AddKey(Position.InputValue, Position.OutputValue);
|
||||
FRichCurveKey* NewKey = &RichCurve->GetKey(NewHandle);
|
||||
|
||||
if (Attributes.HasInterpMode()) { NewKey->InterpMode = Attributes.GetInterpMode(); }
|
||||
if (Attributes.HasTangentMode()) { NewKey->TangentMode = Attributes.GetTangentMode(); }
|
||||
if (Attributes.HasArriveTangent()) { NewKey->ArriveTangent = Attributes.GetArriveTangent(); }
|
||||
if (Attributes.HasLeaveTangent()) { NewKey->LeaveTangent = Attributes.GetLeaveTangent(); }
|
||||
if (Attributes.HasArriveTangentWeight()) { NewKey->ArriveTangentWeight = Attributes.GetArriveTangent(); }
|
||||
if (Attributes.HasLeaveTangentWeight()) { NewKey->LeaveTangentWeight = Attributes.GetLeaveTangent(); }
|
||||
|
||||
NewKeyHandles[Index] = NewHandle;
|
||||
if (OutKeyHandles)
|
||||
{
|
||||
(*OutKeyHandles)[Index] = NewHandle;
|
||||
}
|
||||
}
|
||||
|
||||
RichCurve->AutoSetTangents();
|
||||
// We reuse SetKeyAttributes here as there is complex logic determining which parts of the attributes are valid to pass on.
|
||||
// For now we need to duplicate the new key handle array due to API mismatch. This will auto-calculate tangents if required.
|
||||
SetKeyAttributes(NewKeyHandles, InKeyAttributes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user