Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups Nodes replace Functions in Visual Scripting #16

Open
swarnimarun opened this issue May 7, 2019 · 10 comments
Open

Groups Nodes replace Functions in Visual Scripting #16

swarnimarun opened this issue May 7, 2019 · 10 comments
Labels
enhancement New feature or request

Comments

@swarnimarun
Copy link
Contributor

Groups Nodes replace Functions

Grouping of Nodes in a chain should be allowed to simplify the process of creation of Node Units and increasing reusability of parts of the Visual Scripts.

image
Quick Mockup.

Group Nodes should be stored as custom Nodes that are accessible from the same drop down for searching the Nodes and also allow for saving and loading groups as resources for use as custom nodes all across the project.

Probably even have a default folder where we can place all the Grouped Node(Custom Node) Resources that we want to be accessible across the project as custom nodes, automagically.
This would remove the need to newbie users to learn how to create Tool Scripts.

Details

The Groups will be simple and clean and will act like bookmarks that will take us to the respective Group Node Structure we double click on.

The Groups will be a much simpler concept compared to functions but will technically use the same structure/codebase. It will also the first step towards addition of Unified Visual Script editor Graph.

Being able to save these can come extremely handy, such as having a module for simple visual script functions required and even Visual Shader node groups.

@swarnimarun
Copy link
Contributor Author

cc: @fire

@fire
Copy link
Member

fire commented May 7, 2019

Moved this comment here.

Groups

We have a super class called groups which are an interface with implementation.

This feature is useful for merge and removing entire groups of nodes.

Groups have:

  • title
  • a list of grouped nodes
  • input-output port
  • position

Comments

Comments derives from the group class.

Each comment group can be moved as a group.

Each comment has:

  • Inherited group properties
  • comment string.

Custom nodes

Custom nodes derive from the group class.

Each custom node has:

  • Inherited group members
  • Gdscript

Expression nodes in Visual Shader

An expression derives from the group class

Each expression node has:

  • Inherited group members
  • Shaders code (text)

To do for loops requires a generic shader node.

The Expression node is enough for "for" loops. The Visual Shaders currently do not support Functions and Flow control signatures.

#22243

Requires adding a method to add input variables.

@fire
Copy link
Member

fire commented May 8, 2019

I don't think it's good for ui to merge the concept of commenting and node definition. The "GroupA" in the mockup should stay a comment and not a integrated blob structure that auto expands from a node definition.

There could be a concept of autoloaded visual script libraries that are vs scripts and are effectively globals.

@swarnimarun
Copy link
Contributor Author

This feature/proposal went through a lot of discussions internally and we decided to not remove functions for both backwards compatibilities and to keep the system as simplistic.

But rather add a Visualscript submodules feature to be able to save blocks of visual script code as resources aka submodules and then reuse it in any other script or multiple times in the same script via simple import mechanisms.
And have the same edit functionality as the VisualScript.

@shiMusa
Copy link

shiMusa commented Mar 17, 2020

Hey all,
any update on the project? I'm currently writing a shader mixed with nodes and "expression" nodes (code), but I really need to collect a lot of reused code into a custom node. Would be awesome to have this feature now 0:)
Cheers and stay healthy!

@swarnimarun
Copy link
Contributor Author

@shiMusa Well things will get redone for 4.0 and this will likely make it in then, so not likely that it will be available in 3.2. Unless I find a way to implement it without breaking compatibility.....

@fire
Copy link
Member

fire commented Jan 18, 2021

@swarnimarun Ping! How is the rebase?

@swarnimarun
Copy link
Contributor Author

@fire godotengine/godot#45294

Created the draft PR, will be testing it a bit just to see if perhaps something else might have broken during rebase of Godot GUI code changes.

@fire
Copy link
Member

fire commented Feb 7, 2021

I'll keep this proposal open until it is merged.

@fire fire reopened this Feb 7, 2021
@YuriSizov YuriSizov transferred this issue from godotengine/godot-proposals Aug 24, 2022
@YuriSizov
Copy link
Contributor

Note that I've transferred it despite groups being useful in shaders as well because most of the discussion and work referenced here seems to be around scripting. A new proposal can be made in the main repo for group in graphs in general or for grouping in shaders. I suspect the underlying implementations for shaders would be pretty different anyway.

@YuriSizov YuriSizov added the enhancement New feature or request label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants