Search Unity

Simple node editor

Discussion in 'Immediate Mode GUI (IMGUI)' started by unimechanic, Jul 5, 2013.

  1. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    StateMachine removed from the Develop branch and added some framework updates with this commit.
    StateMachine added to the new feature branch here:)
    The last commit shows pretty good what the StateMachine system has changed and how it's integrated. The UnityFunc is supposed to be used as the transition condition (ordinary func doesn't serialize) but I have to figure out how to get it to work correctly. I will do that part as I work on it alongside from the Action Node part;)
    PM me if you have questions:)
     
  2. Aishiteru

    Aishiteru

    Joined:
    May 3, 2014
    Posts:
    31
    looks super impressive ;)
     
  3. Artiste

    Artiste

    Joined:
    Dec 12, 2014
    Posts:
    12
    Hi, we're using this editor to make a behaviour tree editor. Most of it works (selector nodes, action nodes etc...). We add knobs dynamically (ie. when we want to add more children to a sequence) but the cache (lastsession.asset) is broken. While we can use SaveBhehaviourCanevas to make a proper save, the SaveCache called when we add a knob returns an error ( could not add object to asset because it already exists ) .

    cc @Fullymetal
     
    Last edited: Mar 2, 2016
  4. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    Hi,

    I have been trying to add a 'flow' connection, similar to that of Unreal engine blueprint editor. The connection will not pass data i just want to use it for visual purposes and to know which node is part of the next 'phase' in the case of my usage. I have managed to add a red knob underneath the name of the node and can connect two of my flow connections together. However if i save and then re-load the same canvas, the knobs are no longer attached to the nodes, if i move the nodes the knobs stay in the same place.

    I'm not sure i have explained it clearly, so i have added screenshots to show the problem

    upload_2016-3-2_16-6-41.png
    Working fine above

    upload_2016-3-2_16-7-11.png
    after saving and loading, its broken
     
  5. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi,
    It is kinda tricky with adding node knobs dynamically, as these will have to be saved explicitly to the save file. If you're using the latest develop branch, then you just need to call NodeEditorCallback.IssueOnAddNodeKnob and the nodeknob saving is handled by the editor window. I do not know if that fixes the error though, but I'm unhappy with how the cache system works as of now, so I'll likely revisit it sooner or later.
    May even be better to directly jump to an own xml save format;)
     
  6. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Can you send me your project?
    This should not be able to happen as the positions are stored relatively to the node position, so I need to investigate this a bit further:)
     
  7. Artiste

    Artiste

    Joined:
    Dec 12, 2014
    Posts:
    12
    Welp, we kinda fixed it by using AddSubAsset and adding the new knob to lastsession and using a custom method to delete a knob from it when we remove a child from a node.
     
  8. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    how would you like me to send it ?
     
  9. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Well you really should use the 'NodeEditorCallback.IssueOnAddNodeKnob' function if that was the reason as this is then handled apropriately. Also, in the latest commit again there's a NodeKnob.Delete function so this will also delete it from the asset. I used that in the action node aswell for dynamic nodeKnobs so this works;)
    For changing the controls take a look at NodeEditor the Input Events region, for this specific case you would need to check the LateEvents function (about l. 540) to change the button;)

    You can PM me or send a temporary link to the unitypackage in this thread;)
     
  10. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
  11. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Thanks, I'll take a look!
    What I see straight away, your flow knobs create a type mismatch in the save file, means they are not created correctly. I try to figure out what you did wrong and tell you;)

    Edit:
    Ok, so you're handling them as completely seperate knobs, you basically 'duplicated' the knob system in order to handle the flow knobs differently:O Doing that you kinda screwed the save system, as it needs to clone each scriptableobject you're referencing. You did not let it know of the new knobs that you handle seperately, so it ignores them.
    Anyway, it would be way easier to just use the outputs, or do you have any real reason to handle them completely different, besides that they are only visual?
    You could just use:
    Code (csharp):
    1. node.CreateOutput ("Flow", "Flow", NodeSide.Right, 20);
    Which will yield the same result. Remember it's now seen as an output know though! I plan to add some functionality to block outputs, so this might help you there.
     
    Last edited: Mar 2, 2016
  12. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    Ok thanks, ill change them to use outputs and being able to block outputs would be really useful. Is there anyway i could position them at the top underneath the name of the node ?
     
  13. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    That should already be positioned correctly with the above line, notice I specified the position explicitly already;)
     
  14. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    I added:
    Code (CSharp):
    1. node.CreateOutput("Flow", "Flow", NodeSide.Right, 20);
    in the create method of the ChemicalNode.cs script but it appears at the bottom with the normal blue ones.
     
  15. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Yep, you need to account for that first new output. Basially, whenever you indexed your output, increase it by one. In that case it's the loop though your outputs to draw, set the loop counter start value to one to skip the first output.;)
     
  16. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    In the node editor underneath line 235's node.DrawKnobs i have added node.DrawFlowKnobs and then in the node script in the DrawFlowKnows function i have the following:

    Code (CSharp):
    1. nodeKnobs[0].SetFlow();
    2. nodeKnobs[0].DrawKnob();
    The set flow function is in the NodeKnob.cs script and contains:

    Code (CSharp):
    1. public void SetFlow()
    2.         {
    3.             Vector2 top = GUILayoutUtility.GetLastRect().center;
    4.             top.y = GUILayoutUtility.GetLastRect().yMin;
    5.             Vector2 pos = (top) + body.contentOffset;
    6.             sidePosition = side == NodeSide.Bottom || side == NodeSide.Top ? pos.x : pos.y;
    7.             //Vector2 pos = GUILayoutUtility.GetLastRect().center + body.contentOffset;
    8.             //sidePosition = side == NodeSide.Bottom || side == NodeSide.Top ? pos.x : pos.y;
    9.         }
    The red knob is now where i want it, but when i use the editor i get the following error message:

    "You cannot call GetLast immediately after beginning a group."
     
  17. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Ok you wanna go with the copying approach again - I got it;) What didn't work for you previously that you take up so much work lol?
    Anyway, the node body is wrapped in a group of course and when you call this function at the very beginning in the node body then it'll throw that error as GetLastRect needs a previous GUI Element. Pretty logic. You can base the position from that information;)
     
  18. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    I'm not sure what you mean, but i think i may be overcomplicating things. How would you add the functionality i'm trying to add, essentially i just want to connect two nodes by a red line, with the connection points at the top corners of the node (top-left for input and top-right for output) ? The connections don't need to pass data i just need to be able to get a reference to the node that a node is connected to via these red 'Flow' connections.
     
  19. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Here is the full source code for a simple example flow element node, including how to get the adjacent flow elements:
    Code (csharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Collections.Generic;
    4. using System.Linq;
    5. using NodeEditorFramework;
    6. using NodeEditorFramework.Utilities;
    7.  
    8. [Node (false, "Example/Flow Node")]
    9. public class FlowNode : Node
    10. {
    11.     public const string ID = "flowNode";
    12.     public override string GetID { get { return ID; } }
    13.    
    14.     public override Node Create (Vector2 pos)
    15.     {
    16.         FlowNode node = CreateInstance<FlowNode> ();
    17.        
    18.         node.rect = new Rect (pos.x, pos.y, 200, 180);
    19.         node.name = "Flow Node";
    20.  
    21.         // Flow connections
    22.         node.CreateInput ("Flow", "Flow", NodeSide.Left, 10);
    23.         node.CreateOutput ("Flow", "Flow", NodeSide.Right, 10);
    24.  
    25.         // Some Connections
    26.         node.CreateInput ("Value", "Float");
    27.         node.CreateOutput ("Output val", "Float");
    28.  
    29.         return node;
    30.     }
    31.    
    32.     protected internal override void NodeGUI ()
    33.     {
    34.         // Display Connections
    35.         // Start counter at 1 to ignore flow connections
    36.         for (int inCnt = 1; inCnt < Inputs.Count; inCnt++)
    37.             Inputs[inCnt].DisplayLayout ();
    38.         for (int outCnt = 1; outCnt < Outputs.Count; outCnt++)
    39.             Outputs[outCnt].DisplayLayout ();
    40.  
    41.         // Get adjacent flow elements
    42.         Node flowSource = Inputs[0].connection != null? Inputs[0].connection.body : null;
    43.         List<Node> flowTargets = Outputs[0].connections.Select ((NodeInput input) => input.body).ToList ();
    44.  
    45.         // Display adjacent flow elements
    46.         GUILayout.Label ("Flow Source: " + (flowSource != null? flowSource.name : "null"));
    47.         GUILayout.Label ("Flow Targets:");
    48.         foreach (Node flowTarget in flowTargets)
    49.         {
    50.             GUILayout.Label ("-> " + flowTarget.name);
    51.         }
    52.     }
    53.    
    54.     public override bool Calculate ()
    55.     {
    56.         // The following can NOT be used anymore until I implement conenction blocking though as the flow connections never have a value
    57. //        if (!allInputsReady ())
    58. //            return false;
    59.  
    60.         // Do your calc stuff
    61.         Outputs[1].SetValue<float> (Inputs[1].GetValue<float> () * 5);
    62.         return true;
    63.     }
    64. }
    65.  
    66. // Connection Type only for visual purposes
    67. public class FlowType : ITypeDeclaration
    68. {
    69.     public string name { get { return "Flow"; } }
    70.     public Color col { get { return Color.red; } }
    71.     public string InputKnob_TexPath { get { return "Textures/In_Knob.png"; } }
    72.     public string OutputKnob_TexPath { get { return "Textures/Out_Knob.png"; } }
    73.     public Type Type { get { return typeof(void); } }
    74. }
     
  20. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    I've started to use the node editor for my fractal noise generations. What is the best sollution to define a connection which takes parameter values, i.e. offset values or coordinates at the getter?

    I,ve seen that the float connection is without parameter usage. Have I to define my own float value type with explicit getter definition?
     
  21. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi Hellhound,
    what connections simply do is passing a value of a specific type (incase of the float connection type, a float). If you want to pass offset or coordinates, you should create a new connection type (see the docs) which is dedicated to passing that type (here a Vector2 most probably).
    That being said I don't know what you mean with parameter vales, but I think the above should help you with your problem:)
     
  22. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    Hi Seneral,
    thx for your fast reply. I will try to give you more explanation what I want to realize.
    Actually my noise generator works from top down. This means the generator defines the size of the noise map which should be generated and displayed by the NoiseMapNode:
    http://www.directupload.net/file/d/4285/9tezukxl_png.htm

    I've written my own NoiseMap connection as described in the docs for a float[,] array value type.
    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3.  
    4. namespace NodeEditorFramework
    5. {
    6.     public class NoiseType : IConnectionTypeDeclaration
    7.     {
    8.         public string Identifier { get { return "Noise"; } }
    9.         public Type Type { get { return typeof(float[,]); } }
    10.         public Color Color { get { return Color.cyan; } }
    11.         public string InKnobTex { get { return "Textures/In_Knob.png"; } }
    12.         public string OutKnobTex { get { return "Textures/Out_Knob.png"; } }
    13.     }
    14. }
    In my NoiseMap calculation I generate my noise texture by:
    Code (CSharp):
    1. var map = Inputs[0].GetValue<float[,]>();
    2. texture = TextureRenderer.FromHeightMap(map);
    But I want a bottom up mechanism, for more flexibility in noise value generation (i.e. for infinite terrain tiling). The size of the resulting map should be defined by the endpoint of the graph in the NoiseMapNode (or later in the 3d render node) and I want traverse the graph from bottom up to the start node for each value in that way:
    Code (CSharp):
    1. var map = new float[width,height];
    2. for(var y=0; y<height; y++){
    3.      for(var x=0; x<width;x++){
    4.            map = Inputs[0].GetValue<float]>(x*offset.x,y*offset.y);
    5.      }
    6. }
    7. texture = TextureRenderer.FromHeightMap(map);  
    My SimplexNoise provider should return only a single float for the noise value, based on given x,y values.
     
  23. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Oh well now I know what you mean. I'm actually interested myself in this as I planned on creating something similar (texture creation, etc.).
    Say you have several steps (noise, blend, levels, transformations, etc.) to create the final texture. Those transformations are the problematic step, as they will modify the coordinates of the noise after it has been generated back at the beginning, before the transformation node.
    But instead of reversing and restructuring the whole calculation system, maybe it's better to think differently, in a different scale. Simply looking up the upcoming transformations for a noise node to generate it with the transformation straight away is not applicable, because there might be different branches with differenct transformations.
    My thoughts on this:
    A solution would be to have the transformations specified before generating the noise, maybe as a Rect input. But that does destroy the workflow the user is probably used to.
    So another way. We need to think in a different scale.
    Later, you'd probably want to optimize the noise creation, you won't want to iterate over the whole texture for each step to perform it's action, but you would want to condense them as good as possible.
    This can be implemented straight away while creating the canvas. Say, your nodes do not perform their step and pass the result to the next node, but they pass their step as an action, a function. So in your graph, it won't be worked on the texture, but on the 'formula' (or condensed function) to create the final texture. This is faster while traversing the graph, allows for later modification of the texture creation (transformations, in this case), and allows for calculating the texture in different steps of creation in different resolutions (as preview textures for example). So, the result of such a texture creation graph would not be a texture but a function, like this:
    Code (csharp):
    1. (Rect rect, Rect secondaryOffset) => blend (Color.RED, simplexNoise(rect), perlinNoise (rect + secondaryOffset))
    Any number of parameters or hardcoded values, whatever, you name it. Those can be condensed to several cached functions if you have different branches working differently on those results or when you have to perform steps that do not work well with that (like blur).
    I hope you got it, I think it's a very interesting topic and I'd be glad to see your progress, if I wouldn't been so busy with other stuff I'd immediately implement such a Texture Composer© ;)
     
  24. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Hello, this is a really great project.
    But I wondered how to load a canvas at runtime. I want to use the node editor as a small tool for designing enemy behavior, but it seems like loading in runtime (in a standalone build) does not work.
    The runtime editor example is not able to do it. All I want to do is load a canvas, and get it's nodes and connections to calculate at runtime.
     
  25. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi BYD,
    it is possible, but I did not add it as it requires some work. You cannot simply do a file picker as the Resources database cannot be browsed. Instead, you'd create a database (perhaps a scriptable object) which holds all canvases that the user is able to load (including the ones created at runtime). Then you'd somehow let the user pick one of it to load. If you want, feel free to go ahead an implement this, I simply did not do yet because I had not time;)
    But if you simply want to calculate it without displaying the GUI, you just have to call NodeEditorSaveManager.LoadCanvas to load the canvas and then use the function NodeEditor.RecalulateAll to calculate it. You can modify the nodes as you like before/after doing that:)
    Hope that is what you need to get started!
     
  26. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Yeah I already tried using the LoadCanvas() Method but I think it didn't work in the standalone, but i'll try it again once I am back at home.:)

    My idea is simple: I don't need any editor running in the standalone nor some sort of file picker - I just want to load the data of a NodeCanvas.;)

    For example I have an EnemyAI compnent on my enemy gameobject and assign a public NodeCanvas variable through the inspector.
    I only want to access the data of that canvas and calculate the nodes without any editor.
    But doing it in this way does not work since the canvas nodes then appear to have no connections to another node (outputs list count is zero), making it impossible to calculate something that way.

    I fiddled around with the editors source code and saw that the CreateWorkingCopy() method compresses some of the nodes data, maybe it has something to do with my problem but that's just my guess.
     
    Last edited: Mar 7, 2016
  27. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hm that's weird. You're right indeed, the compression option in GetWorkingCopy excludes the duplicate Inputs/Outputs lists from the copy (no real compression in that sense). But this is disabled when loading (you can check), so this can't cause this.
    Though I did not test simply calculating at runtime, it should work. Anyway, I will provide an example to make sure it works;)
     
    Last edited: Mar 7, 2016
  28. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    @BYD Added an example of calculating and reading a canvas during runtime in dc3f02d, along with some other minor stuff. Hope this does it for you;)
     
  29. TiagoMartins

    TiagoMartins

    Joined:
    Mar 15, 2015
    Posts:
    12
    Hey guys, here is a video with a small demo of what I've been able to do until now, lots of space for improvements, but it's getting there :p

     
  30. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    Thanks for your thoughts Seneral. I fiddled arround with the connection source code and come to that point that the bottom up case could not be realized ...

    I also got the idea with the predefined input to decouple default settings from the noise provider nodes.I think this could be done easily...

    I like your thoughts about the delegates. Actually I've no clear idea how I could combine delegates dynamically for the differend node functions in the graph, but I will keep an eye on it ...
     
  31. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Looking Cool! I've no idea how you've implemented the waiting, (Recalculating every frame?), but maybe transitions will serve you better as soon as they are somewhat working;)
    It's hard to do it that way, it basically would mean to recursevly go up the tree, each node is calculating with potential later parameters they need to be calculating and store them for th apropriate branches, then, when the top is reached, the value willbe aware of future parameters. But this is a bad idea I think IMO, way to compicated.
    I don't know what you mean with decoupled settings from the nodes with predefined input, though. If that means transformations are defined before noise nodes, well you couldn't have the noise used in two subbranches with different transformations anymore. tw it also is opposite what the user might expect from other softwares he's familar with.

    I still think the best idea would be such a formula creation. Not necessarily a delegate, but a custom structure of abtstract objects. If I find time I'll set you up a little diagram to visualize what I mean:)
     
  32. TiagoMartins

    TiagoMartins

    Joined:
    Mar 15, 2015
    Posts:
    12
    Well, the Node Editor is simply visual, at the moment it's not possible to view the transitions on the editor, after having the transitions set up I "compile" the result to be used by another script that will manage each node executions

    At the moment it's not possible to debug the transitions between the nodes when running the game in the editor, but like I said, it's still work in progress :)
     
  33. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Oh, that's indeed a way better idea;)

    @Hellhound_01 This is what I meant:
    NodeEditorCanvasTest.png
    Or something similar. The action that is shown is basically only data how to calculate the texture, not the texture itself. I think this is way more flexible than any other approach;)
     
  34. Hellhound_01

    Hellhound_01

    Joined:
    Mar 5, 2016
    Posts:
    102
    Thanks Seneral for your diagram. That's similar to the thoughts I've with the usage of lambdas and delegates. Actually I'm banging my head around a generic (maybe something similar to c++ (where I come from) templating) solution for the delegate based input object design.

    Btw.: Yesterday I found this implementation which will be published at the Asset store in a few days. This video shows what I want to implement.
     
  35. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Oh, alright then!
    Map Magic is looking really nice:) Very interesting to hear from it, now that TC2 arrives with a node based editor and GPU accelerated generation, too. Dammit, that means I have to buy both :(
     
  36. BYD

    BYD

    Joined:
    Jan 26, 2015
    Posts:
    24
    Thank you really much for your help!:)
    The script works great in the editor, but... I know it's weird.. The unity standalone crashes... It seems I could narrow the error down to the ContinueCalculation() method, but I have really no clue why Unity would crash there...:(
    Could you reproduce this issue? I really don't know why it should work in the editor but not in the standalone this time.
     
  37. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Yup, sorry for that. Pretty simple, for some reason I enclosed the CreateWorkingCopy call in the NodeEditorSaveManager Load function with a UnityEditor preprocessor check :confused:
    Also, through some ways the calculation unnecessarily triggered complete reinit of the Node Editor, even the GUI part (which somehow caused the crash). I committed a fix for this in ac73f0a ;)
    Again sorry I didn't test it in standalone at all:(
     
    Last edited: Mar 9, 2016
  38. Aishiteru

    Aishiteru

    Joined:
    May 3, 2014
    Posts:
    31
    I have been trying to replicate ue4 node grouping system / comment group, I just want to check if anyone is doing the same thing as i am.
     
  39. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Like these one on the roadmap? That'd be awesome. There's no one working on that so it be amazing if you could implement that. With groups you could also mean nested canvases, as of that I have worked on that before so if you need them, we can discuss that:)
     
  40. Queekusme

    Queekusme

    Joined:
    Jun 9, 2015
    Posts:
    1
    First of all, this is awesome, Most node editors for Unity are very expensive or not very good but this is fantastic and it's free.

    secondly, I've been looking through the provided code and haven't been able t figure out how to do it but how do you get this working at runtime and how do you expose variables from unity to the node framework and vice versa.

    keep up the good work
     
  41. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi! Thank you for your kind words:) I'm sure there are paid Node Editors out there that are better than this, but they are usually quite expensive.
    I've recently added an example to the develop branch (this commit, file1, file2) to calculate a canvas at runtime and access it's values. If you want to even have the GUI displayed, there is the RuntimeNodeEditor component already but there are limitations GUI-wise due to editor-only GUI:(
    If you have any other questions feel free to ask:)
     
    Last edited: Mar 12, 2016
  42. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Thank you, that exception was driving me crazy the last 2 hours :D
     
    iddqd likes this.
  43. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    I've just released a first version of open source node inspector as well.
    It use a different concept. everything is stored under scriptable object. and you setup these links through attributes.
    In the project you can find simple dialogue editor built on top of this project.



    and here is Quick-Start
     
  44. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Disclaimer: This is just my first impression, it's definitely influenced by the fact I started the Node Editor project. So don't take it as a fact;)

    It is looking nice, there are some distinct differences that differentiate both projects though;)
    Your project is obviously tailored to visualizing scriptable object dependencies through a node interface, and I like how easy it is to implement this through some attributes. The Node Editor project indeed takes a different approach in some cases:)
    For example it references the Node's properties they want to expose through these connections, instead of referencing node A to node B directly. Also it seems using the graph has to be handled by the user as far as i can tell, and Node Editor provides advanced calcualation and soon transition functionality.

    That's it from me, I think your project suitsthe data-visualizing purpose really well;) It can get a bit more fleshed out here and there but thats common to open source projects of all kinds;)

    Btw there was already somewhere on this thread the idea to make a ScriptableObject Node that creates an inspector for arbitrary scriptableObjects and their properties/interdependencies:) That approach has definitely some advantages for some use cases, for example you do not need to specify GUI and properties explicitly in code for each ScriptableObject, just tagging some things with attributes and you're ready to go. I would have followed that idea further somewhere in the future if that wouldn't look to much like copying your approach :D
     
    Last edited: Mar 21, 2016
  45. nicloay

    nicloay

    Joined:
    Jul 11, 2012
    Posts:
    540
    Seneral, Thanks for feedback =).
    Originally i tried to work with your code. but as you and me mention before we have a really different target implementation. And yes. it's more like data representation right now with additions that you can modify dependency using this inspector. Maybe because of that i almost didn't face any issue when implemented Undo/Redo.

    My next plans is to implement similar things for components. I mean instead of using scriptable objects use MonoBehaviours so configs could be binded to scene objects. And another branch of development is implement One-to-One One-to-Many Many-to-One and Many-to-Many refferences. and when i would done them it would be possible to configure something like a crafting system. And through config you will know which material used where and what you can do with materials.

    But it's a plan for next months. originaly i've started this project to use it at one of my project.
     
  46. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Yeah my last note was just an idea that the dependeny system can theoretically be implemented as a single node into Node Editor. That does mean though that alot of stuff would be redundant so I understand your step:) And indeed Undo/Redo is a pain in the ass for the Node Editor implementation, because of so much things to consider. Even though the nodes are scriptableObjects, too, wherer it's just a matter of passing it into Undo.RecordObject.
    Anyway, I am interested in creating such a Node in the Node Editor framework. But what is holding me off is the implementation of an inspector (that was the problem for the poster with the initial idea here, too). So that's not something I will be focussing on...

    That aside, I've something to announce in the next minutes (under an hour) regarding the new Input system for the Node Editor:)
     
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
  48. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Won't steal anything;) Though it might be worth to check how it works to get some inspiration, true. For the moment I, and foremost the community in general, has a great amount of goals for this Node Editor already:) But from the first glance it seems to be easily reproducable in regards to node structure / functionality in this framework. The GUI is more specialized of course, and the primary thing that will be interesting to take a look at are gimmiks lol :)

    Btw, you might have noticed this project doesn't even have a proper name yet :O
    I've called it the Node Editor (Framework) so far, with pronounce on 'the', so generalized. Any ideas on the name, or should we let it undefined for the moment?
     
  49. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    --- UPDATE ---
    Just committed the completely new dynamic input system:) Yay!
    I'm very confident that it is a great step forward, it's so easy to create new controls or change existing ones, and each control is well-seperated. I encourage you to take a look at it! ;)
    Here's the commit!
     
    Marble and moure like this.
  50. gregoired

    gregoired

    Joined:
    Apr 8, 2013
    Posts:
    20
    Hi Seneral, and thank you for this project, it's very helpful !
    Two questions :
    1) When I hit play, i keep having this weird exception
    Any ideas why ?

    2) I have a list of ScriptableObject as a way to store data in my nodes. I try to serialize it by overriding GetScriptablesObject() in my custom node script, but then I have one another error if I try to load the canvas, telling me my scriptable object is already a subasset. Did i do something wrong ?