Does anyone know how to extend SAnimationGraphNode ?
im trying to create a widget control on my custom node.
Custom animation sequence node and graph node works perfectly, the issue is with SAnimationGraphNode when i try to contruct the actual widget.
/* CPP File */
// Adapted from SGraphNodeSequencePlayer
#include "Animation/SGraphNode_CustomNode.h"
// Engine
#include "Widgets/Input/SSlider.h"
#include "Animation/AnimBlueprintGeneratedClass.h"
#include "Kismet2/KismetDebugUtilities.h"
#include "Kismet2/BlueprintEditorUtils.h"
// Custom Graph Node extended from UAnimGraphNode_AssetPlayerBase
#include "Animation/AnimGraphNode_CustomNode.h"
// Custom Anim Node extended from FAnimNode_AssetPlayerBase
#include "Animation/AnimCustomNode.h"
void SGraphNode_CustomNode::Construct(const FArguments& InArgs, UAnimGraphNode_Base* InNode)
{
this->GraphNode = InNode;
this->SetCursor(EMouseCursor::CardinalCross);
this->UpdateGraphNode();
// Commenting this line it does compile (but, with no widget on node)
SAnimationGraphNode::Construct(SAnimationGraphNode::FArguments(), InNode);
}
// Header File
#pragma once
#include "CoreMinimal.h"
#include "Layout/Visibility.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "SNodePanel.h"
// original include line of SAnimationGraphNode from SGraphNodeSequencePlayer.h does not work ("can not open source file..." intellisense error)
//#include "AnimationNodes/SAnimationGraphNode.h"
// needs to be the full line direction
#include "Editor/AnimationBlueprintEditor/Private/AnimationNodes/SAnimationGraphNode.h"
class SVerticalBox;
class UAnimGraphNode_Base;
struct FAnimCustomNode;
struct FGraphInformationPopupInfo;
class SGraphNode_CustomNode : public SAnimationGraphNode
{
public:
SLATE_BEGIN_ARGS(SGraphNode_CustomNode) {}
SLATE_END_ARGS()
void Construct(const FArguments& InArgs, UAnimGraphNode_Base* InNode);
// SNodePanel::SNode interface
virtual void GetNodeInfoPopups(FNodeInfoContext* Context,
TArray<FGraphInformationPopupInfo>& Popups) const override;
// End of SNodePanel::SNode interface
. . .
}
custom editor module build file :
using UnrealBuildTool;
public class CoopGameEditor : ModuleRules
{
public CoopGameEditor(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.Add("CoopGameEditor/Public");
PrivateIncludePaths.Add("CoopGameEditor/Private");
PublicDependencyModuleNames.AddRange
(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"InputCore",
"AnimationCore",
"AnimGraphRuntime", /* Engine Nodes */
"BlueprintGraph",
"CoopGame"
}
);
PrivateDependencyModuleNames.AddRange
(
new string[]
{
"UnrealEd",
"GraphEditor",
"AnimGraph",
"AnimationBlueprintEditor",
"PropertyEditor",
"EditorStyle",
"Slate",
"SlateCore"
}
);
PrivateIncludePathModuleNames.AddRange(new string[] { });
DynamicallyLoadedModuleNames.AddRange(new string[] { });
}
}
Error Output:
1>SGraphNode_CustomNode.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl SAnimationGraphNode::Construct(struct SAnimationGraphNode::FArguments const &,class UAnimGraphNode_Base *)" (?Construct@SAnimationGraphNode@@QEAAXAEBUFArguments@1@PEAVUAnimGraphNode_Base@@@Z) referenced in function "public: void __cdecl SGraphNode_CustomNode::Construct(struct SGraphNode_CustomNode::FArguments const &,class UAnimGraphNode_Base *)" (?Construct@SGraphNode_CustomNode@@QEAAXAEBUFArguments@1@PEAVUAnimGraphNode_Base@@@Z)