WIP: Nodes: New node group interface declaration to support panels #110272
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#110272
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "LukasTonne/blender:node-group-interface-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replaces the existing "NodeSocketInterface" types in DNA/RNA with a new
bNodeTreeInterface
struct. The new interface supports nesting of sockets inside panels (and panels inside panels), as part of the Design for the Sub-panels for Nodes, Node Groups and Geometry Nodes Modifiers #108895In addition to supporting panels, replacing old node socket interface types will allow some major cleanup. In particular the use of the
bNodeSocket
DNA struct for both sockets and socket declarations in node groups is quite confusing.Some additional discussion here: #109135
⚠️ Keep this for final commit message:
Nodes store panel states as a simple bit vector, but there is currently no API for accessing this. That is because the API should include other panel information like the name, which would accessing the node declaration. The node declaration does not have RNA access, so rather than a hacky solution the panel states are kept internal for now. What this means to users:
⚠️ API "breaking" change: Color callbacks must handle nullptr/None for the context.
draw_color
registerable function APISo far we always passed a context to the
draw_color
callback, but this is not always possible e.g. in drawing code. All the builtin socket types and usually also custom socket types don't actually use the context, so there should not be any issues. There are barely any addons that actually add custom socket interface classes.DNA
bNodeTreeInterface
struct that can cleanly encapsulate all the details.bNodeTree::inputs
andbNodeTree::outputs
will be replaced by this, other types might use it to declare node interfaces in future.bNodeTreeInterfacePanel
containing a list of items (including other panels).void *socket_data
, same asbNodeSocket::default_value
.get_as
/get_as_ptr
/get_data
templates innode_interface
namespace. (these were previously part of bNodeTreeInterface etc. but cannot have templates in C DNA files)interface
to something different (tree_interface
?iface
?). In MSVCinterface
is a language extension that creates conflicts with valid standard C++ (well done again MS, well done)RNA
NodeSocketInterfaceXXX
subtypes. This might be quite verbose, but at least its in a separaterna_node_socket.cc
file now and the old interface types can hopefull be removed in 4.0Custom socket types
bNodeSocketType
is registered, also generate an appropriate RNA type for the interface item.socket_data
implementation usingIDProperty
, where custom socket types can define interface properties.Backward/Forward compatibility
bNodeTree
with flattened interface data, so old Blender versions (esp. 3.6.1 LTS) can read newer files.API
Node group socket declarations
Tree View for interfaces
Node panel drawing
Earlier work: D16633
bNodeSocketType
callbacks for drawing socket data.Geometry nodes modifier panels
Solve ordering issues: Panels are currently drawn in front of all other UI, this interferes with arbitrary item ordering (sockets before panels should be allowed)Modifier subpanels are implemented in a separate branch.
Documentation
Cleanup
bNodeSocketType
has "xxxNew" functions for new interfaces, remove the temp suffix againKnown bugs
get_default_id_getter
crashes, ID sockets (Texture) don't get asocket_data
?Inconsistent index search/lookup: ignore the root panel
NodeSocketFloatFactor
), but only base socket types are supported. Find a supported base socket type to create in the interface instead of blindly copying socket types in the API.standard_node_socket_interface_from_socket
directly modifies interface DNA, this should never be done.Future Tasks
bNodeSocket
andbNodeTreeInterfaceSocket
code have functions for handling the variousbNodeSocketValue
types. Should unify this in a single place. Must be accessible from RNA too, so has to be in DNA or RNA.move_to_parent
allows changing the panel, but requires explicit index. Simpler method could insert at the first or last place in the panel depending on where it comes from.eNodeSocketDatatype
is defined in BKE, which makes it impossible to define a convenient getter in thebNodeTreeInterfaceSocket
DNA struct. ThebNodeSocketType
is referenced by name and getting a staticeNodeSocketDatatype
requires 3 or 4 lines every time. Maybe move the enum?Discussion with Julian: this is expected, currently no great solution. Outliner just uses the empty space below the tree view as drop target for appending. Don't have that in new tree views, the list is always sized for exact number of items. Could add a fake item at the bottom to support this (might become a general feature).
move_to_parent
tomove_to_panel
(link)in_out
containsINPUT
,OUTPUT
, andBOTH
, but is also a set. Should be one or the other.ui_items
RNA property (not calleditems
because that is a reserved python keyword).type
todata_type
. 7f7c4cbd0e@ -0,0 +263,4 @@
* Stops if the operator return false:
* bool MyOperator(bNodeTreeInterfaceItem &item);
*/
template<typename Func> void foreach_item(Func op)
Can use
FunctionRef
here instead of a template.items
list in node declarations. 7fd7ec44e7@LukasTonne where does this break exactly? I see that e.g.
void VKVertexAttributeObject::update_bindings(VKImmediate &immediate)
also usesinterface
as variable name.I don't see these classes anywhere. But i'm also on my work machine, would have to check on my laptop. It might be omitted due to lite builds.
@blender-bot build
interface
totree_interface
to avoid MSVC name conflicts. 19fce36794interface
totree_interface
. 4473f88f07@blender-bot build
@blender-bot build
@blender-bot build
ext_interface_new
RNA extension toext_interface
. 3c78e56d41this->
before member function calls. 5dcd2a9cbcthis->
before member function calls. 6930fefe32@blender-bot build
@blender-bot build
I consider this done, any remaining issues can be handled separately.
The python side of this update is an utter mess. You've lost several node types that worked fine before(NodeSocketInt for instance), and not mentioned it in the release notes. You've not linked to any of the prs in the change notes so finding where to point that out has been a pain.
New interface is way too verbose, harder to read, not backwards compatible, and not properly documented.
Seems to have been developed with total blinkers for the use cases, and run roughshod over everything else.
Pull request closed