When changing the node type in material, sockets of different node types are reused #105553
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105553
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
System Information
Operating system: MacOS
Graphics card: Apple M1
Blender Version
Broken: main
Worked: don't know
Short description of error
Shader nodes that have the same input sockets can have different default values.
But if you switch between shader nodes in the material interface, then the default values will first of all be copied from pre-existing socket of a node of a different type. Because of this, default values may not be used and may look strange.
Exact steps for others to reproduce the error
In the default scene, assign Glass BSDF material to the default cube, and check the "Roughness" field. Now assign another material without "Roughness", such as Hair BSDF, then assign Glass BSDF material again and check the "Roughness" field.
This issue is not limited to the name "Roughness". For example Principled BSDF has a field called "Transmission" with a default value of 0. If I write another shader with a "Transmission" field with some other default value, the default value would nevertheless be 0.
Hi, I'm not sure if this is a bug with complex behavior, given that the default value is specified in the declaration https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_bsdf_principled.cc#L53
That is only the default "Roughness" value for Principled BSDF. Glossy BSDF also has a "Roughness" of 0.5 https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_bsdf_glossy.cc#L12.
Some other BSDFs have different default values, but when loaded they all start with 0.5.
https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_bsdf_refraction.cc#L12
https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_bsdf_diffuse.cc#L12
https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/shader/nodes/node_shader_bsdf_glass.cc#L12
I'm not sure if different default values are a bug, although it can be fixed.
I don't think different default values is a bug, it's reasonable for different shaders to have different default values, they shouldn't interfere with each other.
All finally, I see what you mean.
Still not sure if this is a bug.
Wrong default value in shadersto When changing the node type in material, declarations of different node types are reusedThis behavior is a consequence of the operation of updating the node declaration for sockets.
The node reuses old sockets, which makes their values in scope and take precedence over the default values.
This works fine for node groups. But it seems that this may be inconsistent for shader nodes?
This mechanism also works for links, so it seems more and more that it's not a bug and don't look weird...
When changing the node type in material, declarations of different node types are reusedto When changing the node type in material, sockets of different node types are reusedOk I see your point now, this is assuming that different nodes with the same input name have the same meaning, so the value can be copied from the previous one. This makes sense sometimes, maybe this is not a bug, but for nodes with the same input name but different meanings this is quite unintuitive.