Breaking shader node changes for 5.0 #96219
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
11 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#96219
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?
There are a number of proposed changes to shader nodes that break the Python API, mainly for add-ons that import and export shaders. The next opportunity to make these breaking changes in Blender 5.0.
Patches:
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @brecht
Gathering feedback on devtalk here:
https://devtalk.blender.org/t/feedback-on-breaking-python-api-changes-for-shader-nodes/23281
Added subscriber: @MysteryPancake
Is there any way the Python API could be detoured to avoid breaking changes? E.g. "Fac" in the API aliased to "Factor"?
It would be a shame to have more duplicate code for Mix/Combine/Separate nodes
Added subscriber: @EAW
Added subscriber: @Diogo_Valadares
The problem is that some scripts use
.name
instead of the.identifier
, and worse, thatnode.inputs["Factor"]"
actually use the name instead of the identifier currently.Added subscriber: @Aeraglyx
Added subscribers: @Ethan-Hall, @HooglyBoogly, @fclem, @CharlieJolly
@CharlieJolly, @HooglyBoogly, @MysteryPancake, @Ethan-Hall, @fclem
I propose we do the following:
That's rather conservative, but I think it's worth taking API compatibility a bit more seriously.
Adding a few more patches here for consideration
WIP: Separate ColorRamp node name into Color Ramp #104996
WIP: Rename Bright/Contrast to Brightness Contrast #104998
WIP: Rename Dilate/Erode to Dilate Erode #104999
There needs to be a consensus of the use or not use of the "/" separator. I'm not sure about it myself but the inconsistency bothers me.
Changing UI names like these does not break file or API compatibility. If the names are similar enough to the previous ones and not break documentation completely, we can do them any time.
Ah, I gave the opposite advice in #104996, since the node names are used by the Python API and the default names would change. But if that's considered an okay change, I think these names are much better, so I'd support the changes @zanqdo proposed.
The socket names are used in the API, but the node names are not I think.
Yeah, that's why I didn't change the Bright socket name. I guess that one is a change for 4.0
Breaking shader node changesto Breaking shader node changes for 4.0Created a WIP PR for the Brightness rename #108128
Can we add it to the list?
I might need help on do-versioning.
@brecht I just spoke to Hans in chat. I'm warming up the old changes I had to change all the instances of Fac to Factor across nodes. At that time, you had both suggested changing the Python API as well to match, and to wait until 4.0 since it was a breaking change.
Hans wanted me to confirm with you if I should include the Python changes in my work. I plan to start building out that changeset this weekend.
Mainly I would like to do all breaking node socket changes at once, so add-on authors don't need to update things multiple times. So whatever changes you want to propose you could already make a PR for, and then we can do all the changes at once.
I'd like to fix the API design so that socket identifiers instead of socket names are used for
node.inputs["Factor"]
. That way we can change names in the future without worrying about API breakage. But that would expose the rather ugly identifiers likeFactor_Float
andFactor_Vector
, and Python scripts would need additional logic to deal with those distinctions.I think it would be nicer if the sockets were declared more dynamically and there would exist only one
Factor
socket at a time. And then the Python API can stay mostly the same. In fact we could even keep identifier asFac
for compatibility if we wanted.@HooglyBoogly do you know of any existing plans for changing the way this works? #104126 seems related but I only partially understand the description.
Agreed this should be done, it's very inconsistent the way it works now.
Yes, this is related to the planned work on dynamic declarations. The declaration would depend on the some properties of the node like the type, and the hidden (currently "unavailable") socket just wouldn't exist. We wondered if we would want to store the old default values, even without the socket. Personally i don't think that's necessary.
That's all a bit related to type inference between nodes, but other than that long-term design aspect, I don't think there's much holding us back from implementing this change now.
I think it's good to preserve the value of a socket that gets hidden. For example some parameter of the Principled BSDF that may get hidden when toggling a feature on or off, would be nice to keep that.
But when it gets replaced by a socket with the same name and another data type it seems not so important.
Right. Is there any time in the geometry nodes team to tackle this in 4.0 bcon1 still?
Storing previous values in these cases is good UX.
Inconsistent identifier examples from Compare and Mix node. Result has also been flagged by some users who prefer Value, Vector etc
b.add_input<decl::String>("A", "A_VEC3")
b.add_input<decl::String>("A", "A_INT")
b.add_output<decl::Float>("Result", "Result_Float")
b.add_output<decl::Vector>("Result", "Result_Vector")
Having separate or dynamic declarations for each mode would hopefully avoid the ugly identifiers and remove the need for using
nodeSetSocketAvailability
function.There should also be ways for the node to reuse and relink sockets when the declaration is changed, so some kind of runtime storage of socket data would be needed to enable this.
I expect we'd have some utility function to set the type of the socket, which would change it in-place and keep existing link.
I just was added some a historical links to approach, related to this #104126 (comment)
I'm not sure. Personally I'm feeling stretched thin already, but I'll keep it in mind for when we're deciding what to do next, or maybe someone else will have the time.
Yes, dynamic declarations should handle type conversions when creating updated sockets. Note for future: that's in
refresh_socket_list
Hello I will take care of the changes concerning D14202
Breaking shader node changes for 4.0to Breaking shader node changes for 5.0