How to use the Node Graph API

Started by Buena Vista · 9 months ago · 1 reply · 99 views

#1
Buena Vista
Member
JoinedJul 2022 Posts4 Score230
I noticed that you have the ability to make your own Node Graph UI that could be used for bespoke tools specific to your game, but how do you usually use it? I haven't seen much documentation for it and the documentation I can only use as reference was ShaderGraphPlus and the S&box source code.
#2
fishy
Member
JoinedFeb 2023 Posts82 Score1,548
Mostly through implementing the interfaces that are used to interact between graph functionality.
  • IGraph is the graph.
  • INode is the node.
  • IPlugIn and IPlugOut are, well, the in and out plugs.
To display them in a widget, you can use a GraphView.

These interfaces have built in functionality to interact with each other and do a lot of the heavy lifting for you simply by implementing the interfaces.

There's a lot of other interfaces built into Node Graph such as INodeType and probably a few others I'm forgetting - you can look in Graph.cs to see all the major ones.

It's a pretty complex task. If I have time in the new year I might try and compile some information on them and do a write up, but for now documentation is limited. ShaderGraph and ActionGraph should contain enough source code to pull apart and get things working. There's just a lot of reverse engineering required to piece together what is going on.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.