Navigation
API > API/Editor > API/Editor/CurveEditor > API/Editor/CurveEditor/FCurveModel
Description
Remaps InNewHandles to reference the keys that InCurrentHandles reference. After this function concludes, the FKeyHandle InCurrentHandles no longer reference any keys in this curve.
This operation is needed if you have to add keys that are mapped to specific FKeyHandle instances. A use case for this is undo / redo. Suppose the following user action sequence: 1. Move FKeyHandle(42), 2. Delete FKeyHandle(42), 3. Undo. In step 3, we must add the key back. Calling FCurveEditor::AddKeys generates a new FKeyHandle, but we need to add it back as FKeyHandle(42); otherwise step 1's reference to FKeyHandle(42) breaks and undoing the movement action would not work.
FKeyHandle in InNewHandles that are already mapped to a key are skipped.. The corresponding InCurrentHandles is left unchanged and continues to reference the same key as before the call.
FKeyHandles in InCurrentHandles that reference no keys are skipped.
| Name | ReplaceKeyHandles |
| Type | function |
| Header File | /Engine/Source/Editor/CurveEditor/Public/CurveModel.h |
| Include Path | #include "CurveModel.h" |
virtual void ReplaceKeyHandles
(
TConstArrayView< FKeyHandle > InCurrentHandles,
TConstArrayView< FKeyHandle > InNewHandles
)
Parameters
| Name | Remarks |
|---|---|
| InCurrentHandles | Key handles that are currentl in the curve model |
| InNewHandles | The key handles to remap to. Each index corresponds to the same index in InCurrentHandles. |