x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

how to extend SAnimationGraphNode (link Errors)

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)

Product Version: UE 4.18
Tags:
more ▼

asked Feb 23 '18 at 02:42 AM in C++ Programming

avatar image

huatson
8 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question