Refactoring: Geometry Nodes: Generalize enum source sockets #117608

Open
Iliya Katushenock wants to merge 7 commits from mod_moder/blender:tmp_refactor_enum_source into main

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

Goal of this refactoring is to represent enumerations of socket via its declaration.
Instead of support some certain nodes with definition of enum in its, propagate
enum references from source sockets which is know its own enum.
Now, to add new enum definition to node ui, declaration of socket just required.

Goal of this refactoring is to represent enumerations of socket via its declaration. Instead of support some certain nodes with definition of enum in its, propagate enum references from source sockets which is know its own enum. Now, to add new enum definition to node ui, declaration of socket just required.
Iliya Katushenock added the
Interest
Geometry Nodes
label 2024-01-28 21:03:13 +01:00
Iliya Katushenock added 1 commit 2024-01-28 21:03:22 +01:00
Iliya Katushenock added this to the Nodes & Physics project 2024-01-28 21:03:54 +01:00
Iliya Katushenock requested review from Lukas Tönne 2024-01-28 21:04:06 +01:00
Iliya Katushenock requested review from Jacques Lucke 2024-01-28 21:04:07 +01:00
Lukas Tönne requested changes 2024-01-29 09:46:52 +01:00
Lukas Tönne left a comment
Member

Generally i like the idea, but requested some changes/clarification.

Generally i like the idea, but requested some changes/clarification.
@ -315,6 +315,9 @@ bool SocketValueVariant::valid_for_socket(eNodeSocketDatatype socket_type) const
if (kind_ == Kind::None) {
return false;
}
if (ELEM(SOCK_INT, socket_type_, socket_type) && ELEM(SOCK_MENU, socket_type_, socket_type)) {
Member

Is this a fix for a different problem? I don't see how it's related to the enum items propagation below. Why is it here?

Is this a fix for a different problem? I don't see how it's related to the enum items propagation below. Why is it here?
Author
Member

This was mistakenly include this change in this branch.

This was mistakenly include this change in this branch.
mod_moder marked this conversation as resolved
@ -811,3 +812,3 @@
* definition to use for menu sockets. */
for (bNode *node : ntree.toposort_right_to_left()) {
const bool node_updated = this->should_update_individual_node(ntree, *node);
// const bool node_updated = this->should_update_individual_node(ntree, *node);
Member

This flag is currently used to avoid unnecessary updates when the node hasn't actually changed. A node tree update can happen for any number of reasons, and if the enum items haven't been changed it should not cause ripple effects by propagating "new" enum definitions. I don't see an equivalent check in the new code. Should be possible to include this after the is_enum_source condition?

This flag is currently used to avoid unnecessary updates when the node hasn't actually changed. A node tree update can happen for any number of reasons, and if the enum items haven't been changed it should not cause ripple effects by propagating "new" enum definitions. I don't see an equivalent check in the new code. Should be possible to include this after the `is_enum_source` condition?
Author
Member

Generally, there is needed some kind flag of nodes to propagate changes state from updated node with enum-source socket.
At the current state of PR, i am not sure if such simple check is enough.

Generally, there is needed some kind flag of nodes to propagate changes state from updated node with enum-source socket. At the current state of PR, i am not sure if such simple check is enough.
mod_moder marked this conversation as resolved
Iliya Katushenock added 2 commits 2024-01-29 15:08:36 +01:00
Iliya Katushenock added 1 commit 2024-01-29 18:28:10 +01:00
Iliya Katushenock added 1 commit 2024-01-29 18:36:47 +01:00
Iliya Katushenock added 1 commit 2024-01-29 19:35:36 +01:00
Iliya Katushenock added 1 commit 2024-01-29 19:50:47 +01:00
Iliya Katushenock requested review from Lukas Tönne 2024-01-29 19:51:11 +01:00
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u tmp_refactor_enum_source:mod_moder-tmp_refactor_enum_source
git checkout mod_moder-tmp_refactor_enum_source
Sign in to join this conversation.
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.

Reference: blender/blender#117608
No description provided.