Add pin buttons on input AND output side
Hello there :)
I'm developping a plugin where I need a node to have variable numbers of inputs and outputs. I would like this custom node to have an "Add In Pin" button on left side of it, and an "Add Out Pin" button on the right side.
I already managed to have the classic "Add Pin" button on right side that adds an input pin, but I want to change this behavior.
Don't hesitate to give me C++ and UE4 references, I already looked in them and couldn't find how to use the "CreateOutputSideAddButton" and "CreateInputSideAddButton" of SGraphNode in my custom K2Node...
Any idea? Thanks in advance :) Bye
asked Nov 29 '18 at 04:53 PM in C++ Programming
So I think I found how to do it.
You would need to create a new SGraphNode (inherited from SGraphNodeK2Default if it's in blueprints), and implement the methods:
You can use the code present in SGraphNodeK2Sequence.cpp, as it basically does implement an "Add pin" button. Then, you can cast your node to anything custom you made and link those two buttons to different actions.
In order for the custom SGraphNode to be detected, you need to register it with a Factory. You can check on the wiki tutorial about custom blueprint pins, and readapt the factory part code to node instead of pins. It's basically the same thing.
answered Dec 16 '18 at 11:35 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here