Custom Bluprint nodes with C++ function code in-editor :-o

You really never needed to make VS project :stuck_out_tongue:
What you doing is interesting, keep it up. Does it create static function btw?

sounds promising :slight_smile:

An UObject is created by the K2Node_ custom node then the K2 uses KismetCompiler utilities to copy the generated UFunction from that UObject, spawn that ā€œnodeā€ (invisible) onto the Ubergraph, move itā€™s own connections from generated pins into the spawned node, detach itself to not be called twice and then let the Blueprint Graph do its job executing the ā€œgeneratedā€ node.
Later the UObject is GCed if thereā€™s no more K2Node_ referencing him anymore (Kismet Compiler has no use to it anymore so itā€™s garbage collected).
Itā€™s the same thing all Blueprint Nodes behind the scenes in runtimeā€¦

Iā€™m building my own IntelliSense tech.
I call it IntelliNonsenseā„¢

LOLā€¦ this is totally not Unity rofl :rolleyes:

Very impressive, well done!

Working at home last night I put some effort into this *IntelliNonsense *thingyā€¦
It runs using Unrealā€™s UProperty reflection + some more hackery:

Another cool and important thing Iā€™ve added is that, if I Ctrl + click a class in the text editor then it launches docs URL (I use that much more than Visual Studioā€™s F12 which sometimes stop working anyway); For example, if I Ctrl + click on UObject word anywhere on the script then the editor launches Chrome on this docs page for me (I canā€™t work without these docs pages :slight_smile: ):

Could you do some benchmarks?
BP only
BP nativized
C++ Only
And your Function Nodes doing some sorting or something like that.
Would like to see some performance test and to see whether your effort is actually worth :stuck_out_tongue:

The cost is exactly the same cost of calling a Blueprint function node.

The difference is within a Blueprint function graph you can have another tons of nodes in there and each of those nodes add up another ā€œKismet callā€ cost.

I can have over a thousand functions inside this nodeā€¦ The cost for a ā€œKismet callā€ is still going to be just 1. Everything within after that is C++ land.

Only the ā€œExecuteā€ function is the Kismet cost (Blueprint overhead)
Itā€™s the only thing that the Kismet Compiler, well, executes.

Okay, last post then I stop flooding this topic :stuck_out_tongue:
I got reflection-based auto complete workingā€¦ Now I can use this thing more seriously lol

2 Likes

That is it! This has gone too far to stop, donā€™t you think? Iā€™m really excited about this and have two questions:

  1. Do you need to open VisualStudio in the background for this?
  2. Can you do everything you could do in VisualStudio, I mean do we need to use VS after having this?
    ā€¦ok make it three :stuck_out_tongue:
  3. Is it possible to make this into a plugin and share/sell it, and are you thinking of doing that?

Also, Iā€™m not op but I wouldnā€™t mind this kind of ā€œfloodā€ :smiley:

2 Likes

No, just need to have it installed so Unreal can use HotReload with C++ Compilerā€¦ The project must be a C++ project, but I donā€™t keep Visual Studio open at all.

I donā€™t think this is a replacement to Visual Studio.
However some times I just want to make some foreach loops or write my functions instead of dragging wires around, but I donā€™t want to wait for VS to launch either. I just want to write the function and see it there in the graph on the exact place where itā€™s called without wasting time on extra steps such as creating function library classes.
Blueprints are great, but sometimes just typing on a keyboard to create a function is simply faster than connecting wires to nodesā€¦
ā€œLess time waiting for things to happen!ā€, this is why Iā€™m making this, I need to reduce time spent on the overall ā€œcodingā€ workflow, ā€œless rocks on the wayā€ :slight_smile:

In fact this is a plugin that I built and I could share it.
However there are a few problems I see about sharing this:

  • I would need written permission. Some pieces of this plugin I wrote on my workplace which makes the company legally owner of this tool; they would have to allow me to make it public.

  • I donā€™t have a lot of time to create documentation, tutorials, etc, besides a few example nodes. This could become a problem if I make it publicā€¦

  • And I believe EpicGames has in the EULA something saying we canā€™t sell scripting/coding systems for Unreal, it must be shared for free :stuck_out_tongue:

  • And finally, thereā€™s the fact this isnā€™t complete yet, right now itā€™s more like something in ā€œalphaā€ state.

Thatā€™s just great!

I donā€™t have much experience with VS (I hated it since the first time I tried to use it) but from your gifs, we could do most of the stuff without opening VS at all using this. this is more useful than just clearing some rocks. Because it allows to use all the functions unavailable to BP in BP.

Wow, that is some hardcore law abiding :stuck_out_tongue:

Huh, didnā€™t know about that.

Well, no pressureā€¦ we can wait hehe :wink:

Even if Bruno releases it for FREE we which know a bit or two of C++ and engine source could keep it alive as a community thing than an one dev only thing. Just a thought.

Alright I got all permission I needed :slight_smile:

Now I have to start writing basic documentation and include a few dozen coded nodes as examples, explaining the basics of Unrealā€™s C++ for the people struggling with the language (my little brother included);

In a month or two I shall upload the tool to both Marketplace and GitHub (for those who might want to contribute improvements)

I have a tiny little problem :rolleyes:

Does anybody out there have experience in writing a parser for C header files? without using LibClang??
The only way for the little node editor to detect (and show tips like IntelliSense does) from variables and functions that arenā€™t exposed as UFUNCTION() and UPROPERTY() is me writing a header parser to collect those declarationsā€¦ And oh boy this stuff is hard :

My autocomplete system is based on Reflection so anything not UProperty it canā€™t see (unless I parse declarations from a scriptā€™s header and manually inject the declaration into the sematics database), Iā€™ve injected ā€œContextā€ as a variable declaration of type *UMagicNode *class into the semantics database just to see if that would work and seems like the ā€œClass Pointer Parserā€ is working fine, it now understands that ā€œContextā€ is a variable of type UMagicNode *class declared in body of Execute function, but oh boyā€¦

Parsing header files without any reflection data is going to be far from easy:


Yep, working just fine; testing again Iā€™ve injected ā€œ_Xā€ as if it was a variable declaration of AActor* and the thingy found it.
Now I just need a header parsing algorithm >.<

Canā€™t you use UHTā€™s source?

Iā€™ve been following this thread and Iā€™m eager to see this on the Marketplace.ā€‹ā€‹

Hmmā€¦
I donā€™t know if that would help btw, because if it isnā€™t exposed as UProperty or UFunction I donā€™t know if UHT can even see those declarations.
But I will lurk into UHTā€™s source and try to find clues, thanks!


Oh from there Iā€™ve found something really helpful:



Engine/Source/Runtime/Core/Public/Misc/Parse.h


Thereā€™s helper functions to parse source code ā€œtokensā€ in there, this is going to be useful!

Before the year ends I wanted to finish this as wellā€¦
Nodeā€™s source can be also edited from its asset package (they wonā€™t exist in built game, they only exist in Editor!)

So we will be able to share nodes as assets between projects and machines (instead of sending whole copies of Blueprints), then attach that source into a node and hit compile, the base C++ class is generated (as if the user went through the whole process of creating and setting up a plugin to host his custom Kismet node, but skipping the headaches):

Now itā€™s party time!
Happy new year guys, till later :]

I wrote a movement input node just to see if I couldā€¦
turns out we can lol

Last night while creating an array sorting example, Iā€™ve added an option for anyone to change a nodeā€™s class title color.
If you change the color of a class X, all the nodes on graphs will auto update the color they display: