Files
UnrealEngine/Engine/Source/Editor/MovieSceneTools/Private/Channels/BoolChannelKeyProxy.cpp
2025-05-18 13:04:45 +08:00

41 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "Channels/BoolChannelKeyProxy.h"
#include "Channels/MovieSceneBoolChannel.h"
#include "Channels/MovieSceneChannelHandle.h"
#include "HAL/PlatformCrt.h"
struct FPropertyChangedEvent;
void UBoolChannelKeyProxy::Initialize(FKeyHandle InKeyHandle, TMovieSceneChannelHandle<FMovieSceneBoolChannel> InChannelHandle, TWeakObjectPtr<UMovieSceneSection> InWeakSection)
{
KeyHandle = InKeyHandle;
ChannelHandle = InChannelHandle;
WeakSection = InWeakSection;
}
void UBoolChannelKeyProxy::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
bool bNewValue = bValue;
if (ChannelHandle.GetMetaData() != nullptr && ChannelHandle.GetMetaData()->bInvertValue)
{
bNewValue = !bNewValue;
}
Super::PostEditChangeProperty(PropertyChangedEvent);
OnProxyValueChanged(ChannelHandle, WeakSection.Get(), KeyHandle, bNewValue, Time);
}
void UBoolChannelKeyProxy::UpdateValuesFromRawData()
{
RefreshCurrentValue(ChannelHandle, KeyHandle, bValue, Time);
if (ChannelHandle.GetMetaData() != nullptr && ChannelHandle.GetMetaData()->bInvertValue)
{
bValue = !bValue;
}
}