UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MovieSceneKeyProxy.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "UObject/Interface.h"
7#include "MovieSceneSection.h"
10#include "Curves/KeyHandle.h"
12#include "MovieSceneKeyProxy.generated.h"
13
14UINTERFACE(MinimalAPI)
19
20
63
64
65
66template<typename ChannelType, typename ValueType>
68{
69 auto* Channel = InChannelHandle.Get();
70 if (!Channel || !InSignedObject)
71 {
72 return;
73 }
74
76 if (!Section)
77 {
79 }
80
81 auto ChannelData = Channel->GetData();
82
83 int32 KeyIndex = ChannelData.GetIndex(InKeyHandle);
84 if (KeyIndex != INDEX_NONE)
85 {
86 // If we have no signed object, or it's locked, don't let the user change the value
87 if (!InSignedObject || (Section && !Section->TryModify()))
88 {
89 InOutTime = ChannelData.GetTimes()[KeyIndex];
90 InOutValue = ChannelData.GetValues()[KeyIndex];
91 }
92 else
93 {
95
96 ChannelData.GetValues()[KeyIndex] = InOutValue;
97
98 ChannelData.MoveKey(KeyIndex, InOutTime);
99
100 if (Section)
101 {
102 Section->ExpandToFrame(InOutTime);
103 }
104 }
105 Channel->PostEditChange();
106 }
107}
108
109
110
111template<typename ChannelType, typename ValueType>
113{
114 auto* Channel = InChannelHandle.Get();
115 if (Channel)
116 {
117 auto ChannelData = Channel->GetData();
118 int32 KeyIndex = ChannelData.GetIndex(InKeyHandle);
119 if (KeyIndex != INDEX_NONE && KeyIndex < FMath::Min(ChannelData.GetValues().Num(), ChannelData.GetTimes().Num()))
120 {
121 OutValue = ChannelData.GetValues()[KeyIndex];
122 OutTime = ChannelData.GetTimes()[KeyIndex];
123 }
124 }
125}
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UINTERFACE(...)
Definition ObjectMacros.h:780
Definition MovieSceneKeyProxy.h:27
void OnProxyValueChanged(TMovieSceneChannelHandle< ChannelType > InChannelHandle, UMovieSceneSignedObject *InSignedObject, FKeyHandle InKeyHandle, ValueType &InOutValue, FFrameNumber &InOutTime)
Definition MovieSceneKeyProxy.h:67
void RefreshCurrentValue(TMovieSceneChannelHandle< ChannelType > InChannelHandle, FKeyHandle InKeyHandle, ValueType &OutValue, FFrameNumber &OutTime)
Definition MovieSceneKeyProxy.h:112
virtual void UpdateValuesFromRawData()=0
Definition Interface.h:19
Definition MovieSceneKeyProxy.h:16
Definition MovieSceneSection.h:243
MOVIESCENE_API bool TryModify(bool bAlwaysMarkDirty=true)
Definition MovieSceneSection.cpp:588
void ExpandToFrame(FFrameNumber InFrame)
Definition MovieSceneSection.h:302
Definition MovieSceneSignedObject.h:72
COREUOBJECT_API UObject * GetTypedOuter(UClass *Target) const
Definition UObjectBaseUtility.cpp:308
UE_FORCEINLINE_HINT bool Modify(bool bAlwaysMarkDirty=true)
Definition Object.h:317
Definition FrameNumber.h:18
Definition KeyHandle.h:15
Definition MovieSceneChannelHandle.h:167