Cycles: support popup widget metadata for OSL shaders #106508

Open
opened 2023-04-03 21:02:18 +02:00 by sanek122005 · 7 comments

System Information
Operating system: Ubuntu 20.04
Graphics card: Geforce MX230

Blender Version
Broken: 3.5

Short description of error
setting the widget parameter as "popup" in the shader metadata should create a drop-down list in the node UI. This works in Houdini, but in blender instead it's a regular slider

Worked:
ANKnCy3_ICA.jpg

Don`t Worked:
Screenshot_20230403_215854.png

a place in the shader code that sets the widget to look like this:
Screenshot_20230403_215242.png

Exact steps for others to reproduce the error

  1. Take the OSL shader in the attached files
  2. Load it
  3. See on node GUI
**System Information** Operating system: Ubuntu 20.04 Graphics card: Geforce MX230 **Blender Version** Broken: 3.5 **Short description of error** setting the widget parameter as "popup" in the shader metadata should create a drop-down list in the node UI. This works in Houdini, but in blender instead it's a regular slider Worked: ![ANKnCy3_ICA.jpg](/attachments/ff264d20-707a-4caa-a836-5421dce69bb5) Don`t Worked: ![Screenshot_20230403_215854.png](/attachments/3cbee8ad-4817-4fdc-9947-3142891c9835) a place in the shader code that sets the widget to look like this: ![Screenshot_20230403_215242.png](/attachments/363aa794-16b4-4fdb-8e4b-443452f32897) **Exact steps for others to reproduce the error** 1. Take the OSL shader in the attached files 2. Load it 3. See on node GUI
sanek122005 added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-04-03 21:02:19 +02:00

I'm not sure if something like this should work when we don't have an enum socket.

I'm not sure if something like this should work when we don't have an enum socket.
Iliya Katushenock added the
Interest
Nodes & Physics
Interest
Render & Cycles
labels 2023-04-03 21:09:04 +02:00
Author

yes, but we have the usual drop-down lists. While there are no enum sockets, why not temporarily replace them with just a GUI element without a socket?

Screenshot_20230403_215252.png

yes, but we have the usual drop-down lists. While there are no enum sockets, why not temporarily replace them with just a GUI element without a socket? ![Screenshot_20230403_215252.png](/attachments/cc7d0cfd-ae37-4cb8-aca9-b2fb70de56dc)

Because it would be a new feature, rather unusual. And it would cease to be a socket.

Because it would be a new feature, rather unusual. And it would cease to be a socket.
Member

Because it would be a new feature, rather unusual. And it would cease to be a socket.

These enums are still (int) sockets which are not linkable (see usages of SOCKET_ENUM and friends).


This all could be done I think, e.g. OSLNode::add_input would need to be extended to support passing enum values to NodeType::register_input that it needs to get from the metadata "options".

For now though, this is just not implemented and looks like a feature request (rather than a bug).

Would be nice to add this as limitation to the manual though:
https://docs.blender.org/manual/en/3.6/render/shader_nodes/osl.html

@brecht : totally unsure what kind of priority this has (as compared to e.g. adding AOV support to OSL), would raise my hand to volunteer looking into this further if this is to be kept as TODO.

Otherwise, we would have to close this as a feature request though due to the following policy:

Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors.

For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug 
> Because it would be a new feature, rather unusual. And it would cease to be a socket. These enums are still (int) sockets which are not linkable (see usages of `SOCKET_ENUM` and friends). ----- This all could be done I think, e.g. `OSLNode::add_input` would need to be extended to support passing enum values to `NodeType::register_input` that it needs to get from the metadata "options". For now though, this is just not implemented and looks like a feature request (rather than a bug). Would be nice to add this as limitation to the manual though: https://docs.blender.org/manual/en/3.6/render/shader_nodes/osl.html @brecht : totally unsure what kind of priority this has (as compared to e.g. adding AOV support to OSL), would raise my hand to volunteer looking into this further if this is to be kept as TODO. Otherwise, we would have to close this as a feature request though due to the following policy: ``` Thanks for the report, but the issue reported here is a request for modified/improved behavior and not a bug in current behavior. Closing as this bug tracker is only for bugs and errors. For user requests and feedback, please use other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests For more information on why this isn't considered a bug, visit: https://wiki.blender.org/wiki/Reference/Not_a_bug ```

@lichtwerk Enum sockets are not currently supported, this is a big topic for the node module and is not being developed yet. I'm not sure it would be easy to add this.
And if just make it a property of the node, which is much simpler, then it would not be a socket to which you can connect something.

@lichtwerk Enum sockets are not currently supported, this is a big topic for the node module and is not being developed yet. I'm not sure it would be easy to add this. And if just make it a property of the node, which is much simpler, then it would not be a socket to which you can connect something.
Member

@lichtwerk Enum sockets are not currently supported, this is a big topic for the node module and is not being developed yet. I'm not sure it would be easy to add this.

Well, it might not be supported as-in exposed to geonodes, but internally SOCKET_ENUM is used to let NodeType::register_input know about a dropdown (in Cycles), there is also NODE_SOCKET_API to have a look at and see how this actually ends up in blender - if we decide to pursue this further. But since this is about Cycles, there is a good chance this could be supported after the script node was compiled and metadata is accessible. To really now, I'd have to spend more time on this though [which I wont do unless there is green light from the module].

> @lichtwerk Enum sockets are not currently supported, this is a big topic for the node module and is not being developed yet. I'm not sure it would be easy to add this. Well, it might not be supported as-in exposed to geonodes, but internally `SOCKET_ENUM` is used to let `NodeType::register_input` know about a dropdown (in Cycles), there is also `NODE_SOCKET_API` to have a look at and see how this actually ends up in blender - if we decide to pursue this further. But since this is about Cycles, there is a good chance this could be supported after the script node was compiled and metadata is accessible. To **really now**, I'd have to spend more time on this though [which I wont do unless there is green light from the module].
Brecht Van Lommel added
Type
To Do
and removed
Priority
Normal
Status
Needs Info from Developers
Type
Report
labels 2023-04-04 20:48:41 +02:00
Brecht Van Lommel changed title from "popup" widget in OSL as ignored to Cycles: support "popup" widget in OSL 2023-04-04 20:48:56 +02:00
Brecht Van Lommel added this to the Render & Cycles project 2023-04-04 20:49:15 +02:00

I've marked this as a To Do now. But this is indeed blocked by proper support for enum sockets on the Blender side.

I've marked this as a To Do now. But this is indeed blocked by proper support for enum sockets on the Blender side.
Brecht Van Lommel changed title from Cycles: support "popup" widget in OSL to Cycles: support popup widget metadata for OSL shaders 2023-04-04 20:50:16 +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
4 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#106508
No description provided.