# Arrays as pins in AnimGraphNode

**URL:** <https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773>\
**Category:** Mobile\
**Tags:** unreal-engine, CPP, question\
**Created:** [June 26, 2014, 4:06am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773 "2014-06-26T04:06:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![darkZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkZ](https://forums.unrealengine.com/u/darkZ)\
**Post date:** [June 26, 2014, 4:06am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/1 "2014-06-26T04:06:59Z")

</div>

Hi,

I am trying to implement arrays as inputs to an AnimGraphNode. I can only create pins for individual elements for the array but not the entire array. Would anyone have pointers as to how I would go about creating a pin for an entire array ?

Here’s how I have to handle arrays at the moment. It kind of works for this example but this breaks when I have to pass an array of transforms for the entire character ( ~90 elements), which I process in the event graph.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/0/507b63de1878d672687d2362553756849e0ce1eb.png) ](https://i.gyazo.com/6748cc8f9a9387d34a44bbc0bc73bd2e.png)

And this is what my AnimGraphNode implementation looks like :

```
UCLASS()
class UAnimGraphNode_DataDrivenBone : public UAnimGraphNode_SkeletalControlBase
{
	GENERATED_UCLASS_BODY()

	UPROPERTY(EditAnywhere, Category=Settings)
	FAnimNode_DataDrivenBone Node;

public:
	// UEdGraphNode interface
	virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
	virtual FString GetNodeNativeTitle(ENodeTitleType::Type TitleType) const OVERRIDE;
	virtual FString GetTooltip() const OVERRIDE;
	// End of UEdGraphNode interface

	virtual void CreateOutputPins() OVERRIDE;
protected:
	// UAnimGraphNode_SkeletalControlBase interface
	virtual FText GetControllerDescription() const OVERRIDE;
	// End of UAnimGraphNode_SkeletalControlBase interface

};

```

I define the arrays inside the FAnimNode\_DataDrivenBone structure definition.

One example is below :

```
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = DataDrivenPose, meta = (PinShownByDefault))
	TArray<FVector> Query;

```

Many thanks.

darkZ

---

<div class="post-metadata">

**Author:** ![mamoniem](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mamoniem/32/1194698_2.png) [@mamoniem](https://forums.unrealengine.com/u/mamoniem)\
**Post date:** [June 26, 2014, 9:44am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/2 "2014-06-26T09:44:25Z")

</div>

could you post a screenshot for the code sample, so we can use it as a start point ?

---

<div class="post-metadata">

**Author:** ![darkZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkZ](https://forums.unrealengine.com/u/darkZ)\
**Post date:** [June 26, 2014, 10:40am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/3 "2014-06-26T10:40:27Z")

</div>

I just edited my question with some more details. Please let me know if you need more details.

---

<div class="post-metadata">

**Author:** ![Ragun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ragun](https://forums.unrealengine.com/u/Ragun)\
**Post date:** [December 3, 2015, 11:30pm UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/4 "2015-12-03T23:30:48Z")

</div>

I am running into this same problem, and really hope this question is eventually answered. I can add elements to pins once I add elements to the array, but I would really be able to plug in an array of dynamic length.

---

<div class="post-metadata">

**Author:** ![Alexallright](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alexallright](https://forums.unrealengine.com/u/Alexallright)\
**Post date:** [October 11, 2016, 11:11am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/5 "2016-10-11T11:11:33Z")

</div>

Any updates? Thank you!

---

<div class="post-metadata">

**Author:** ![pmach](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pmach](https://forums.unrealengine.com/u/pmach)\
**Post date:** [February 13, 2017, 4:55pm UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/6 "2017-02-13T16:55:44Z")

</div>

Hi, is there any solution yet on how to plug in a dynamic array for an input pin?

---

<div class="post-metadata">

**Author:** ![Alexallright](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Alexallright](https://forums.unrealengine.com/u/Alexallright)\
**Post date:** [February 16, 2017, 11:37am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/7 "2017-02-16T11:37:42Z")

</div>

I have implemented this using custom structure:

```
USTRUCT(BlueprintType)
struct FBonesTransfroms
{
	GENERATED_BODY()
	/*Array of names*/
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "BonesTransfroms")
		TArray <FName> Names;
	/*Array of transforms*/
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "BonesTransfroms")
		TArray <FTransform> Transforms;
};

```

Then I just use this structure in my AnimNode\_SetBonesTransforms.h:

```
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = SkeletalControl, meta = (PinShownByDefault))
		FBonesTransfroms BonesTransfroms;

```

and AnimNode\_SetBonesTransforms.cpp:

```
void FAnimNode_SetBonesTransforms::EvaluateComponentSpace(FComponentSpacePoseContext& Output)
{
	ComponentPose.EvaluateComponentSpace(Output);
	if (BonesTransfroms.Transforms.Num() && BonesTransfroms.Names.Num())
	{
        //some code
    }
}

```

![126533-setbonestransforms.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/d/e/0dedfd5d9830ccb95e78ce86fd62ff104a9fe1e9.jpeg)

---

<div class="post-metadata">

**Author:** ![galuodo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@galuodo](https://forums.unrealengine.com/u/galuodo)\
**Post date:** [August 9, 2022, 2:20am UTC](https://forums.unrealengine.com/t/arrays-as-pins-in-animgraphnode/286773/8 "2022-08-09T02:20:59Z")

</div>

Your code is very helpful.  
I have question about how you find the bone by bone name in animnode?  
Thank you
