Nodes: Add dropdown to select group socket subtype #105614

Merged
Hans Goudey merged 5 commits from HooglyBoogly/blender:node-group-io-subtype into main 2023-04-03 18:23:42 +02:00
Member

Previously the only way to control the subtype was to remove the group
input or output and create it again. This commit adds a dropdown to
change an existing socket, for supported socket types.

Based on a patch by Angus Stanton: https://developer.blender.org/D15715

It was necessary to fix the UI code slightly; the layout's context
wasn't being used in calls to an operator's enum items callback.

Previously the only way to control the subtype was to remove the group input or output and create it again. This commit adds a dropdown to change an existing socket, for supported socket types. Based on a patch by Angus Stanton: https://developer.blender.org/D15715 It was necessary to fix the UI code slightly; the layout's context wasn't being used in calls to an operator's enum items callback.
Hans Goudey added this to the 3.6 LTS milestone 2023-03-09 18:08:15 +01:00
Hans Goudey added the
Module
Nodes & Physics
label 2023-03-09 18:08:15 +01:00
Hans Goudey added 1 commit 2023-03-09 18:08:27 +01:00
6f3b967ac0 Nodes: Add dropdown to select group socket subtype
Previously the only way to control the subtype was to remove the group
input or output and create it again. This commit adds a dropdown to
change an existing socket, for supported socket types.

Based on a patch by Angus Stanton: https://developer.blender.org/D15715
Hans Goudey requested review from Jacques Lucke 2023-03-09 18:08:46 +01:00
Hans Goudey requested review from Simon Thommes 2023-03-09 18:08:46 +01:00
Hans Goudey added this to the Nodes & Physics project 2023-03-09 18:08:55 +01:00
Jacques Lucke requested changes 2023-03-11 10:58:30 +01:00
Jacques Lucke left a comment
Member

Thanks, seems to work in my test. The main issue I found is that the default and min/max values are reset when changing the subtype.

Thanks, seems to work in my test. The main issue I found is that the default and min/max values are reset when changing the subtype.
@ -11162,6 +11162,12 @@ static void rna_def_node_socket(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_def_property_ui_text(prop, "Type Label", "Label to display for the socket type in the UI");
prop = RNA_def_property(srna, "bl_subtype_label", PROP_STRING, PROP_NONE);
Member

Is that readonly?

Is that readonly?
Hans Goudey added 2 commits 2023-03-15 14:59:23 +01:00
Hans Goudey requested review from Jacques Lucke 2023-03-15 14:59:29 +01:00
Member

Almost there. Currently the subtype in the modifier does not update when I have it in the node editor. I think the issue is that the subtype stored in bNodeSocketValueVector is not updated now.

Almost there. Currently the subtype in the modifier does not update when I have it in the node editor. I think the issue is that the `subtype` stored in `bNodeSocketValueVector` is not updated now.
Hans Goudey added 2 commits 2023-04-03 17:47:38 +02:00
Jacques Lucke approved these changes 2023-04-03 18:16:15 +02:00
Hans Goudey merged commit e7f395dd20 into main 2023-04-03 18:23:42 +02:00
Hans Goudey deleted branch node-group-io-subtype 2023-04-03 18:23:43 +02:00
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.

Dependencies

No dependencies set.

Reference: blender/blender#105614
No description provided.