Git Product home page Git Product logo

Comments (9)

pmhpereira avatar pmhpereira commented on June 8, 2024

I'd like this too. One of the main reasons I think this makes sense is because as the list of different node types increase, the contextual menu will become more and more complicated to navigate.

Allowing to override the right GUI part of the NodeEditor would allow to have something like a drag-and-drop of nodes and should be the window where each node properties are displayed when selected (instead of the Inspector window).

from node_editor_framework.

ScriptGeek avatar ScriptGeek commented on June 8, 2024

I managed to implement this feature with a bug concerning IMGUI elements on my fork repo:
https://github.com/ScriptGeek/Node_Editor

Bug: Throws an exception when clicking on the node that implements this feature:
ArgumentException: Getting control 8's position in a group with only 8 controls when doing mouseDown

Somehow the number of GUI elements changes between the Layout and Repaint events. It was tested using this code as the override method:

public override void DrawNodePropertyEditor()
{
name = GUILayout.TextField(name);
}

How to resolve this problem?

from node_editor_framework.

pmhpereira avatar pmhpereira commented on June 8, 2024

Try:

if (Event.current.type != EventType.Repaint)
    return;

from node_editor_framework.

ScriptGeek avatar ScriptGeek commented on June 8, 2024

I found a solution to the issue...

The event that was causing the issue was EventType.Ignore, so avoiding the call to the DrawNodePropertyEditor method when this event type is the current event results in the exception no longer being thrown.

from node_editor_framework.

pmhpereira avatar pmhpereira commented on June 8, 2024

👍

from node_editor_framework.

Seneral avatar Seneral commented on June 8, 2024

Very nice, I will take a look on adding this to the default nodes.
Maybe there's even a way to avoid duplicate code for NodeGUI and DrawNodePropertyEditor...

from node_editor_framework.

ScriptGeek avatar ScriptGeek commented on June 8, 2024

I had in my mind that NodeGUI and DrawNodePropertyEditor were for separate purposes. NodeGUI being better suited for displaying flow control info so that a quick glance at the node graph conveniently indicates key info about the relationships between nodes; for example, displaying the current node state in a state machine. DrawNodePropertyEditor being better able to display the node properties in much more detail; for example, displaying an overabundance of details that would not fit inside the node's graphical area. Using both methods allows for the leveraging of each of their advantages, the best of both worlds.

from node_editor_framework.

Seneral avatar Seneral commented on June 8, 2024

You're right, but we don't want to forc this, or? If we still want, we can put the same properties in the node body. But anyway, does work good this way, the node creator has much more flexibility now:)

from node_editor_framework.

ScriptGeek avatar ScriptGeek commented on June 8, 2024

Yes, the new method is totally optional and properties can still go anywhere, it's all up to the user of the framework. I'm excited to make some more nodes! :)

from node_editor_framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.