At work we are currently investigating how we could add a reasonably sane optional type for blueprint.
We have modified the native TOptional type heavily, to make it more convenient, by adding Map()/Bind()/Flatten() methods.
Now we would like to add a similarly convenient optional type for Blueprint use.
We have already started working on a UBlueprintCompilerExtension to detect invalid pin connections, but we haven't started on the actual data type itself.
Does anyone know about a plugin that offers this functionality?
Or, alternatively some good resources on how one can write custom Blueprint graph nodes with wildcard pins?
No news as of yet. This topic is not directly related to any of our projects and our R&D team is busy with more pressing matters, so we are currently only working on it on what we call "Lab Days", meaning one day per month. The next Lab Day is Friday in 2 weeks, so that's the earliest time anything noteworthy on that topic might happen.
I might have some ideas but I have more follow up questions if you don't mind.
Would you want to support structs and/or bp structs with this or just the basic unreal types like integrals, strings etc.?
Do you see this as using execution pin branching like the branching IsValid node? Execution passthrough like BlueprintCosemetic/BlueprintAuthorityOnly functions? Or some kind of setup with pure nodes that no-op if the optional isn't set?
I'm also curious if your team would actually be able to get decent value from this. Optional chaining can get a little tricky to comprehend, especially with map/bind/flatten. Do you have enough people working in blueprint who would be able to make good use of these? Would your less technical designers be able to understand and modify graphs built with optionals?
I'm sure your engineers would appreciate optionals when working in blueprint but personally I find that any time I need to write more than trivial logic in BP, I'll get it done faster if I just write it in C++. Not to mention the fact that blueprint vm performance can become a problem really quickly so I prefer not to let implementation live there for too long outside of minimal content-specific functionality in BlueprintImplmentableEvents.