Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Graph Tool Foundation

Discussion in 'Editor Workflows' started by Nexer8, Feb 14, 2021.

  1. kquistorff-bossfight

    kquistorff-bossfight

    Joined:
    Oct 12, 2021
    Posts:
    1
    There is a template class that is used by the OnBoardingProvider and the Create menu. It needs to be swapped out in both places as these are the two paths the asset is created through.

    From my notes - apologies if anything doesn't match I had to do a lot of internal customization.*

    GraphTemplate
    • If we want to instantiate default nodes into every graph we will want to implement this.
    • Otherwise it can be removed.
    • It has a gotcha that two places reference GraphTemplate
      • The OnboardingProvider
      • The AssetModel (create command)
    * I managed to write some generic setter Commands, but had to do some significant alteration to an inherited field class to make it work. The big key was looking at how they are using the getter inside the field class through mild reflection, and replicating that in the set command so that you can just get the property by name, and store it's setter function. (Passing the name into the constructor for the field class was why I did some re-writing of it. I suppose it's possible one could just set a variable instead, but it seemed cleaner.)

    I'm not at liberty to share my code, but I was able to get adding a field to the inspector down to this, with no custom set commands.

    Code (CSharp):
    1. yield return new PropertyField<int>(
    2.                     m_OwnerElement.CommandDispatcher,
    3.                     nodeModel,
    4.                     nameof(DataNodeModel.ExampleInt));
    Still can't use arrays or lists, and you have to register all your field property types, int, bool, vector etc.

    Actually I think I can share this much from my SetFieldCommand class. (Generic set command.)

    Code (CSharp):
    1. // from the model of ModelPropertyField MakePropertyValueGetter
    2.         static Action<TValue> MakePropertyValueSetter(IGraphElementModel model, string propertyName)
    ModelPropertyField was the class I wound up having to make a modified version of for reasons that are now fuzzy. I think implementing:
    Code (CSharp):
    1. var commandType = typeof(SetFieldCommand<TValue>);
     
    Last edited: Feb 24, 2022
  2. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    can anyone help me?
    tried importing the package using manifest, here is what I have :

    {
    "dependencies": {
    "com.unity.graphtools.foundation": "0.11.2-preview"
    },
    "scopedRegistries": []

    When the package is imported into unity, I get following error at compiling the script :

    Library\PackageCache\com.unity.graphtools.foundation@0.11.2-preview\Editor\InternalBridge\GraphViewStaticBridge.cs(290,39): error CS7036: There is no argument given that corresponds to the required formal parameter 'contextType' of 'PointerDeviceState.GetPointerPosition(int, ContextType)'

    Did I do something wrong? how to solve the problem?
     
  3. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    I added previews to my nodes, similarly to shader graph.

    However, I am facing an issue. First, the preview of downstream nodes would not update when an upstream node's model was changed. I fixed that with the following code in the node's UI class (which inherits from
    CollapsibleInOutNode
    ):

    Code (CSharp):
    1.  
    2.         protected override void UpdateElementFromModel() {
    3.             base.UpdateElementFromModel();
    4.  
    5.             var nodeModel = (IInputOutputPortsNodeModel) this.NodeModel;
    6.  
    7.             foreach (IPortModel port in nodeModel.GetOutputPorts()) {
    8.                 foreach (IPortModel target in port.GetConnectedPorts()) {
    9.                     // Get the graphview object corresponding to the current window
    10.                     IModelView view = this.GraphView;
    11.                     UnityEngine.Debug.Log(view);
    12.                     UnityEngine.Debug.Log("uis:");
    13.  
    14.                     foreach (IModelUI ui in target.NodeModel.GetAllUIs(view)) {
    15.                         UnityEngine.Debug.Log(ui);
    16.                         ui.UpdateFromModel();
    17.                     }
    18.                 }
    19.             }
    20.         }
    21.  
    I still have one issue - the previews of downstream nodes do not get updated when a port is connected or disconnected. To fix this, I tried the following code in the node's class (which inherits from
    NodeModel
    ):

    Code (CSharp):
    1.  
    2.         // Refresh UI when an input is connected
    3.         public override void OnConnection(IPortModel self, IPortModel other) {
    4.             base.OnConnection(self, other);
    5.  
    6.             if (self.Direction == PortDirection.Input) {
    7.                 this.RefreshUI();
    8.             }
    9.         }
    10.  
    11.         // Refresh UI when an input is disconnected
    12.         public override void OnDisconnection(IPortModel self, IPortModel other) {
    13.             base.OnConnection(self, other);
    14.  
    15.             if (self.Direction == PortDirection.Input) {
    16.                 this.RefreshUI();
    17.             }
    18.         }
    19.  
    20.         private void RefreshUI() {
    21.             foreach (
    22.                 IModelUI ui in this.GetAllUIs(
    23.                     EditorWindow.GetWindow<TerrainGraphWindow>().GraphView
    24.                 )
    25.             ) {
    26.                 ui.UpdateFromModel();
    27.             }
    28.         }
    29.  
    This does not work, even though it is basically the same code as above. The preview does not update until I click the node in question. I have verified that
    GetAllUIs
    returns the same value as the code that works, so I have no idea why this wouldn't work.

    Additionally, I can do things like changing the node's color in
    RefreshUI()
    , so the method is being called correctly and running on the correct node. It's just
    UpdateFromModel()
    that for some reason does not refresh the UI.

    I am at a loss as to what to try next. I have tried all things I could think of!

    I would super appreciate any ideas on what to do to fix this. Thank you!!

    Update: I seem to have pinned down the issue! When the node in question updates its view, the ports still appear as connected! Weird behavior, but I suppose this is what I get for working with a discontinued package.

    Update 2: Managed to figure out a workaround! I mark the node model as dirty with a custom field in the OnConnection/OnDisconnection callbacks, then look for that flag in the graph window's Update() callback and call UpdateFromModel() there. This is crazy, I could spend this mental effort solving general AI or something easier like that :D

    Here be the code in the graph window:

    Code (CSharp):
    1.  
    2.         protected override void Update() {
    3.             base.Update();
    4.          
    5.             this.GraphView.Nodes.ForEach(node => {
    6.                 if (node.NodeModel is BaseNode baseNode && baseNode.dirty) {
    7.                     node.UpdateFromModel();
    8.                     baseNode.dirty = false;
    9.                 }
    10.             });
    11.         }
    and here is the code for the node model:

    Code (CSharp):
    1.         // Refresh UI when an input is connected
    2.         public override void OnConnection(IPortModel self, IPortModel other) {
    3.             base.OnConnection(self, other);
    4.  
    5.             if (self.Direction == PortDirection.Input) {
    6.                 Debug.Log($"input connected from {this.Title}");
    7.                 this.DirtyDownstream();
    8.             }
    9.         }
    10.  
    11.         // Refresh UI when an input is disconnected
    12.         public override void OnDisconnection(IPortModel self, IPortModel other) {
    13.             base.OnDisconnection(self, other);
    14.  
    15.             if (self.Direction == PortDirection.Input) {
    16.                 Debug.Log($"input disconnected from {this.Title}");
    17.                 this.DirtyDownstream();
    18.             }
    19.         }
    20.  
    21.         // Mark this node and downstream nodes as dirty.
    22.         public void DirtyDownstream() {
    23.             this.dirty = true;
    24.  
    25.             var nodeModel = (IInputOutputPortsNodeModel) this;
    26.  
    27.             foreach (IPortModel port in nodeModel.GetOutputPorts()) {
    28.                 foreach (IPortModel target in port.GetConnectedPorts()) {
    29.                     if (target.NodeModel is BaseNode baseNode) {
    30.                         baseNode.DirtyDownstream();
    31.                     }
    32.                 }
    33.             }
    34.         }
     
    Last edited: Mar 2, 2022
  4. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    New question: Does anyone know how to find the counterpart of a portal? I have the edge and the portal in the code, but can't find a way to reach the node on the other side.

    Edit: Decided to just not support portals. The thing is to remove these from the contextual (right click) menu, I had to create a GraphView-derived class and override BuildContextualMenu. I couldn't find a way to change the menu, only could create it myself (so weird). So I copied the original code and commented out what I wanted to remove, and because some members in that code are internal access only, I had to remove a bunch more functionality than I wanted (such as node color changing).
     
    Last edited: Mar 3, 2022
  5. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    One last question: Is it possible to run a graph (graph UI not needed) in a build? I want to generate terrain at runtime based on the node definitions... but this seems impossible at the moment. Did I just waste a bunch of time? :(

    Edit: I swear I'm about to read the graph asset file and build back the logic from the YAML lmao

    Edit 2: I ended up an attempt at making graph tools foundation build-friendly. Here's the repo if anyone's interested! It's looking good so far, I finished working on that and am now updating my own graph-related code.

    Edit 3: Aaand I got it to work in a build! It would be hard to retrace my steps as I had to isolate a lot of my code with
    #if UNITY_EDITOR
    statements, but feel free to clone the repo and give it a shot if you're interested.
     
    Last edited: Mar 8, 2022
  6. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    It's unfortunate that any progress on GTF is internal only. Like, what are even the options?

    IMGUI is really painful to work with in graph context.

    GraphView API is forever experimental and as good as deprecated and adapting it at this point in time seems pointless but possible. Resources on using it seem to be pretty scant too.

    Unity Visual Scripting graphs are nice to use but the tool is undergoing fundamental changes every few months (at least internally) which introduces a lot of instability, especially if you want to deploy on AOT platforms. UVS also can't be sandboxed only to expose my custom nodes and it significantly increases iteration time - domain reload, enter Play mode, etc.

    I've reached the limits of custom Inspector based editors, which can't be zoomed or nested. Graph based approach seems like the solution I need but there are no good options right now.
     
    mishakozlov74, marcospgp and Nexer8 like this.
  7. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    646
    GraphView API isn't closed source, it's all on the C# side?
    https://github.com/Unity-Technologi...er/Modules/GraphViewEditor/Views/GraphView.cs

    Experimental or not, you can copy the source code and use it, because it's based on UI Elements and UI Elements is released and will stay in the Editor (basically the whole Editor UI runs on it). (So you don't have to fear that they remove it at some point)

    IMGUI is extremely slow - but if your graphs are small, there are free Graph-Frameworks for IMGUI on Github (same for Experimental Graph View btw.)

    Also you can always write your own solution, in either UI Elements or IMGUI (I'd suggest using the first one because it way, way, way better as in: easier to use and more performant).
     
  8. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    I wasn't aware of that. Good to know.
     
  9. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    702
    First and foremost, the code is reference-only and can't be copied, as mentioned at the License header of each script snippet. So copying it is not legal.

    Second is that (in the case that was allowed) copying the code doesn't solve the problem: If Unity decides to fix some bugs or change and move stuff, it's up to you to keep your changes in sync with theirs. That's not how public APIs should work. GraphView has been in experimental for a very long time, and the alternative is GTF, which hasn't been updated since June 2021.

    I just hope we get some news soon about the direction GTF will take.
     
    Last edited: Mar 13, 2022
  10. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    646
    It states you are not allowed to distribute it or claim that you are the owner of the software, also you may not change the code provided. But just using it? IDK. It is provided as package, all packages can be copied into the package folder and "fixed" (which is required when using DOTS Physics (you have to copy the "Unity.Collections" into the package folder and change a line of code, so it works on the newest Editor Version)).

    So if they decide to remove the package - if you have the package downloaded previously it's pretty much the same as if you have the source code downloaded.. what I meant was that it's C# relying on an API that won't just vanish (UI Elements, which isn't experimental but already released). And following this, it's pretty safe to use Graph View, even when it's experimental.

    I am no Law Expert btw. you have to read and decide on your own. xD
     
  11. Estema_TheWoz

    Estema_TheWoz

    Joined:
    Aug 5, 2021
    Posts:
    7
    Hello buddy,

    I had exactly the same issue and spent an entire week to figure it out... So, forget this method, simply add, directly in the Package Manager, "Add package from git url" and type 'com.unity.graphtools.foundation'

    Hope it will help you
     
  12. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    When you did it, what version did you get?
    It did download 11.2-preview again and at the end of importing, it still gives me the error :

    Library\PackageCache\com.unity.graphtools.foundation@0.11.2-preview\Editor\InternalBridge\GraphViewStaticBridge.cs(290,39): error CS7036: There is no argument given that corresponds to the required formal parameter 'contextType' of 'PointerDeviceState.GetPointerPosition(int, ContextType)'

    looks like there is some unfinished and abondoned version here, if anyone knows a working version in unity 2021.2.13 please tell me to get that version.

    for time being I made myself busy with graphView, although it's experimental too :( would be nice if the official developers would make a public version of GTF just for people like me who want to start their development even with unfinished packages (that is used for a finished product like visual scripting one!)
     
  13. Estema_TheWoz

    Estema_TheWoz

    Joined:
    Aug 5, 2021
    Posts:
    7
    I get the same version downloaded. But I'm not working on 2021.2.13, I'm on 2020.3.30f1 and it works well.

    I didn't notice you where on an upper version sorry.
     
  14. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    it dosn't make scense, why would it cause problem with unity's version, when i read the error, it looks like it's referring to the library itself (unless i'm missing something). normally, this should be the result of a change in the library and package itself regardless of unity's built version?
     
  15. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    646
    Try it out, it works on V2020.3 and it doesn't work on V2021.x . Tried it myself and somewhere here on the unity forums they said that they currently don't support V2021.x but in the future, they will support it, we just don't know when.
    The error message might be wrong? Or a followup-error of something else perhaps?
     
  16. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    possible, really don't want to downgrade the unity version now, was looking forward to give the library a try, for time being, will play with graph view library until the GTF becomes public or at the very least, supported test pack for current version
     
  17. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    No mentions of GTF in 2022 roadmap:


    The silence here likely means nothing is happening this year. Maybe in 2023.
     
    Gekigengar, NotaNaN, DrViJ and 2 others like this.
  18. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    My fork here (https://github.com/marcospgp/com.unity.graphtools.foundation) works in the latest 2022 branch version of the editor and can also be compiled into a build. At this point I'm not sure if I broke anything without noticing, but it's working for me and my terrain graph editor :) Check the commit history to see changes I made.
     
    toomasio, MoonbladeStudios and Thaina like this.
  19. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    158
    @benoitd_unity, hello! Can you please tell if there is any news about Graph tool foundation? Can you give an advice what to use to start writing custom graphs from scratch today? Do you recommend to start from Experimental.GraphView or GraphToolFoundation? Thats ok for me if the API will change. It is more painful if it will be totally removed and marked as obsolete. So maybe you know the future of these two systems.
     
    NotaNaN, Tigrian, PanthenEye and 2 others like this.
  20. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    how to use this? just download the repo and import into a folder in unity?
     
  21. fg_davevanegdom

    fg_davevanegdom

    Joined:
    Sep 9, 2021
    Posts:
    9
    Trying my luck here, does one know how to change the port icon into a custom one?
     
  22. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    Also, I may ask for a big thing, but, considering that you are one of the people who are working with this library, it would be nice if you record some video tutorials to build a graph from scratch to the end, nothing big, maybe a simple graph, with a start node, a node with some property and that would be it. but it would be great if you show how to use the whole package containing minimap, and portal nodes.
     
    Softgraph and viridisamor like this.
  23. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    Yes, to use the package you just place the folder in your Assets folder. It works just like the official package, as the code is mostly the same.

    I don't have the bandwidth to record or even write tutorials right now, but I learned how to use the code myself by plain experimentation and a lot of looking at the samples and source code.

    I'm trying to get a Terrain Graph package ready as soon as I can that I can put on the asset store, that way it might serve as an example of how to do something with Graph Tools Foundation. No estimated release date as of yet, though!
     
  24. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    140
    Replace the function with

    Code (CSharp):
    1. public static Vector2 GetMousePosition()
    2.         {
    3.             return PointerDeviceState.GetPointerPosition(PointerId.mousePointerId, ContextType.Editor);
    4.         }
    They changed internal API and now second param is mandatory.
     
    AKhodakarami likes this.
  25. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    This issue is part of what I fixed in the fork mentioned above, though be careful - I had to add an
    #if
    directive like so:

    upload_2022-4-27_19-14-24.png

    Otherwise, I would get an error every time I opened the editor and had to reimport my Graph Tools Foundation folder (using the right click menu) to make it go away.

    I simply guessed which directive to use by copying it from higher up in the same file, and it seems to have worked. I was at a loss for a bit trying to get through this issue :)
     
  26. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    140
    Posting source code of Unity's packages on Github is violating of user agreement, as far as I concerned.

    For those who copy package to assets and patch it, don't forget to also fix AssetHelper file to match your folder.
     
  27. Yes, it is, the next best thing is to provide diff files. Which can be easily applied to a specific version of the said package. It's not the same thing, requires one more step, but it's something.
     
  28. Streamfall

    Streamfall

    Joined:
    Aug 8, 2011
    Posts:
    43
    Hey, this is great - how's did the dialog system rewrite go?
     
  29. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    646
    Since I am the only one who wrote about a dialogue system, I guess you are asking me?

    I didn't switch to GTF but stayed with Experimental.GraphView instead. I am using it in multiple games without any issues so far. If they ever decide to depreciate Experimental.GraphView, that would be quite some work for me. But still in 2021LTS, eveything seems to work just fine.
     
  30. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    Hello!

    Graph Tool Foundation is still in development and we're not ready to share timelines yet. Most likely GraphView will be deprecated at some point once Unity tools have fully migrated to it but that won't be anytime soon. In terms of recommendation though, the current package is probably closer to what will be released than GraphView so the transition will most likely be less painful.

    It's also worth noting that the development of GTF has moved directly in the Editor and won't release in the package, which will also be retired at some point.

    Apologies for being so vague, we'll make sure to give an update once we have more clarity. Until then though, all those options will remain available so there's nothing to worry about.
     
  31. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    158
    Thank you for such a detailed answer! I wish you everything will turn out as planned and it will be great editor tool :)
     
    benoitd_unity and LooperVFX like this.
  32. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    702
    That's exactly what we needed! Even if it's not a definitive answer, knowing where you are at with the GTF helps us plan our next steps. Thanks Benoit!
     
    benoitd_unity and DrViJ like this.
  33. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,158
    Thank you very much for the information. Sadly I am not fond of moving anything back into editor instead of decoupling things out into packages
     
    LooperVFX likes this.
  34. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    702
    I think it's pretty easy to justify in this case though. VFX Graph, Shader Graph and Visual Scripting all will end up using the graph tools, and these are pretty much integral to 99% of the projects. So why not move it into the Editor itself?
     
  35. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,158
    It should just be package dependencies and that also another problem that unity just not have matured system for package manager dependencies

    It's like 99% of game require UI but UI still should be package. Being default package is better than being editor code
     
    LooperVFX and marcospgp like this.
  36. AKhodakarami

    AKhodakarami

    Joined:
    Feb 27, 2022
    Posts:
    12
    I think there can be a very important reason for that, if they are going to use the GTF as the base for animator tree? then they would need it in the editor itself.
    I know you have seen this but i thought reemphesizin on this part, being able to have nodes with no input and output ports just as a state machine or state (animator) is essential for developing many different tree systems, hope you guys add this feature to GTF in the process
     
    awesomedata likes this.
  37. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    I can't believe I'm still going with this, what a pain :confused: I wish I had gone with a sane library from the start :D upload_2022-6-7_1-25-47.png
    upload_2022-6-7_1-26-52.png
     

    Attached Files:

    Xepherys, TecknoUnity and toomasio like this.
  38. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    I think this tilts people a little (me included) because it feels like a cop out.

    Unitys main advantage is its extensibility and configurability. It doesn't exist? Write your own tool. Unity will have your back.

    So when Unity is forced to write complex tools themselves as packages, it doubles as dog fooding - they can see exactly what we have to go through to write real, complex custom tools. They can see just where the pain points are.

    Integrating it into the engine bypasses all this and is the "easy" way out for them (far as integration with engine systems goes). We don't have that luxury, so ultimately it feels like a wasted opportunity for Unity to learn and grow from.

    I love that some of the new packages like the Splines package is a package! I can study how they've done it. I can see exactly how Unity themselves expects me to handle certain situations I might encounter in my own tools (check out the Splines package and all the stuff they need to do to implement custom scene view "select all"/box select functionality for their spline Knots and handles - it's fascinating and a great learning resource)
     
    Nefahl, Xepherys, Gekigengar and 8 others like this.
  39. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    194
    @Prodigga I couldn't have put it better myself. Your comment made me tear up :(
     
  40. BetaMark

    BetaMark

    Joined:
    Sep 27, 2014
    Posts:
    229
    I agree that I'd love to see this operate in package land and have its roots in the same tech stack that outside developers have to operate in, but I can see the other side too.

    An engineering team that can pull off high quality engine level work is a finite resource within Unity. There is a lot of work to stabilize the next LTS release, integrate visual tech from companies like Weta, mature DOTS, evolving Bolt, etc. If Benoit and team did the technical discovery and found that it was going to take twice as long (or more) to make a rock solid Graph Tool Foundation out here in package space, doing it all inside the engine makes long term sense particularly considering how many core parts of the editor that will eventually be built on top of this.
     
    Prodigga likes this.
  41. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    It's like Shiggy the legendary game designer once said (about games):

    "A bad game that is delayed will eventually be good, but a bad game that is released before it is ready will be bad forever."
    This statement isn't as true anymore as it once was with physical-media-based games going the way of the dinosaur, but the design sentiment still applies to anything with an "unchangeable" core.

    Putting something so core to every part of everything in Unity that still needs to be updated over time into the engine and not allowing people (like me) who often need to do things with it (for the sake of important usability options for my tools -- important usability that must exist in ways that Unity hasn't anticipated) would require Unity themselves to change that core. Thus, the core (for users like me) would remain "unchangeable" in the end. This is the exact mistake Unity has made in the past -- and they are still repeating it.

    I think there are pros and cons to both sides --
    It's not just about time or ease of implementation.

    It's about malleability -- a trait Unity lacks in a lot of important areas.

    At the end of the day, it is the _design_ aspect of the engine that matters most, and is also the part Unity keeps botching up everytime it decides how to integrate a new technology.

    Unity could easily make the UI malleable and reactive to anything the user would want to interact with it with (i.e. Editor Shortcuts, Toolbars, Timeline, Graph Tools, Prefabs/GameObjects/Entities, Scenes, Multi-window setups, etc.), but that would mean they would need to provide ROBUST tools and a _very_ malleable API for that -- especially if the UI setup is editor only. This wouldn't be a quick project -- but it would be the project that would lead to the best and most potent _design_ at the end of the day.

    Without this robust, malleable, and modular approach being integrated into the core engine as well, it would turn out just as Shiggy says -- the UI tools will be on the path to being bad / unwieldy forever.
     
    Last edited: Jun 9, 2022
    LooperVFX, Thaina and marcospgp like this.
  42. VenkoGames

    VenkoGames

    Joined:
    Sep 29, 2021
    Posts:
    5
    At the moment the only mention to GTF for Unity 2022 (Correct me if I'm wrong) is the following line in the release notes:
    • Graph Tool Foundation: Graph Tools Foundation edges drawing was changed from Bezier curves to Z-lines.
    On one side I'm glad GTF is still in progress but I really wish that ther're more than that.

    I'm trying to make a full CYOA tool and I'm getting a new setback every day :(
     
    Ruchir likes this.
  43. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    I'm not sure whats going on with the examples, but the same API doesn't exist when I get out of the sample namespace. For example, `
    UnityEditor.GraphToolsFoundation.Overdrive.BasicModel.GraphModel
    ` is nonexistent. Is this deliberate or am I missing something?

    So far it's pretty confusing to follow as I don't seem to have any way to actually use the API from the samples and nothing similar exists in the regular package.
     
  44. TecknoUnity

    TecknoUnity

    Joined:
    Jul 17, 2022
    Posts:
    5
    Hi, what does it mean that GTF has moved in the Editor and won't release in package? If it is not shipped as a package will we be able to use GTF for external purposes? Or does it means that the code will be hidden and therefore not publicly open to use it?
     
  45. Catsoft-Studios

    Catsoft-Studios

    Joined:
    Jan 15, 2011
    Posts:
    702
    It just means that you won't need to install it as a (Package Manager) dependency and will be built-in in the Editor. But you'll still be able to access its public API
     
    Ivan_br and TecknoUnity like this.
  46. TecknoUnity

    TecknoUnity

    Joined:
    Jul 17, 2022
    Posts:
    5
    Beginner question: what is the best way to learn GTF? I recently took a look at the Math Example but it is not so easy to start building from there. Therefore, if someone has done sth already and wants to share it it would come as handy :)

    Thanks.
     
  47. mishakozlov74

    mishakozlov74

    Joined:
    Aug 8, 2018
    Posts:
    140
    Yes, those are little overengineered, just like DirectX examples 15 years ago served only one purpose - show off possibilities.

    Learning GTF is pure pain at this point. Examples don't use the latest API, but package provides with others, they work.
    So I took the way of reading documentation and looking for actual API from package's examples.
     
    TecknoUnity and BetaMark like this.
  48. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    Question:

    Can we override more fundamental parts of the API?
     
  49. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,307
    4 months later and this is still an issue:
    Code (CSharp):
    1. Library\PackageCache\com.unity.graphtools.foundation@0.11.2-preview\Editor\InternalBridge\GraphViewStaticBridge.cs(290,39): error CS7036: There is no argument given that corresponds to the required formal parameter 'contextType' of 'PointerDeviceState.GetPointerPosition(int, ContextType)'
    Seriously, what's going on?
     
  50. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    293
    If you are not aware, the publicly available Group Tools Foundation package is no longer being developed, the last update was February of 2021. Instead, it is being developed internally to be integrated and shipped directly with the engine.