Does anybody knows how to create UFunction objects and make them show up in a Blueprint’s “Functions” list, using C++ code?!
Note that I don’t mean using UFUNCTION(…) macro in C++, not what I am looking for…
I mean, where are the functions used by the UEditor to add a function to the Blueprint graph when you hit the “+” in Editor, like this:
I want to make an extension capable of adding UFunction to a Blueprint without any C++ parent function, like the Editor does.
BlueprintObj variable declared as UBlueprint*. bAllowDeletion don’t allow user to delete this function.
To view great example of programmatically creation and filling function with nodes you have to find “FBlueprintEditor::CollapseSelectionToFunction” function in source code.
Just one more thing I’m struggling with though…
Would be perfect if I could as well set the Category for the generated blueprint function; I tried UField or UFunction → SetMetadata(), but it didn’t work… Any ideas?
Just one more thing I’m struggling with though…
Would be perfect if I could as well set the Category for the generated blueprint function; I tried UField or UFunction → SetMetadata(), but it didn’t work… Any ideas?
It seems BP compiler takes whole metadata for functions from the entry point nodes. You can try to get entry point node from a function graph and set metadata there:
There could be a lot of entry points in the graph, but separate function graphs have only one entry normally. FunctionEntry node have its own MetaData entry which is visible in the blueprint editor.