Skip to content

Heinhain/UE4-HowTo-CustomPin

 
 

Repository files navigation

Unreal Engine 4 - How to create custom Pins

This repo is a simple guide about how to create custom Pins in the Unreal Engine 4 editor.

Demo

This implementation has been inspired from the detailed post:
https://wiki.unrealengine.com/How_To_Create_Custom_Blueprint_Pin.

/!\ When this repository has been created, the UE wiki has been removed from the Epic staff due to security problems.
Nonetheless they gave access of an archive with all the wiki contents.
Inside you can find the same article in the following path:
WikiPages/Unreal%20Engine%20Wiki/mediawikiv2-website-prod05.ol.epicgames.net/index0275.html

Tables

Introduction

^ tables

Goals

^ tables

It's a simple repository to show you how to:

  • create new pins for nodes in the editor graph
  • make it work associated to custom settings data

Repo contents

^ tables

This project is composed of:

  • a simple UE4 c++ blank project ready to build and start
  • a custom plugin to give also an example of plugin management, in it you will find:
    • custom pins classes
    • a factory to register these pins to the editor graph
    • custom structs which can be used as any UPROPERTY or UFUNCTION parameters to display our new pins in blueprint nodes
    • a custom config object used to create new possibilities to our pins choices (configuration located in UE4 project settings)

Make it work: step by step guide

^ tables

1 - Open blueprint level

^ tables

Example is located in the blueprint level, so open it:

Step 1 - Open blueprint level

2 - Locate blueprint nodes

^ tables

Choices are empty for now, don't panic, some are coming soon!

Step 2 - Locate the blueprint node

3 - Open project settings

^ tables

Step 3 - Open project settings

4 - Open custom settings

^ tables

Step 4 - Open custom settings

5 - Add new config names

^ tables

5a - Simple config name

^ tables

Step 5a-1 - Add new config name Step 5a-2 - Write it

5b - Nested config name

^ tables

Step 5b - Add new config name

6 - Compile

^ tables

Step 6 - Compile

7 - Change nodes in the blueprint

^ tables

Step 7 - Change nodes in the blueprint

8 - Save and play

^ tables

Step 8 - Save and play

9 - See your choosen config printed

^ tables

Step 9 - See your choosen config printed

Implementation notes

^ tables

You should take a look at each classes to see implementations details, but before just a quick glance of what it is composed of:

^ tables

Not really interesting, just look at the "plugins" section which import the main plugin.

Main Source directory

^ tables

Except the UE4HowtoCustomPin.Build.cs file to see dependencies, it's not worth it. I didn't do anything in it, it's all default content created with Unreal Engine boilerplate.

CustomPin Plugin

^ tables

All the job is done here!
You can look at the CustomPin.Build.cs to see dependencies.
A quick preview of each classes:

Class files Purpose
FCustomPinModule CustomPin.h/.cpp Is the class which tells to the editor how to proceed when the plugin started, it uses the factory to add our visual pin to the Editor Graph.
FCustomPinFactory CustomPinFactory.h It checks for a given pin if it's associated to our Custom Attribute.
FSimpleNameAttribute SimpleNameAttribute.h This is a simple struct we want our pin to be associated to.
FNestedNameAttribute NestedNameAttribute.h This is a struct with 2 FName properties we want our pin to be associated to.
FMultiNestedNamesAttribute MultiNestedNamesAttribute.h This is a struct with 1 FName property + 1 TArray<FName> property we want our pin to be associated to.
UListNameConfig ListNameConfig.h Thanks to this we can't create a simple project settings menu and a simple list of names data.
UNestedNamesConfig NestedNamesConfig.h Thanks to this we can't create a simple project settings menu and a list of associated names data.
UCustomPinBPLibrary CustomPinBPLibrary.h/.cpp This will create a simple functionnal node which use our CustomAttribute as function's parameter.
SListNameFromConfigPin ListNameFromConfigPin.h/.cpp This is a simple pin object composed of 1 NameComboBox to select a name from our ListNameConfig, it embeds all the behavior, user events, retrieving associated data and UI build.
SNestedNamesFromConfigPin SNestedNamesFromConfigPin.h/.cpp This is a pin object composed of 2 NameComboBoxes to select a name with an associated subname
SMultiNestedNamesFromConfigPin ListNameFromConfigPin.h/.cpp This is a pin object composed of 1 NameComboBox + Checkboxes to select a name with with associated subnames

Next

^ tables

I hope it helps you during your Epic's journey!
If you want to improve this, add contents or keep it up to date with new Unreal version you are very welcome!

I plan to make a serie of UE4 HowTo repositories like it, so keep in touch!

😉

About

Unreal Engine 4 - How to create custom pins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 94.3%
  • C# 5.5%
  • C 0.2%