Thanks for watching the stream! Sorry for the delay, it took a while to get this information together, and I also came up with some new things for a Part 2 stream, hopefully soon after GDC.
To start off, here are some useful documentation pages for this topic:
https://docs.unrealengine.com/en-US/…rence/Metadata
https://docs.unrealengine.com/en-US/…ons/Specifiers
On to the questions! I was able to get all of them except #2.
1: The StructBox plugin is a good example of this. Using the reference pages above, you can read up on the “CustomStructureParam” Meta tag and the “CustomThunk” Specifier. Those are the two pieces you need, along with the DECLARE_FUNCTION macro. For a really good example, look at the StructBox plugin that ships with the Engine. By default, this Plugin is disabled, but you can read the code, and you can enable the plugin to test it out in the BP graph editor.
2: Still working on this one! I’m not really sure what the rules are just yet.
3: Passing delegates is possible, but a little complicated. Here’s a simple example you can use:
At the top of our .h file:
// Declare our delegate types. Note that the function parameter and the variable are declared with different macros.
DECLARE_DYNAMIC_DELEGATE_OneParam(FMyTestDelegate, int32, TestIntParameter);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FMyOtherTestDelegate, int32, TestIntParameter);
In our class (in the .h file):
// This function takes a delegate and can execute it as appropriate.
UFUNCTION(BlueprintCallable)
void DelegateTestFunction(const FMyTestDelegate& Callback);
// This will be visible in Blueprints, and we can pass it into DelegateTestFunction.
UPROPERTY(BlueprintAssignable)
FMyOtherTestDelegate OnSomeOtherEvent;
4 and 5: Both variables and functions have a “Category” dropdown in the BP editor. You can create multiple levels of hierarchy by typing into that dropdown with a value like “Category|Subcategory”. Once that’s done, you can drag other variables or functions into it, or set them with the dropdown. You can also do this in code with the “Category” Specifier in code, using the same syntax. Also in code, you can specify functions that explicitly list after other functions, or you can assign integer priority values to functions to affect their listing order. See the Metadata page linked above, and look for “DisplayPriority” and “DisplayAfter” for more information.
BONUS: Cast nodes changing from Pure to Impure with right-click came up in the stream. This is done in code and is fairly complex, using the UK2Node and UEdGraphNode interfaces. Check K2Node_DynamicCast.cpp and K2Node_DynamicCast.h for the actual “cast node” implementation, or look through those two parent interfaces for full details.
BONUS: To make a BP node with multiple output exec pins, make an enumerated type to provide the pin list. Give your function an output parameter of that enumerated type (by “output parameter” I just mean a reference to the enum type), and set the Meta tag ExpandEnumAsExecs to the name of that parameter in your UFUNCTION macro.
In the .h file:
UENUM()
enum class EMyOutputEnum : uint8
{
EPinZero,
EPinOne,
EPinTwo
};
Declaring the function in the class definition within the .h file:
UFUNCTION(BlueprintCallable, Meta = (ExpandEnumAsExecs = "OutputPinParameter"))
void MultipleOutputs(int32 InputParam, EMyOutputEnum& OutputPinParameter);
In the .cpp file:
void AMyActor::MultipleOutputs(int32 InputParam, EMyOutputEnum& OutputPinParameter)
{
// Just make sure you set this at some point before exiting.
OutputPinParameter = EMyOutputEnum::EPinOne;
}