# Create animation graph nodes?

**URL:** <https://forums.unrealengine.com/t/create-animation-graph-nodes/368343>\
**Category:** Character & Animation\
**Tags:** unreal-engine, nodes, CPP, question\
**Created:** [August 26, 2016, 2:12pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343 "2016-08-26T14:12:29Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [August 26, 2016, 2:12pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/1 "2016-08-26T14:12:29Z")

</div>

I am trying to set up custom anim graph nodes, and am struggling. The docs and every tutorial I can find:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Are outdated. In 4.12, the FAnimNode\_Base class seems to have been replaced with: FAnimInstanceProxy, and neither of these are in the ‘create new c++ class’ list…

And this, I think, voids all the docs. What do I need to change in the above guides, to get custom anim nodes?

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [August 26, 2016, 4:41pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/2 "2016-08-26T16:41:50Z")

</div>

Ah, I was missing the #include myGraphNode.h. It seems with this, the FAnimNode\_Base can still be used.

---

<div class="post-metadata">

**Author:** ![Thumper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thumper](https://forums.unrealengine.com/u/Thumper)\
**Post date:** [September 6, 2017, 1:40pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/3 "2017-09-06T13:40:35Z")

</div>

Any chance you could share how you were able to achieve this? I’m running through the links you posted trying to create an anim graph node and I’m running into lots of problems. Currently FBoneReference is not a blueprint type so I’m not sure how to expose that parameter.

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [September 6, 2017, 2:17pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/4 "2017-09-06T14:17:12Z")

</div>

Sure! These are the files I use:

AnimGraphNode\_NAME.cpp:

```
// Fill out your copyright notice in the Description page of Project Settings.

#include "YOUR_PLUGIN.h"
#include "AnimGraphNode_DataStream.h"

UAnimGraphNode_DataStream::UAnimGraphNode_DataStream(const class FObjectInitializer& PCIP)
	: Super(PCIP)
{
}

FText UAnimGraphNode_DataStream::GetNodeTitle(ENodeTitleType::Type TitleType) const
{
	return FText::FromString(FString::Printf(TEXT("NodeTitle.")));
}

FLinearColor UAnimGraphNode_DataStream::GetNodeTitleColor() const
{
	return FLinearColor(0.75f, 0.75f, 0.75f);
}

FText UAnimGraphNode_DataStream::GetTooltipText() const
{
	return FText::FromString(TEXT("ToolTipHere"));
}

FString UAnimGraphNode_DataStream::GetNodeCategory() const
{
	return FString("Category");
}
```

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [September 6, 2017, 2:17pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/5 "2017-09-06T14:17:21Z")

</div>

AnimNode\_NAME.cpp

```
#include "YOUR_PLUGIN.h"
#include "Runtime/Engine/Public/Animation/AnimInstanceProxy.h"
#include "AnimNode_DataStream.h"

FAnimNode_NAME::FAnimNode_NAME()
{
}

FAnimNode_NAME::~FAnimNode_NAME()
{
	
}

void FAnimNode_NAME::Initialize(const FAnimationInitializeContext& Context)
{
	// Forward to the incoming pose link.
	check(Context.AnimInstanceProxy != nullptr);

	//init the datastream
	

    InPose.Initialize(Context);
  
}
TArray<FTransform> inPoses;
void FAnimNode_NAME::Update(const FAnimationUpdateContext& Context)
{
	//this function should grab the data that you want on the skeleton and bind it.
	
	
	//get input skelton Transforms and store
	inPoses.Empty();
	inPoses = Context.AnimInstanceProxy->GetSkelMeshComponent()->BoneSpaceTransforms;

	InPose.Update(Context);
	EvaluateGraphExposedInputs.Execute(Context);
}

void FAnimNode_NAME::Evaluate(FPoseContext& Output)
{
	check(Output.AnimInstanceProxy->GetSkeleton() != nullptr);
	InPose.Evaluate(Output);
	
	
	//TempBones here is the output pose. 
	
	TArray<FTransform> TempBones = Output.Pose.GetBoneContainer().GetRefPoseArray();
	
	TempBones[i].SetLocation(tmpV);
	
		

  Output.Pose.CopyBonesFrom( TempBones );
 
	return;
}

void FAnimNode_NAME::CacheBones(const FAnimationCacheBonesContext & Context)
{
	InPose.CacheBones(Context);
}
```

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [September 6, 2017, 2:19pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/6 "2017-09-06T14:19:00Z")

</div>

AnimGraphNode\_NAME.h

```
    #include "AnimNode_NAME.h"
    #include "AnimGraphNode_Base.h"
    #include "AnimGraphNode_NAME.generated.h"
    
    /**
     * 
     */
    UCLASS(MinimalAPI)
    class AnimGraphNode_NAME : public UAnimGraphNode_Base
    {
    	GENERATED_UCLASS_BODY()

//THIS IS CRUCIAL, 

    		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Settings)
    		FAnimNode_NAME Node;
    
    #if WITH_EDITOR
    	// UEdGraphNode interface
    	virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override;
    	virtual FLinearColor GetNodeTitleColor() const override;
    	virtual FText GetTooltipText() const override;
    	virtual FString GetNodeCategory() const override;
    	// End of UEdGraphNode interface
    #endif
    	
    };
```

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [September 6, 2017, 2:20pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/7 "2017-09-06T14:20:38Z")

</div>

AnimNode\_NAME.h

```
   #pragma once
    
    #include "Animation/AnimNodeBase.h"
    //#include "AnimGraphNode_NAME.h"
    #include "SkeletonBinding.h"
    #include "AnimNode_NAME.generated.h"
    
    USTRUCT()
    struct FAnimNode_NAME : public FAnimNode_Base
    {
    	GENERATED_USTRUCT_BODY()
    
    public:
    	// The input pose is segmented into two:
    	// - The FK input pose that serves as a bias for the solver.
    	// - The task targets appended at the end.
    	//UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Links)
    	UPROPERTY(Transient)
    	FPoseLink InPose;
    
//these are boxes that show on the graph node

    	UPROPERTY(EditAnywhere, Category=Server, meta=(PinShownByDefault))
    	FString ServerName;
    
    	UPROPERTY(EditAnywhere, Category=Server,meta=(PinShownByDefault))
    	FString PortNumber;
    
    
    
    public:	
    
    	FAnimNode_DataStream();
    	~FAnimNode_DataStream();
    	
    
    	
    	// FAnimNode_Base interface
    	virtual void Initialize(const FAnimationInitializeContext& Context) override;
    	virtual void Update(const FAnimationUpdateContext& Context) override;
    	virtual void Evaluate(FPoseContext& Output) override;
    	virtual void CacheBones(const FAnimationCacheBonesContext & Context) override;
    	// End of FAnimNode_Base interface
    
    private:
    	bool DoReconnect;
    };
```

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [September 6, 2017, 2:21pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/8 "2017-09-06T14:21:25Z")

</div>

Hope that helps! 🙂

---

<div class="post-metadata">

**Author:** ![ShreddinPB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShreddinPB](https://forums.unrealengine.com/u/ShreddinPB)\
**Post date:** [April 4, 2018, 9:21pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/9 "2018-04-04T21:21:07Z")

</div>

I am also trying to use those tutorials in 4.18 or 4.19 and cant get them to work. I tried your code here and UE4 cant find “AnimNode\_DataStream” Has this been replaced in newer versions with something else?

---

<div class="post-metadata">

**Author:** ![antithing](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@antithing](https://forums.unrealengine.com/u/antithing)\
**Post date:** [April 14, 2018, 1:58pm UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/10 "2018-04-14T13:58:45Z")

</div>

Heya, that is the name of my class. In the above example, that should be: `#include "AnimNode_NAME.h"`

---

<div class="post-metadata">

**Author:** ![VinayakP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VinayakP](https://forums.unrealengine.com/u/VinayakP)\
**Post date:** [June 16, 2020, 3:01am UTC](https://forums.unrealengine.com/t/create-animation-graph-nodes/368343/11 "2020-06-16T03:01:00Z")

</div>

Hi,  
I’m still interested in this topic

I want to create a simple Anim Graph in C++, it can be as simple as an **IDLE** animation node connected to **FINAL ANIMATION POSE** via **DEFAULTSLOT** node

 ![304535-2020-06-16-08h06-34.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/4/164aacf0c5255e2492945b27d74c74e795e69274.png)
