Files
UnrealEngineUWP/Engine/Source/Editor/AnimGraph/Private/EditModes/ModifyBoneEditMode.h
thomas sarkanen 9e7c191aca Anim blueprint editor modes now display transform toolbar
Deferred to the active editor modes when determining transform toolbar visibility
Updated existing edit modes to correctly update their available widget modes

#rb Nick.Brett
#preflight 61ba0002590498f205a19fb2

#ROBOMERGE-AUTHOR: thomas.sarkanen
#ROBOMERGE-SOURCE: CL 18467669 via CL 18467672 via CL 18467673 via CL 18468089 via CL 18468141
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18468161 by thomas sarkanen in ue5-release-engine-test branch]
2021-12-15 12:17:40 -05:00

43 lines
1.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "UnrealWidgetFwd.h"
#include "AnimNodeEditMode.h"
#include "BoneControllers/AnimNode_ModifyBone.h"
class FModifyBoneEditMode : public FAnimNodeEditMode
{
public:
FModifyBoneEditMode();
/** IAnimNodeEditMode interface */
virtual void EnterMode(class UAnimGraphNode_Base* InEditorNode, struct FAnimNode_Base* InRuntimeNode) override;
virtual void ExitMode() override;
virtual ECoordSystem GetWidgetCoordinateSystem() const override;
virtual FVector GetWidgetLocation() const override;
virtual UE::Widget::EWidgetMode GetWidgetMode() const override;
virtual UE::Widget::EWidgetMode ChangeToNextWidgetMode(UE::Widget::EWidgetMode InCurWidgetMode) override;
virtual bool SetWidgetMode(UE::Widget::EWidgetMode InWidgetMode) override;
virtual bool UsesTransformWidget(UE::Widget::EWidgetMode InWidgetMode) const override;
virtual FName GetSelectedBone() const override;
virtual void DoTranslation(FVector& InTranslation) override;
virtual void DoRotation(FRotator& InRotation) override;
virtual void DoScale(FVector& InScale) override;
virtual bool ShouldDrawWidget() const override;
private:
// methods to find a valid widget mode for gizmo because doesn't need to show gizmo when the mode is "Ignore"
UE::Widget::EWidgetMode FindValidWidgetMode(UE::Widget::EWidgetMode InWidgetMode) const;
EBoneModificationMode GetBoneModificationMode(UE::Widget::EWidgetMode InWidgetMode) const;
UE::Widget::EWidgetMode GetNextWidgetMode(UE::Widget::EWidgetMode InWidgetMode) const;
private:
struct FAnimNode_ModifyBone* RuntimeNode;
class UAnimGraphNode_ModifyBone* GraphNode;
// storing current widget mode
mutable UE::Widget::EWidgetMode CurWidgetMode;
};