Investigate Support for Enums data type for Node Group Inputs #82157

Open
opened 2020-10-27 17:06:42 +01:00 by Dalai Felinto · 18 comments

We currently use hard-coded DNA enums in many places. In general, the goal is that every input for a node can be exposed to other nodes. To achieve that, we need an enum socket type.

An enum's options could be stored in in the node socket declaration. One open question is whether to store values as integers or strings.

Enums options should be create-able by users. Though that wouldn't be a necessary first step, it should be taken into consideration for the architecture.

We currently use hard-coded DNA enums in many places. In general, the goal is that every input for a node can be exposed to other nodes. To achieve that, we need an enum socket type. An enum's options could be stored in in the node socket declaration. One open question is whether to store values as integers or strings. Enums options should be create-able by users. Though that wouldn't be a necessary first step, it should be taken into consideration for the architecture.
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @dfelinto

Added subscriber: @dfelinto
Author
Owner

This comment was removed by @dfelinto

*This comment was removed by @dfelinto*
Dalai Felinto changed title from Subtype data type for Node Group Inputs to Investigate Support for Enums data type for Node Group Inputs 2020-11-09 14:40:36 +01:00
Contributor

Added subscriber: @KenzieMac130

Added subscriber: @KenzieMac130
Contributor

Could this be accessed via integer or string and if a search or bounds check fails raise a node warning and fall back to default?

Another question comes up is compatibility. If an enumerator expands between versions and a node asset expects specific values driven by logic that could not reasonably handled by compatibility code (say encoding an int into an attribute and casting back) what should happen? Would developers be tasked with avoiding such breaking changes or would it be up to the users to resolve this issue?

Could this be accessed via integer or string and if a search or bounds check fails raise a node warning and fall back to default? Another question comes up is compatibility. If an enumerator expands between versions and a node asset expects specific values driven by logic that could not reasonably handled by compatibility code (say encoding an int into an attribute and casting back) what should happen? Would developers be tasked with avoiding such breaking changes or would it be up to the users to resolve this issue?

Added subscriber: @brecht

Added subscriber: @brecht

In node graphs, I don't think we should aim to support converting between enums and integers / strings, and all the issues that come with that. The purpose of this task is to make group nodes more powerful, for which you just need to be able to expose enums as enums in groups.

In node graphs, I don't think we should aim to support converting between enums and integers / strings, and all the issues that come with that. The purpose of this task is to make group nodes more powerful, for which you just need to be able to expose enums as enums in groups.
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

I haven't looked into this at all, but my hunch is that there should be a way to pass around a pointer the enum property or its items when exposing to a group. Since this is already done for RNA sub-types maybe it won't be so bad.

Of course we would need to think about whether to expose it as a new socket type or as an int socket. I think a new socket type might make more sense.

I haven't looked into this at all, but my hunch is that there should be a way to pass around a pointer the enum property or its items when exposing to a group. Since this is already done for RNA sub-types maybe it won't be so bad. Of course we would need to think about whether to expose it as a new socket type or as an int socket. I think a new socket type might make more sense.

Added subscriber: @AngeloTartanian

Added subscriber: @AngeloTartanian

Agree that enums should be a new socket type. My bigger concern is how to communicate compatible enum types between sockets. It would seem that each enum would essentially be it's own "type" and there should be some way of showing that the enum "type" doesn't match between an output and an input. This brings up the larger issue of being able to specify socket types when adding them to a group input/geo node input. Or are we just talking about exposing existing enums but not allowing users to create their own enums?

Agree that enums should be a new socket type. My bigger concern is how to communicate compatible enum types between sockets. It would seem that each enum would essentially be it's own "type" and there should be some way of showing that the enum "type" doesn't match between an output and an input. This brings up the larger issue of being able to specify socket types when adding them to a group input/geo node input. Or are we just talking about exposing existing enums but not allowing users to create their own enums?
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Member

In relation to this, is there a task for including UI widgets such as a Color Ramp or Curves in Node Groups?

In relation to this, is there a task for including UI widgets such as a Color Ramp or Curves in Node Groups?

Added subscriber: @GeorgiaPacific

Added subscriber: @GeorgiaPacific

Added subscriber: @Yuro

Added subscriber: @Yuro
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member
https://devtalk.blender.org/t/enum-sockets-proposal/21318

Added subscriber: @mod_moder

Added subscriber: @mod_moder
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 project
No Assignees
10 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#82157
No description provided.