You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Control Rig: Fix undo/redo in curve container not working
#jira UE-200243 #rb Helge.Mathee #rnx [CL 29803906 by sara schvartzman in ue5-main branch]
This commit is contained in:
@@ -147,6 +147,13 @@ void SRigCurveContainer::Construct(const FArguments& InArgs, TSharedRef<FControl
|
||||
ControlRigBlueprint->Hierarchy->OnModified().AddRaw(this, &SRigCurveContainer::OnHierarchyModified);
|
||||
ControlRigBlueprint->OnRefreshEditor().AddRaw(this, &SRigCurveContainer::HandleRefreshEditorFromBlueprint);
|
||||
|
||||
UEditorEngine* Editor = Cast<UEditorEngine>(GEngine);
|
||||
if (Editor != nullptr)
|
||||
{
|
||||
Editor->RegisterForUndo(this);
|
||||
}
|
||||
|
||||
|
||||
// Register and bind all our menu commands
|
||||
FCurveContainerCommands::Register();
|
||||
BindCommands();
|
||||
@@ -455,6 +462,22 @@ void SRigCurveContainer::OnNameCommitted(const FText& InNewName, ETextCommit::Ty
|
||||
}
|
||||
}
|
||||
|
||||
void SRigCurveContainer::PostUndo(bool bSuccess)
|
||||
{
|
||||
if (bSuccess)
|
||||
{
|
||||
RefreshCurveList();
|
||||
}
|
||||
}
|
||||
|
||||
void SRigCurveContainer::PostRedo(bool bSuccess)
|
||||
{
|
||||
if (bSuccess)
|
||||
{
|
||||
RefreshCurveList();
|
||||
}
|
||||
}
|
||||
|
||||
void SRigCurveContainer::OnDeleteNameClicked()
|
||||
{
|
||||
URigHierarchy* Hierarchy = GetHierarchy();
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "Widgets/Views/SListView.h"
|
||||
#include "Rigs/RigHierarchy.h"
|
||||
#include "ControlRigBlueprint.h"
|
||||
#include "EditorUndoClient.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// FDisplayedRigCurveInfo
|
||||
@@ -121,7 +122,7 @@ private:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// SRigCurveContainer
|
||||
|
||||
class SRigCurveContainer : public SCompoundWidget
|
||||
class SRigCurveContainer : public SCompoundWidget, public FEditorUndoClient
|
||||
{
|
||||
public:
|
||||
SLATE_BEGIN_ARGS( SRigCurveContainer )
|
||||
@@ -201,6 +202,10 @@ public:
|
||||
// When a name is committed after being edited in the list
|
||||
virtual void OnNameCommitted(const FText& NewName, ETextCommit::Type CommitType, FDisplayedRigCurveInfoPtr Item);
|
||||
|
||||
// FEditorUndoClient
|
||||
virtual void PostUndo(bool bSuccess) override;
|
||||
virtual void PostRedo(bool bSuccess) override;
|
||||
|
||||
private:
|
||||
|
||||
void BindCommands();
|
||||
|
||||
Reference in New Issue
Block a user