Refactoring: Nodes: Dynamic declaration for dynamically-typed nodes #113553

Merged
Jacques Lucke merged 31 commits from mod_moder/blender:refacoring_node_declarations into main 2023-11-17 16:23:45 +01:00

Refactoring of nodes. Replacing of declarations with all supported sockets by dynamic declarations.
All dynamically-typed socket is created for each node now individually. No more _001-like names.
All hidden socket also deleted now. See: #104126.

  • Drag and drop link search refactoring: #113742.
  • Deal with GField on node level: #113743, #111196.
  • Conversion of custom data type to node type, and reverse: #113744.

  • GEO_NODE_ACCUMULATE_FIELD
  • GEO_NODE_CAPTURE_ATTRIBUTE
  • GEO_NODE_ATTRIBUTE_STATISTIC
  • GEO_NODE_BLUR_ATTRIBUTE
  • GEO_NODE_EVALUATE_AT_INDEX
  • GEO_NODE_EVALUATE_ON_DOMAIN
  • GEO_NODE_INPUT_NAMED_ATTRIBUTE
  • GEO_NODE_RAYCAST
  • GEO_NODE_SAMPLE_INDEX
  • GEO_NODE_SAMPLE_NEAREST_SURFACE
  • GEO_NODE_SAMPLE_UV_SURFACE
  • GEO_NODE_STORE_NAMED_ATTRIBUTE
  • GEO_NODE_VIEWER

Backward compatibility introduced by this commit.
See #113497 for forward compatibility.

Nice new feature: Changing the socket type does not break the link (for nodes that have changed in this pr).

Refactoring of nodes. Replacing of declarations with all supported sockets by dynamic declarations. All dynamically-typed socket is created for each node now individually. No more `_001`-like names. All hidden socket also deleted now. See: #104126. - [x] Drag and drop link search refactoring: #113742. - [x] Deal with GField on node level: #113743, #111196. - [x] Conversion of custom data type to node type, and reverse: #113744. --- - [x] `GEO_NODE_ACCUMULATE_FIELD` - [x] `GEO_NODE_CAPTURE_ATTRIBUTE` - [x] `GEO_NODE_ATTRIBUTE_STATISTIC` - [x] `GEO_NODE_BLUR_ATTRIBUTE` - [x] `GEO_NODE_EVALUATE_AT_INDEX` - [x] `GEO_NODE_EVALUATE_ON_DOMAIN` - [x] `GEO_NODE_INPUT_NAMED_ATTRIBUTE` - [x] `GEO_NODE_RAYCAST` - [x] `GEO_NODE_SAMPLE_INDEX` - [x] `GEO_NODE_SAMPLE_NEAREST_SURFACE` - [x] `GEO_NODE_SAMPLE_UV_SURFACE` - [x] `GEO_NODE_STORE_NAMED_ATTRIBUTE` - [x] `GEO_NODE_VIEWER` Backward compatibility introduced by this commit. See #113497 for forward compatibility. Nice new feature: Changing the socket type does not break the link (for nodes that have changed in this pr).
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-10-11 17:35:52 +02:00
Iliya Katushenock added 1 commit 2023-10-11 17:36:06 +02:00
Jacques Lucke reviewed 2023-10-11 17:44:55 +02:00
@ -47,0 +32,4 @@
BaseSocketDeclarationBuilder *value_declaration = nullptr;
switch (data_type) {
case CD_PROP_FLOAT3:
value_declaration = &b.add_input<decl::Vector>("Value").default_value({1.0f, 1.0f, 1.0f});
Member

missing break.

missing `break`.
mod_moder marked this conversation as resolved
Iliya Katushenock added 2 commits 2023-10-11 20:39:06 +02:00
Iliya Katushenock changed title from WIP: Refactoring: Geometry Nodes: Dynamic declaration of node instead of update function to WIP: Refactoring: Nodes: Dynamic declaration for dynamically-typed nodes 2023-10-12 21:34:09 +02:00
Iliya Katushenock added 1 commit 2023-10-12 21:37:06 +02:00
Iliya Katushenock added 1 commit 2023-10-12 21:46:42 +02:00
Iliya Katushenock added 2 commits 2023-10-13 11:03:34 +02:00
Iliya Katushenock changed title from WIP: Refactoring: Nodes: Dynamic declaration for dynamically-typed nodes to Refactoring: Nodes: Dynamic declaration for dynamically-typed nodes 2023-10-13 11:47:14 +02:00
Iliya Katushenock added 1 commit 2023-10-13 11:47:21 +02:00
Iliya Katushenock added this to the Nodes & Physics project 2023-10-13 11:47:24 +02:00
Iliya Katushenock added 2 commits 2023-10-13 12:32:32 +02:00
Iliya Katushenock added 1 commit 2023-10-13 12:42:23 +02:00
Iliya Katushenock added 1 commit 2023-10-16 21:33:10 +02:00
Iliya Katushenock added 2 commits 2023-10-17 16:14:31 +02:00
Iliya Katushenock requested review from Jacques Lucke 2023-10-17 16:15:14 +02:00
Iliya Katushenock added 1 commit 2023-10-17 16:16:14 +02:00
Iliya Katushenock added 1 commit 2023-10-17 16:17:21 +02:00
Iliya Katushenock added 1 commit 2023-10-17 16:18:24 +02:00
Jacques Lucke requested changes 2023-10-18 11:37:13 +02:00
Jacques Lucke left a comment
Member

Please remove the following nodes from this patch for now:

  • Compare
  • Random Value
  • Curve Sample
  • Mix

That is because those nodes are either also used by shader nodes or because they not only have the normal attribute sockets.

Also, various tests are failing currently. My guess is that this is caused by wrong versioning. An initial investigation also points at version_geometry_nodes_extrude_smooth_propagation.

Please remove the following nodes from this patch for now: * Compare * Random Value * Curve Sample * Mix That is because those nodes are either also used by shader nodes or because they not only have the normal attribute sockets. Also, various tests are failing currently. My guess is that this is caused by wrong versioning. An initial investigation also points at `version_geometry_nodes_extrude_smooth_propagation`.
Iliya Katushenock added 2 commits 2023-10-18 20:16:41 +02:00
Iliya Katushenock added 4 commits 2023-10-20 16:28:43 +02:00
Iliya Katushenock requested review from Jacques Lucke 2023-10-20 16:29:24 +02:00
Iliya Katushenock added 1 commit 2023-11-15 14:17:37 +01:00
Jacques Lucke requested changes 2023-11-15 17:12:14 +01:00
Jacques Lucke left a comment
Member
  • The nodes that are updated in this patch can be removed from get_current_socket_identifier_for_future_socket.
* [x] The nodes that are updated in this patch can be removed from `get_current_socket_identifier_for_future_socket`.
@ -1796,6 +1841,23 @@ void blo_do_versions_400(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 34)) {
Member

This versioning code should be at the bottom of the file.

This versioning code should be at the bottom of the file.
mod_moder marked this conversation as resolved
Jacques Lucke reviewed 2023-11-15 17:13:37 +01:00
@ -1797,2 +1842,4 @@
}
if (!MAIN_VERSION_FILE_ATLEAST(bmain, 400, 34)) {
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
Member

Don't check nodes in non-geometry-nodes trees.
Also better use a single loop over the nodes with a switch statement for the node type.

Don't check nodes in non-geometry-nodes trees. Also better use a single loop over the nodes with a switch statement for the node type.
Author
Member

Just not sure if i want put there a long switch statement. This might be parallel though.

Just not sure if i want put there a long switch statement. This might be parallel though.
Member

Using a switch statement is better. Switch statement are especially good when there are many cases.

Using a switch statement is better. Switch statement are especially good when there are many cases.
mod_moder marked this conversation as resolved
Iliya Katushenock added 2 commits 2023-11-15 18:03:40 +01:00
Iliya Katushenock requested review from Jacques Lucke 2023-11-15 19:37:56 +01:00
Iliya Katushenock added 2 commits 2023-11-16 05:06:58 +01:00
Jacques Lucke reviewed 2023-11-16 15:55:01 +01:00
@ -1966,0 +2013,4 @@
if (ntree->type != NTREE_GEOMETRY) {
continue;
}
versioning_node_dynamic_socket(*ntree, GEO_NODE_ACCUMULATE_FIELD, " ", " ", 1, 3);
Member

/* This node requires the extra totalparameter, because theGroup Index identifier also has a space in the name, that should not be treated as separator. */

`/* This node requires the extra `total` parameter, because the `Group Index` identifier also has a space in the name, that should not be treated as separator. */`
mod_moder marked this conversation as resolved
Iliya Katushenock added 3 commits 2023-11-17 11:59:31 +01:00
Member

@blender-bot build

@blender-bot build
Jacques Lucke approved these changes 2023-11-17 14:21:17 +01:00
Jacques Lucke merged commit 8149678d5e into main 2023-11-17 16:23:45 +01:00
Iliya Katushenock deleted branch refacoring_node_declarations 2023-11-17 16:30:31 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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
2 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#113553
No description provided.