Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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

Product Version: UE 4.20
more ▼

asked Nov 29 '18 at 04:53 PM in C++ Programming

avatar image

62 5 7 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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:

 virtual void CreateOutputSideAddButton(TSharedPtr<SVerticalBox> OutputBox) override;
 virtual void CreateInputSideAddButton(TSharedPtr<SVerticalBox> InputBox) override;
 virtual FReply OnAddPin() override;
 virtual EVisibility IsAddPinButtonVisible() const override;

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.

more ▼

answered Dec 16 '18 at 11:35 PM

avatar image

62 5 7 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question