WIP: Nodes: New node group interface declaration to support panels #110272

Closed
Lukas Tönne wants to merge 251 commits from LukasTonne/blender:node-group-interface-ui into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

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 #108895

In 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:

  • Reading or changing panel open/closed state through the API is not supported.
  • Custom (python) nodes can not create panels. Custom nodes generate sockets directly rather than through a declaration (which is not RNA-accessible).

⚠️ API "breaking" change: Color callbacks must handle nullptr/None for the context.
draw_color registerable function API
So 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

  • Add a new bNodeTreeInterface struct that can cleanly encapsulate all the details. bNodeTree::inputs and bNodeTree::outputs will be replaced by this, other types might use it to declare node interfaces in future.
  • Implement a hierarchical structure, with bNodeTreeInterfacePanel containing a list of items (including other panels).
  • Add a runtime cache that stores interface items as a flat list, in drawing order. This should be updated as part of the node tree's topology cache and can be used by drawing-related algorithms that handle all items.
  • Design a C++ API as part of the DNA structs. It supports adding/removing/moving/reparenting items in addition to general access. A C API is no longer required at this point since most files have been C++ified.
  • Store socket details (subtype, default value, min, max) as a void *socket_data, same as bNodeSocket::default_value.
  • Use more specific names for the get_as/get_as_ptr/get_data templates in node_interface namespace. (these were previously part of bNodeTreeInterface etc. but cannot have templates in C DNA files)
  • Rename interface to something different (tree_interface? iface?). In MSVC interface is a language extension that creates conflicts with valid standard C++ (well done again MS, well done)

RNA

  • New rna file for the interface.
  • Register subtypes for all the socket item types, same as current NodeSocketInterfaceXXX subtypes. This might be quite verbose, but at least its in a separate rna_node_socket.cc file now and the old interface types can hopefull be removed in 4.0

Custom socket types

  • When a custom bNodeSocketType is registered, also generate an appropriate RNA type for the interface item.
  • Define a socket_data implementation using IDProperty, where custom socket types can define interface properties.
  • Registerable methods for initializing a socket from the interface item and vice versa.

Backward/Forward compatibility

  • Add versioning for backward compatibility (this should be straightforward)
  • Write old inputs/outputs lists in bNodeTree with flattened interface data, so old Blender versions (esp. 3.6.1 LTS) can read newer files.
  • Update node interface default initialization (e.g. Geometry input + output in GN) to use the new interface.

API

  • Disallow panels inside panels (except root), or hide behind experimental flag. The API supports it but it makes things more complicated and doesn't add much value in a node context.
  • When deleting a panel: move all items up to the next parent instead of deleting them as well. Only the panel itself should be removed.
  • Make new group sockets inputs by default. Group sockets can be both inputs and outputs, currently default is neither so a new group socket does not show up ...

Node group socket declarations

  • Generate sockets for node groups based on the new interface.
  • Support panels in node declarations. This will add support for panels on built-in nodes as well as group nodes.

Tree View for interfaces

  • Use the new tree view to draw socket hierarchies in the node editor sidebar
  • Drag & Drop support as part of the new tree view feature

Node panel drawing

Earlier work: D16633

  • Draw panel headers with a collapsing button
  • In collapsed state: draw node links without the sockets, all grouped in a single point
  • Use bNodeSocketType callbacks for drawing socket data.
  • Fix socket distances to match previous look
  • Decide if panel nesting is supported and what that should look like
  • Better visualization of panel content vs root sockets
  • "Insert into panel" vs "Insert after panel" is not very clear in drag&drop. Shows a tooltip but that is too subtle. General issue with the new tree views.

Geometry nodes modifier panels

  • Reflect panel structure in the Geometry Nodes Modifier using the existing panel system
  • Support child panel instancing for panels inside 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

  • User docs for the new interface tree view
  • API docs
  • API migration docs (what old parts still work or don't, how to migrate to new API)
  • Release notes

Cleanup

  • Check code for leftover XXX and TODO remarks
  • Deprecate or remove old interface sockets code, only keep what's needed for backward compatibility
  • RNA and bNodeSocketType has "xxxNew" functions for new interfaces, remove the temp suffix again

Known bugs

  • Connecting extension ("virtual") group input/output sockets crashes
  • Dragging a socket out of a panel does not work (nothing happens)
  • Default GN node group gets geometry sockets, but old inputs/outputs are not used. Link is added between sockets by index, which adds it between the extensions sockets instead (because no geometry sockets exist). Should go away when backward compatibility is restored.
  • Copy socket operator does not work for sockets inside panels
  • Group input/output nodes have panels too, this may not be desirable:
    • Related: Panels on group input/output nodes can be empty, should not show then
  • get_default_id_getter crashes, ID sockets (Texture) don't get a socket_data?
    Inconsistent index search/lookup: ignore the root panel
  • Crash after loading 3.6.1 file, looks like double freeing of interface sockets.
  • Making a shader group tries to create an interface socket with a subtype (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

  • Both bNodeSocket and bNodeTreeInterfaceSocket code have functions for handling the various bNodeSocketValue types. Should unify this in a single place. Must be accessible from RNA too, so has to be in DNA or RNA.
  • Generating panels in the modifier properties is implemented in a separate branch and not part of this PR.
  • Optional: Simpler API method for changing an item parent directly. Existing API method 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 the bNodeTreeInterfaceSocket DNA struct. The bNodeSocketType is referenced by name and getting a static eNodeSocketDatatype requires 3 or 4 lines every time. Maybe move the enum?
  • When last item is a panel with items (not collapsed) there is no way to drop a socket after the panel (not inside it)
    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).
  • To consider: Rename move_to_parent to move_to_panel (link)
  • Socket in_out contains INPUT, OUTPUT, and BOTH, but is also a set. Should be one or the other.
  • Rename ui_items RNA property (not called items because that is a reserved python keyword).
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 #108895](https://projects.blender.org/blender/blender/issues/108895) In 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: - Reading or changing panel open/closed state through the API is not supported. - Custom (python) nodes can not create panels. Custom nodes generate sockets directly rather than through a declaration (which is not RNA-accessible). ⚠️ API "breaking" change: Color callbacks must handle nullptr/None for the context. [`draw_color` registerable function API](https://docs.blender.org/api/main/bpy.types.NodeSocketInterface.html#bpy.types.NodeSocketInterface.draw_color) So 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 - [x] Add a new `bNodeTreeInterface` struct that can cleanly encapsulate all the details. `bNodeTree::inputs` and `bNodeTree::outputs` will be replaced by this, other types might use it to declare node interfaces in future. - [x] Implement a hierarchical structure, with `bNodeTreeInterfacePanel` containing a list of items (including other panels). - [x] Add a runtime cache that stores interface items as a flat list, in drawing order. This should be updated as part of the node tree's topology cache and can be used by drawing-related algorithms that handle all items. - [x] Design a C++ API as part of the DNA structs. It supports adding/removing/moving/reparenting items in addition to general access. A C API is no longer required at this point since most files have been C++ified. - [x] Store socket details (subtype, default value, min, max) as a `void *socket_data`, same as `bNodeSocket::default_value`. - [x] Use more specific names for the `get_as`/`get_as_ptr`/`get_data` templates in `node_interface` namespace. (these were previously part of bNodeTreeInterface etc. but cannot have templates in C DNA files) - [x] Rename `interface` to something different (`tree_interface`? `iface`?). In MSVC `interface` is a language extension that creates conflicts with valid standard C++ (well done again MS, well done) ## RNA - [x] New rna file for the interface. - [x] Register subtypes for all the socket item types, same as current `NodeSocketInterfaceXXX` subtypes. This might be quite verbose, but at least its in a separate `rna_node_socket.cc` file now and the old interface types can hopefull be removed in 4.0 ## Custom socket types - [x] When a custom `bNodeSocketType` is registered, also generate an appropriate RNA type for the interface item. - [x] Define a `socket_data` implementation using `IDProperty`, where custom socket types can define interface properties. - [x] Registerable methods for initializing a socket from the interface item and vice versa. ## Backward/Forward compatibility - [x] Add versioning for backward compatibility (this should be straightforward) - [x] Write old inputs/outputs lists in `bNodeTree` with flattened interface data, so old Blender versions (esp. 3.6.1 LTS) can read newer files. - [x] Update node interface default initialization (e.g. Geometry input + output in GN) to use the new interface. ## API - [x] Disallow panels inside panels (except root), or hide behind experimental flag. The API supports it but it makes things more complicated and doesn't add much value in a node context. - [x] When deleting a panel: move all items up to the next parent instead of deleting them as well. Only the panel itself should be removed. - [x] Make new group sockets inputs by default. Group sockets can be both inputs and outputs, currently default is neither so a new group socket does not show up ... ## Node group socket declarations - [x] Generate sockets for node groups based on the new interface. - [x] Support panels in node declarations. This will add support for panels on built-in nodes as well as group nodes. ## Tree View for interfaces - [x] Use the new tree view to draw socket hierarchies in the node editor sidebar - [x] Drag & Drop support as part of the new tree view feature ## Node panel drawing Earlier work: [D16633](https://archive.blender.org/developer/D16633) - [x] Draw panel headers with a collapsing button - [x] In collapsed state: draw node links without the sockets, all grouped in a single point - [x] Use `bNodeSocketType` callbacks for drawing socket data. - [x] Fix socket distances to match previous look - [x] Decide if panel nesting is supported and what that should look like - [ ] Better visualization of panel content vs root sockets - [x] "Insert into panel" vs "Insert _after_ panel" is not very clear in drag&drop. Shows a tooltip but that is too subtle. General issue with the new tree views. ## Geometry nodes modifier panels - [x] Reflect panel structure in the Geometry Nodes Modifier using the existing panel system - [x] Support child panel instancing for panels inside panels - [x] ~~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](https://projects.blender.org/LukasTonne/blender/src/branch/socket_subpanels). ## Documentation - [ ] User docs for the new interface tree view - [ ] API docs - [ ] API migration docs (what old parts still work or don't, how to migrate to new API) - [ ] Release notes ## Cleanup - [x] Check code for leftover XXX and TODO remarks - [x] Deprecate or remove old interface sockets code, only keep what's needed for backward compatibility - [x] RNA and `bNodeSocketType` has "xxxNew" functions for new interfaces, remove the temp suffix again ## Known bugs - [x] Connecting extension ("virtual") group input/output sockets crashes - [x] Dragging a socket _out_ of a panel does not work (nothing happens) - [x] Default GN node group gets geometry sockets, but old inputs/outputs are not used. Link is added between sockets by index, which adds it between the extensions sockets instead (because no geometry sockets exist). Should go away when backward compatibility is restored. - [x] Copy socket operator does not work for sockets inside panels - [x] Group input/output nodes have panels too, this may not be desirable: - [x] Related: Panels on group input/output nodes can be empty, should not show then - [x] `get_default_id_getter` crashes, ID sockets (Texture) don't get a `socket_data`? _Inconsistent index search/lookup: ignore the root panel_ - [x] Crash after loading 3.6.1 file, looks like double freeing of interface sockets. - [x] Making a shader group tries to create an interface socket with a subtype (`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. - [x] `standard_node_socket_interface_from_socket` directly modifies interface DNA, this should never be done. ## Future Tasks - [ ] Both `bNodeSocket` and `bNodeTreeInterfaceSocket` code have functions for handling the various `bNodeSocketValue` types. Should unify this in a single place. Must be accessible from RNA too, so has to be in DNA or RNA. - [ ] Generating panels in the modifier properties is implemented in a [separate branch](https://projects.blender.org/LukasTonne/blender/src/branch/socket_subpanels) and not part of this PR. - [ ] Optional: Simpler API method for changing an item parent directly. Existing API method `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 the `bNodeTreeInterfaceSocket` DNA struct. The `bNodeSocketType` is referenced by name and getting a static `eNodeSocketDatatype` requires 3 or 4 lines every time. Maybe move the enum? - [ ] When last item is a panel with items (not collapsed) there is no way to drop a socket _after_ the panel (not inside it) _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)._ - [ ] To consider: Rename `move_to_parent` to `move_to_panel` ([link](https://projects.blender.org/blender/blender/pulls/111348#issuecomment-1008756)) - [ ] Socket `in_out` contains `INPUT`, `OUTPUT`, and `BOTH`, but is also a set. Should be one or the other. - [ ] Rename `ui_items` RNA property (not called `items` because that is a reserved python keyword).
Lukas Tönne added 80 commits 2023-07-19 18:15:54 +02:00
commit dc7d45c1f1
Merge: 3a2d943dd7 550c61d34f
Author: Lukas Tönne <lukas@blender.org>
Date:   Mon Jun 19 14:28:03 2023 +0200

    Merge branch 'main' into new_nodegroup_interface

commit 3a2d943dd7
Merge: fbbfaf4dd0 8bcad285de
Author: Lukas Tönne <lukas@blender.org>
Date:   Mon Jun 19 14:16:06 2023 +0200

    Merge branch 'main' into new_nodegroup_interface

commit fbbfaf4dd0
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 20:53:44 2023 +0200

    Fix drag&drop ordering in some corner cases.

commit 3c7448aa5e
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 19:16:27 2023 +0200

    Drag and drop support, with some glitches.

commit 3c2892a2ea
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 16:33:58 2023 +0200

    Support full updates after renaming by passing on the bContext.

commit f733ce81f8
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 15:50:35 2023 +0200

    Support renaming of panels and sockets through the tree view items.

commit 70911abeb6
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 14:38:40 2023 +0200

    Rename panel.

commit a0fbfd458b
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 14:37:35 2023 +0200

    Draw socket circles to indicate inputs and outputs.

commit 381f979000
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 13:04:55 2023 +0200

    Added unique panel comparison and activation.

commit 5f5fda9091
Merge: 2557185df2 8c8e1ebdd2
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 10:43:55 2023 +0200

    Merge branch 'main' into new_nodegroup_interface

commit 2557185df2
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 10:43:32 2023 +0200

    TreeViewItems for panels.

commit be99d8ef7d
Merge: e4c57b24f0 e32f85c03e
Author: Lukas Tönne <lukas@blender.org>
Date:   Fri Jun 16 10:24:11 2023 +0200

    Merge branch 'main' into new_nodegroup_interface

commit e4c57b24f0
Author: Lukas Tönne <lukas@blender.org>
Date:   Thu Jun 15 19:12:37 2023 +0200

    New tree view template for node group interfaces.
This makes it possible to arrange sockets and panels more flexibly.
If sockets and panels are in separate lists there has to be a rule that
says which kind comes first in the UI. If we want to be able to move
sockets in front of panels and vice versa having a common list is
necessary.
Same as the data_type property of socket declarations.
Also added some sanity checks for pointer copies (BLI_strdup does not
like nullptr).
Index arithmetic is bound to go wrong when items are sorted internally.
Freeing items_array before copying can free a used copy because items
are usually copyied using MEM_dupallocN.
Aim is to reduce the C++ template complexity.
The C++ static dispatch methods (to_static_type like CPPType) are nice
for "true" C++ classes, but when mixing with C structs (DNA) it becomes
a headache to manage fake inheritance and similar features.

Better to keep it simple and stupid for now, even if that means
having centralized functions that have to handle all the types.
The reason is that swapping out the socket type of an item would require
replacing the entire struct, which invalidates pointers and is difficult
to manage in RNA.

The socket_data uses the existing `bNodeSocketValueXXX` structs from
nodes. Eventually nodes might also use this new implementation, and
code could be moved to a dedicated file, so adding socket types becomes
easier (less spread out code, most stuff in one place, better checks
when things are not implemented for a type).
These are not yet associated with the item instances, for that the
refine function needs to be updated.
Lukas Tönne added this to the Module: Nodes & Physics project 2023-07-19 18:21:54 +02:00
Lukas Tönne added the
Module
Nodes & Physics
label 2023-07-19 18:22:05 +02:00
Jacques Lucke reviewed 2023-07-19 18:33:54 +02:00
@ -0,0 +263,4 @@
* Stops if the operator return false:
* bool MyOperator(bNodeTreeInterfaceItem &item);
*/
template<typename Func> void foreach_item(Func op)
Member

Can use FunctionRef here instead of a template.

Can use `FunctionRef` here instead of a template.
LukasTonne marked this conversation as resolved
Lukas Tönne added 1 commit 2023-07-20 11:04:18 +02:00
Templated functors are only needed for static type dispatch.
Lukas Tönne added 1 commit 2023-07-20 18:53:17 +02:00
Test with a fake declarations list, this will be provided by the node
declaration when available.
Lukas Tönne added 1 commit 2023-07-20 18:58:11 +02:00
Lukas Tönne added 1 commit 2023-07-20 19:16:32 +02:00
Lukas Tönne added 1 commit 2023-07-21 12:58:05 +02:00
Lukas Tönne added 1 commit 2023-07-21 13:42:30 +02:00
Lukas Tönne added 1 commit 2023-07-21 15:44:43 +02:00
This list now owns SocketDeclaration pointers, the original inputs and
outputs lists now just hold raw pointers for convenience access.

The items list also contains panels, and it encodes the order of sockets
allowing for arbitrary mixing of sockets and panels.
Lukas Tönne added 1 commit 2023-07-21 17:53:10 +02:00
Lukas Tönne added 1 commit 2023-07-21 18:11:30 +02:00
The declaration is used both for group nodes and group input/output
nodes, where the SOCK_IN/SOCK_OUT flag is flipped.
Lukas Tönne added 1 commit 2023-07-21 18:36:57 +02:00
Lukas Tönne added 2 commits 2023-07-22 11:43:42 +02:00
This means templates are no longer supported in those DNA files.
The downcasting utility functions have been moved into the BKE file
as global functions in the node_interface namespace.
Lukas Tönne added 2 commits 2023-07-24 10:35:41 +02:00
Lukas Tönne added 1 commit 2023-07-24 10:39:40 +02:00
Lukas Tönne added 1 commit 2023-07-24 12:20:49 +02:00
Lukas Tönne added 1 commit 2023-07-24 12:36:55 +02:00
Lukas Tönne added 1 commit 2023-07-24 16:30:11 +02:00
There are socket types without data (e.g. Geometry) and future custom
socket types, so expecting every socket type to have a matching DNA
data struct is not correct.
Lukas Tönne added 1 commit 2023-07-24 16:31:48 +02:00
Required adding a uid_compat string pointer so old sockets can retain
the identifier string. New sockets will always use the simple integer,
but we cannot guarantee a matching identifier with the simplified
int uid.
Lukas Tönne added 1 commit 2023-07-24 18:19:10 +02:00
Member

@LukasTonne where does this break exactly? I see that e.g. void VKVertexAttributeObject::update_bindings(VKImmediate &immediate) also uses interface as variable name.

@LukasTonne where does this break exactly? I see that e.g. `void VKVertexAttributeObject::update_bindings(VKImmediate &immediate)` also uses `interface` as variable name.
Lukas Tönne added 1 commit 2023-07-25 12:11:52 +02:00
Author
Member

@LukasTonne where does this break exactly? I see that e.g. void VKVertexAttributeObject::update_bindings(VKImmediate &immediate) also uses interface 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.

> @LukasTonne where does this break exactly? I see that e.g. `void VKVertexAttributeObject::update_bindings(VKImmediate &immediate)` also uses `interface` 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.
Lukas Tönne added 1 commit 2023-07-25 12:38:41 +02:00
Lukas Tönne added 2 commits 2023-07-25 16:21:46 +02:00
Lukas Tönne added 1 commit 2023-07-25 18:37:46 +02:00
Lukas Tönne added 1 commit 2023-07-26 11:15:14 +02:00
Lukas Tönne added 1 commit 2023-07-26 11:36:58 +02:00
Lukas Tönne added 5 commits 2023-07-26 12:26:58 +02:00
Lukas Tönne added 2 commits 2023-07-26 12:35:25 +02:00
Lukas Tönne added 2 commits 2023-07-26 13:11:10 +02:00
Lukas Tönne added 2 commits 2023-07-26 13:45:30 +02:00
Lukas Tönne added 2 commits 2023-07-26 13:51:44 +02:00
Lukas Tönne added 1 commit 2023-07-26 14:31:14 +02:00
Lukas Tönne added 1 commit 2023-07-26 15:36:27 +02:00
Lukas Tönne added 2 commits 2023-07-26 15:55:08 +02:00
Lukas Tönne added 1 commit 2023-07-26 16:00:36 +02:00
Lukas Tönne added 1 commit 2023-07-26 17:18:26 +02:00
Lukas Tönne added 1 commit 2023-07-26 18:17:54 +02:00
Lukas Tönne added 2 commits 2023-07-27 10:32:42 +02:00
Lukas Tönne added 1 commit 2023-07-27 11:12:20 +02:00
Lukas Tönne added 1 commit 2023-07-27 11:53:11 +02:00
Lukas Tönne added 1 commit 2023-07-27 11:54:52 +02:00
Lukas Tönne added 3 commits 2023-07-27 14:25:57 +02:00
Lukas Tönne added 2 commits 2023-07-27 14:53:48 +02:00
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 1 commit 2023-07-27 15:56:00 +02:00
This is used for ID getter callbacks in ID socket types. These use an
index to defer value lookup and avoid capturing ID pointers in lambdas.
The item index find method included the root panel but the matching
lookup method did not, so all returned items were off by 1.
Lukas Tönne added 1 commit 2023-07-27 16:04:45 +02:00
Lukas Tönne added 1 commit 2023-07-27 18:00:19 +02:00
Lukas Tönne added 1 commit 2023-07-28 11:48:14 +02:00
Lukas Tönne added 3 commits 2023-07-28 12:40:26 +02:00
Lukas Tönne added 2 commits 2023-07-28 13:57:11 +02:00
In this case the modifier panel is checking for 'GEOMETRY' tree types
but prints warnings when the tree is a custom type because the -1 enum
value does not match any type. We don't need a complete list of types
here, just enough to verify the static types.
Lukas Tönne added 1 commit 2023-07-28 16:27:29 +02:00
Lukas Tönne added 2 commits 2023-07-31 13:06:48 +02:00
Lukas Tönne added 1 commit 2023-07-31 14:59:15 +02:00
Lukas Tönne added 1 commit 2023-07-31 15:54:02 +02:00
Lukas Tönne added 2 commits 2023-07-31 16:08:06 +02:00
This was short-lived and is superseded by the new panels system.
The older panels never got out of experimental state, so simply removing
the DNA instead of deprecating it should be fine.
Lukas Tönne added 7 commits 2023-07-31 17:03:21 +02:00
Lukas Tönne added 1 commit 2023-07-31 17:25:23 +02:00
This is because the DNA_DEPRECATED macro is disabled in node.cc and
renaming ensures the old DNA isn't used accidentally.
Lukas Tönne added 1 commit 2023-08-01 11:29:47 +02:00
Lukas Tönne added 2 commits 2023-08-01 17:23:23 +02:00
Lukas Tönne added 1 commit 2023-08-02 10:42:26 +02:00
Lukas Tönne added 2 commits 2023-08-02 11:45:07 +02:00
Lukas Tönne added 1 commit 2023-08-02 13:58:31 +02:00
Lukas Tönne added 1 commit 2023-08-02 14:12:34 +02:00
Lukas Tönne added 1 commit 2023-08-02 17:05:19 +02:00
"Make node group" and similar operators try to create sockets from the
final subtype names of sockets, which are not directly supported as
interface socket names.
Lukas Tönne added 1 commit 2023-08-02 17:20:59 +02:00
Lukas Tönne added 1 commit 2023-08-03 13:40:33 +02:00
Lukas Tönne added 1 commit 2023-08-03 14:22:12 +02:00
DNA type is `bNodeSocketValueBoolean` but RNA type is `NodeSocketBool`.
Lukas Tönne added 1 commit 2023-08-03 16:43:05 +02:00
Lukas Tönne added 1 commit 2023-08-03 17:39:41 +02:00
Lukas Tönne added 1 commit 2023-08-03 17:55:04 +02:00
Tests for mixed socket and panel layouts in node group interfaces.
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
1226a522a5
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 1 commit 2023-08-03 18:06:03 +02:00
Lukas Tönne added 1 commit 2023-08-04 09:53:18 +02:00
Merge branch 'main' into node-group-interface-ui
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
b4c59b4273
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 1 commit 2023-08-04 10:16:09 +02:00
Fixed new node group operator redo panel code.
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
8e7c13bf81
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 2 commits 2023-08-04 12:25:22 +02:00
Lukas Tönne added 1 commit 2023-08-04 13:39:57 +02:00
Lukas Tönne added 3 commits 2023-08-04 16:31:30 +02:00
Lukas Tönne added 1 commit 2023-08-07 11:22:38 +02:00
Lukas Tönne added 1 commit 2023-08-07 11:40:24 +02:00
Lukas Tönne added 1 commit 2023-08-07 14:03:25 +02:00
Lukas Tönne added 3 commits 2023-08-07 18:00:37 +02:00
Part 1/3 of #109135, #110272

Adds a new DNA structure for defining node group interfaces without
using `bNodeSocket` and with additional node UI item types.

Node group interfaces are organized as a hierarchy of "items", which
can be sockets or panels. Panels can contain both sockets and other
panels (although nested panels beyond the root panel may be disabled to
avoid complexity on the user level).

Sockets can be added to the interface in any order, not just the
conventional outputs..inputs order. Sockets can be marked as both input
and output, generating 2 sockets on node instances.

The C++ API in the DNA struct allows manipulating the interface
declaration by adding and removing items, moving them inside the
interface or into a different panel.
Lukas Tönne added 1 commit 2023-08-08 10:35:39 +02:00
Lukas Tönne added 1 commit 2023-08-08 11:00:45 +02:00
This avoids the need for [[maybe_unused]] attributes for silencing
compiler warnings.
Lukas Tönne added 6 commits 2023-08-08 11:05:14 +02:00
Lukas Tönne added 1 commit 2023-08-08 11:34:58 +02:00
The BLI_strdup function requires a non-null string, which adds a bunch
of extra null checks for every call.
Lukas Tönne added the
Interest
Compatibility
label 2023-08-08 11:55:17 +02:00
Lukas Tönne added 1 commit 2023-08-08 11:57:10 +02:00
Lukas Tönne added 5 commits 2023-08-08 12:22:41 +02:00
Lukas Tönne added 3 commits 2023-08-08 13:08:32 +02:00
A simple integer would be better here, but we have to keep supporting
old sockets.
A simple integer would be better here, but we have to keep supporting
old sockets.
Lukas Tönne added 13 commits 2023-08-08 16:06:58 +02:00
Lukas Tönne added 17 commits 2023-08-08 16:33:02 +02:00
Lukas Tönne added 1 commit 2023-08-09 10:27:02 +02:00
Lukas Tönne added 1 commit 2023-08-09 10:28:28 +02:00
Merge branch 'main' into node-group-interface-ui
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
11ef241396
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 2 commits 2023-08-09 11:55:21 +02:00
Lukas Tönne added 1 commit 2023-08-09 15:05:36 +02:00
Avoid memleak from versioning code for interface sockets.
Some checks failed
buildbot/vexp-code-patch-coordinator Build done.
456951639a
Interface sockets are constructed with an identifier that is then
replaced with the legacy socket identifier. The original identifier
needs to be freed here.
Author
Member

@blender-bot build

@blender-bot build
Lukas Tönne added 6 commits 2023-08-17 11:04:10 +02:00
Lukas Tönne added 1 commit 2023-08-17 11:33:21 +02:00
Socket color callbacks now have to treat the pointer argument as
optional, they cannot rely on the socket pointer to get the actual type.
Generate a dedicated callback for each builtin type so the pointer
argument can be ignored.
Author
Member

I consider this done, any remaining issues can be handled separately.

I consider this done, any remaining issues can be handled separately.
Lukas Tönne closed this pull request 2023-09-25 11:15:17 +02:00
First-time contributor

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.

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

Sign in to join this conversation.
No reviewers
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 Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#110272
No description provided.