Nodes: add int and bool to shader nodegroups #115026
No reviewers
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#115026
Loading…
Reference in New Issue
No description provided.
Delete Branch "Diana-G/blender:shader-ints-bools"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ints and Bools work as expected in shader nodegroups. I've known users in the past used the python api to add sockets of these types to shader nodegroups as they could not be selected via the dropdown, but that no longer works in 4.0. So I was wondering if there was a reason it was not included in the dropdown (maybe some sorta technical reason or something).
Also, I'm not sure if I'm following the correct protocol for making a PR
Also the fact their not supported any more isn't in the release notes
I think you need to tag reviewers. You can ask on Nodes & Physics module chat
I'm not sure how to do that, this is my first time really doing anything with blender development/etc
Seems reasonable to me, I guess this was already possible in the past through Python. It's a bit weird though, since they aren't really passed as integers or booleans at all. Brecht would probably know best whether this is the right way to go.
It's much needed UX tool, OSL shaders already have them, so they are present in Shader Nodes. It allows asset creators to restrict value to either 0 or 1 (or for example 0-1-2 for when choosing axis) and avoid anything in the middle. Currently we have to do math nodes for that behavior, but on user level it still looks like they can set value to 0.5 and get other result, so the property isn't communicated correctly to the user.
I've used ints extensively in my nodegroups ever since i found the python command i could run to add them to my groups. Was really bummed out when i couldn't add them anymore with 4.0, hoping this gets accepted especially now that bools work as well, previously i just used an int between 0 and 1 for switches so having an actual checkbox would be fantastic
they are passed as ints, just the UI doesnt show it. had to switch things to floats and add extra round nodes to unbreak some nodetrees we had.
actually afaik theyre casted to floats and passed around as such, since shader nodes only accept floats, etc. the functionality for ints to floats have existed for years afaik while bools being casted is a new thing with 4.0
Right, but that 'cast to floats' effectively does a round on them, so you get an integer value, which if you just set the socket to float you loose, which then breaks the shaders that were using them.
well yea, it displays to the user as an int (and therefore is locked to ints/whole numbers only) while technically internally its a float, preventing a user from entering in non whole values
The main weakness I think is that there for larger integer values, floats can't represent them exactly so they will be off by a bit. But they end will end up in a float precision render buffer anyway, so it seems acceptable until there is native support.
@blender-bot build
One of the test is failing, as can be seen in the buildbot logs:
https://builder.blender.org/admin/#/builders/132/builds/2881/steps/6/logs/stdio
I'm not sure if this is what I was supposed to do
@blender-bot build
how would i go about fixing the failed tests?
Merging latest main into this pull request should fix it.
Oh thank you, I forgot I made this PR