Fix #105553: do not copy "Roughness" value from the previous node #105596

Open
Weizhen Huang wants to merge 1 commits from weizhen/blender:do_not_copy_roughness into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

"Roughness" value is not copied, but the link is still preserved, not sure if this is reasonable.

"Roughness" value is not copied, but the link is still preserved, not sure if this is reasonable.
Weizhen Huang added 1 commit 2023-03-09 11:59:37 +01:00
Weizhen Huang added this to the Render & Cycles project 2023-03-09 12:02:26 +01:00
Weizhen Huang requested review from Brecht Van Lommel 2023-03-09 12:03:28 +01:00
Author
Member

Jacques was suggesting comparing the identifier instead of name. identifier is default to name if not specified:

socket_decl->identifier = identifier.is_empty() ? name : identifier;

I didn't know this field exists, I think it is a good idea, if a new socket needs to be differentiated from others with the same name we can add an identifier to it. But not sure about the existing ones.

Jacques was suggesting comparing the `identifier` instead of `name`. `identifier` is default to `name` if not specified: https://projects.blender.org/blender/blender/src/commit/3b900048f1c5ec098adea09620399ef8266d723b/source/blender/nodes/NOD_node_declaration.hh#L729 I didn't know this field exists, I think it is a good idea, if a new socket needs to be differentiated from others with the same name we can add an identifier to it. But not sure about the existing ones.
Brecht Van Lommel requested changes 2023-03-09 18:26:12 +01:00
Brecht Van Lommel left a comment
Owner

The identifier should be valid on all existing shading nodes, as Cycles uses this for exporting shader nodes and does not look at the name.

Can you specifically add a test for the Diffuse BSDF and the Hair BSDFs to not copy the roughness to other nodes? Copying roughness between Glossy and Glass for example should be fine.

The identifier should be valid on all existing shading nodes, as Cycles uses this for exporting shader nodes and does not look at the name. Can you specifically add a test for the Diffuse BSDF and the Hair BSDFs to not copy the roughness to other nodes? Copying roughness between Glossy and Glass for example should be fine.

Still not sure if such selective exclusions even make sense if the name and type are the same...

Still not sure if such selective exclusions even make sense if the name and type are the same...
Author
Member

@mod_moder There are different roughness types, specified for half angle or outgoing direction for example, they are not quite the same thing. I'm actually more interested in another field called "Transmission", that also has different meanings in different context, it could be transmission between two interfaces or transmission through a thin object.
But if we could make that distinction in the identifier, I guess I can do without this patch, I just add identifiers to where they are needed.

@mod_moder There are different roughness types, specified for half angle or outgoing direction for example, they are not quite the same thing. I'm actually more interested in another field called "Transmission", that also has different meanings in different context, it could be transmission between two interfaces or transmission through a thin object. But if we could make that distinction in the identifier, I guess I can do without this patch, I just add identifiers to where they are needed.

@weizhen It would be better if you added a formalized description of this (for example, a set of references to node types) to make this kind of processing a post-processing stage of an already modified node.
It would raise far fewer questions about why this should happen.
Also, then it would be possible to somehow add a mask of sockets to indicate that they are specific to each node.

@weizhen It would be better if you added a formalized description of this (for example, a set of references to node types) to make this kind of processing a post-processing stage of an already modified node. It would raise far fewer questions about why this should happen. Also, then it would be possible to somehow add a mask of sockets to indicate that they are specific to each node.

There may also be a variant of the is_unreplaceable~ flag to declare a socket, which would mean that this node's socket cannot be replaced in another node. But it is better to approve with Jacques.

There may also be a variant of the `is_unreplaceable`~ flag to declare a socket, which would mean that this node's socket cannot be replaced in another node. But it is better to approve with Jacques.

We considered making this a generic system but it seems a bit complicated for now and unclear if it's worth it. When it becomes clear this is needed for other cases we can make it into something more generic.

We considered making this a generic system but it seems a bit complicated for now and unclear if it's worth it. When it becomes clear this is needed for other cases we can make it into something more generic.
Weizhen Huang closed this pull request 2023-03-15 14:34:33 +01:00
Weizhen Huang reopened this pull request 2023-03-15 14:34:43 +01:00
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u do_not_copy_roughness:weizhen-do_not_copy_roughness
git checkout weizhen-do_not_copy_roughness
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
3 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#105596
No description provided.