I would like to create a function that will be similar in some cases to the function of Ease. Specifically, I’m interested in possibility of adding and/or replacing pins, which the function can take. In the second screenshot, you can see how after switching Enum to the function of Ease In (for example), we get the pin of Blend Exp. I want to note that I’m not interested in Wildcard now, for me enough of functional, which I described above.
In general, I was trying to find a method by which the Ease was built and apparently found it in the source files (K2Node_EaseFunction.h/cpp), but it seems too difficult for me at the moment. So, if someone pushes to possibility of learning this method in more “simple language”, I will be very grateful.
There is not other way to do so thats why this function has custom K2Node, same like SpawnActor which do auto casting of output pin, BlueprintCallable is quite limited and you can check all meta options it has by looking in to K2Node_CallFunction (which is function call node), but i don’t see any options you looking for. It’s really hard to do so as optional arguments are not a feature of C/C++, there only default values for arguments which kind of could work that way.
Don’t get get overwhelmed by K2Node_EaseFunction and focus, you simply need to define UI behavior of the node, Study each function one by one and see what they do and try to replicate what it do, each function has a role and your code need to fullfill it there also lot more function you can override in K2Node (ones with V icon):
This node in perticilar seems to work like a macro, in ExpandNode() code creates virtual K2Node_CallFunction, binds ease function UFunction from KismetMathLibrary and virtually repin all the links to new pin so it executes that function in C++. Try to mimic what it is doing.
Here some other example in just found maybe it will be simpler for you:
There one thing i would remove from there and that is Blueprintable, BlueprintableType as this class wont be even usable in blueprints anyway.
Also note that as this tutorial suggest you should create editor module for this as editor APIs wont be avable during packaging and final game you will get compile errors, in normal game project modules are defined in uproject file in case of plugin it is uplugin as tutorial suggest
Well… apparently it will be a big challenge, a big deal) I will follow all your advice, because after everything that was said, read and done, stopping means the same as changing the principle. Many thanks, I’ll keep up to date!