GraphView official support

Hi! There are UIElements examples at both in a repo from Unity over github and samples inside Unity 2019.2. But I couldn’t find any official documentation about GraphView. So is there anywhere that I can find examples with the most up-to-date version of api ? Also do you have plans for making examples for GraphView as well ?

2 Likes

GraphView is not officially supported as a standalone API. It is only meant to be used by internal teams, like ShaderGraph. As such, there are no officially maintained examples or documentation. This could change in the future, but no such plans as of yet.

3 Likes

I’ve been using ShaderGraph for reference ever since they released it’s source code. It’s useful enough and accessing it through your Package folder guarantees you’re looking at the same API version your project is running on, at least.

2 Likes

Well, I’d make a feature request but I don’t think it would likely to change something. Yet, I’ll do that anyways. But I must say, there are lots of people that playing with GraphView and building tools on top of it. So it would be wonderful if you guys would make this api as officially supported.

Thank you, I’ve started to look into that as well. But I couldn’t find where they are creating a new asset file for graph yet. I am still investigating. Although, I am open to any hints. :stuck_out_tongue:

3 Likes

Yeah, I am developing custom tools with GraphView. I also wish it could be supported in runtime mode, so we can build desktop tools with unity!

1 Like

+1 here. please keep GraphView API be public at least.

4 Likes

Too many internal tools use it so there’s very little risk the GraphView API will be removed or made private. And we do hear you! Will will eventually give GraphView more attention. We just have higher priorities at the moment.

13 Likes

+1 for documented and official support for GraphView.
making tools with it could open up doors to many time saving and improved visualizing workflow of many things, not just visual programming, but also flow charts/game progression and others.
Right now it’s not super intuitive, and requires a lot of setup that can be encapsulated into the API.

2 Likes

Hi, would you mind sharing a little boilerplate template project of yours to get started with? That would help a lot of developers out there.

1 Like

I can probably try to do that. Just need some free time.

1 Like

+1. I just enter to ask for the same feature.
I haven’t use the graph view yet, but it would be great to be able to make GUIs with nodes, both for internal use, and for user input too. We could build our own behaviout trees, use it for our Dialogue Systems, etc. But I’d also love to see it working at runtime, so that the user can use it to control elements of the game.

1 Like

+1 and im wondering if the classes could be exposed to the ui builder

If you want, Unity have published the scripting API for GraphView

Yeah, from last year May to now, I have bugged in into shader graph source code and a few other experiments that people worked on. So I have made a series of tutorials about using GraphView Api to make a Dialogue system. But you can use this to do pretty much anything you need such as a Behavior tree or a visual scripting solution.

Just leaving it here in case anyone is checking this tread:

https://www.youtube.com/watch?v=7KHGH0fPL84

17 Likes

I just stumbled upon this thread, and I had recently found your video when trying to figure out GraphView.

I’m really glad that you did the work to demystify this experimental API, because it’s definitely one of the hidden gems of Unity at the moment.

3 Likes

Just ran into this thread. I’m curious what all of those assets that have graph editors (like Amplify Shader Editor) use for their graph view? Is there any other library, or does everyone just roll their own?

I’ve been playing around with the Unity.Experimental.GraphView API but ughhh … while I like UIElements I’m not sure how I feel about GraphView. Seems the API could be made simpler, especially considering how you have to keep adding everything back and forth. I’d imagine a lot of the manual work could be done with just some clever event subscription between the graph and the view.

https://github.com/alelievr/NodeGraphProcessor

and

https://github.com/McManning/BlueGraph

However - bear in mind (in typical Unity fashion) this warning: https://github.com/alelievr/NodeGraphProcessor/issues/73#issuecomment-671071879

So - come back in a year and there might be a public supported library. Which of course might get deprecated 6 months after that :wink:

Interesting! I looked around a bit and found two different ones hehehe

https://github.com/Seneral/Node_Editor_Framework and https://github.com/Siccity/xNode

I guess I’ll just build my asset as agnostic of the graph editing library as possible so that I could switch to a different one if needed.

One thing I’m wondering though is why are there already four different ones with similar levels of activity + two ones from Unity. I guess the not-invented-here principle is strong :smile: Maybe I should roll my own as well, could be fun.

1 Like

None of the Unity ones are official to my knowledge so I guess developers just like scratching their own itches.

xNode is much older and doesn’t use the new UI framework.

Makes sense! I went through them and yeah looks like you’re right, I guess I even prefer tha xNode uses ImGUI since it makes it really easy to change and super stable. It’s not the prettiest, but looking at code size (even comparing to things like ASE or NodeCanvas implementaions) it seems like it might be easy to extend/change.

Hopefully we’ll get an official solution soon, though I’m a bit worried if it wouldn’t make things too tied to Unity’s architecture instead of drawing general graphs, but that’s just a wild guess. Ideally I’d imagine just building an ImGUI layer directly on top of my own graph structure, without needing a copy of the graph in some UIElements data structures. Though I’m not really sure which approach would scale the best with huge graphs.