Search Unity

GraphView node, that contains other nodes.

Discussion in 'UI Toolkit' started by Chris_Entropy, Mar 14, 2022.

  1. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I am experimenting a bit with the GraphView features and I was wondering, if I could create a node, that contains other nodes and resizes to encompass all those nodes when the child nodes are moved around. I am also a bit puzzled about some of the Node functionality. For example, how can I set a node to a fixed size and prevent it from resizing automatically?
     
  2. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I am a step further. I can just use a class derived from UnityEditor.Experimental.GraphView.Group to achieve what I want. I only have to override the AcceptsElement method and add my desired child node types there.
     
  3. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Hi Chris!

    GraphView is experimental, so keep in mind that the API may break at any release and is not officially supported. We are working on a new shiny GraphToolFoundation witch will be the successor to GraphView, but there is nothing public yet.

    I am curious, what kind of tool you are building?

    Do you still have a question overall?
     
  4. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I am building a simple tool for choose-your-own-adventure like games. The nodes will represent the choices and story flow for the game. A little bit like the Dialogue Tree examples you can find everywhere online, but with a few extra added features that make it a bit more complicated. Also my first real project using Addressables, so maybe I will even be able to make it completely moddable.
     
  5. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    How hard will it be to switch my current code for the GraphView to the new GraphToolFoundation, once it comes out?
     
  6. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    I didn't do any conversion myself, but I did gather some feedback from someone who has: There is a lot of work in the transition. You might be able to keep some elements if you mostly write them as individual elements and adds them to the graph nodes instead of directly overriding the nodes.
     
  7. SilverWalker

    SilverWalker

    Joined:
    Jul 29, 2018
    Posts:
    6
    Any little, unofficial, not bounding hint when it will be coming out? :p
     
  8. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    It is not in 2022.2 / 2022.3 (the alpha of 2022.2 is over, and I haven't seen it going through, no new features for the LTS version)

    It will probably show up in the c# reference without any announcement, as we will migrate VFXGraph and shaderGraph to validate the API before making it public. The team developing it is really focussed on providing a stable foundation for any editor tool that would be based on this.

    more detail here : https://forum.unity.com/threads/gra...hat-can-we-expect-in-the-near-future.1327434/
     
    Last edited: Nov 22, 2022