# Custom SGraphPin question

**URL:** <https://forums.unrealengine.com/t/custom-sgraphpin-question/20503>\
**Category:** C++\
**Tags:** unreal-engine, Engine-Source-Code, GitHub, Engine-Source-GitHub\
**Created:** [February 6, 2015, 11:02pm UTC](https://forums.unrealengine.com/t/custom-sgraphpin-question/20503 "2015-02-06T23:02:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_6f48ddab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6f48ddab](https://forums.unrealengine.com/u/anonymous_user_6f48ddab)\
**Post date:** [February 6, 2015, 11:02pm UTC](https://forums.unrealengine.com/t/custom-sgraphpin-question/20503/1 "2015-02-06T23:02:16Z")

</div>

I’m trying to find a way to create a custom SGraphPin input pin that assigns a custom blueprint-exposed struct from within the blueprint editor graph. Typically you would do this by assigning specific properties of your struct from a custom pin but I would like to assign the actual full struct and all properties it contains. The problem is, the VM doesn’t allow you to emit literals for custom types within blueprints. If anyone has any workarounds for that, I’d love to hear it.

So as a workaround, I would like to access the actual struct that the pin is representing from within my custom SGraphPin. I figure there must be some way I can directly assign to the object that the pin represents. If it were a UObject-derived type I was assigning to, I could set the default object from GraphPinObj-\>GetSchema()-\>TrySetDefaultObject() but this won’t work with a struct as TrySetDefaultObject() expects a UObject pointer.

Is there a way I can get a reference or pointer to the actual struct that my custom SGraphPin represents? Or even if it is possible to call a specific constructor/operator of my struct.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c91def4e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c91def4e](https://forums.unrealengine.com/u/anonymous_user_c91def4e)\
**Post date:** [October 19, 2015, 11:40pm UTC](https://forums.unrealengine.com/t/custom-sgraphpin-question/20503/2 "2015-10-19T23:40:45Z")

</div>

> **[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 — https://unrealcommunity.wiki/! You will be able to find content from...

---

<div class="post-metadata">

**Author:** ![nansP](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nansP](https://forums.unrealengine.com/u/nansP)\
**Post date:** [April 17, 2020, 10:09am UTC](https://forums.unrealengine.com/t/custom-sgraphpin-question/20503/3 "2020-04-17T10:09:19Z")

</div>

Hi, I know this is old but for peoples who struggled with this as I did, I make a repository with examples to show how to **create custom SGraphPin**

> **[GitHub - NansPellicari/UE4-HowTo-CustomPin: Unreal Engine 4 - How to create...](https://github.com/NansPellicari/UE4-HowTo-CustomPin)**
>
> Unreal Engine 4 - How to create custom pins. Contribute to NansPellicari/UE4-HowTo-CustomPin development by creating an account on GitHub.

Hope it helps!
