Node Socket Name Change results in Cycles Material Rendering Black
Open, NormalPublic

Description

System Information
Windows 10
Intel Core i7-5820k 4.1GHz
2x Nvidia GTX 970

Blender Version
Broken: 2.79 5bd8ac9

Short description of error
If you change the name of a Node Socket (not the socket's identifier) of a Cycles Shader Node during execution of a python script, Cycles will render the Material black.

Exact steps for others to reproduce the error
Download the blend file below:

Run the code in the text editor.
Switch to viewport preview.

To fix the problem, simply reset the two nodes, or add a new Material Output Node and a new Principled Node to the Node Tree. Connect the new nodes together and delete the old ones.

Details

Type
Bug
Brecht Van Lommel (brecht) triaged this task as Normal priority.Nov 26 2017, 4:09 PM

The socket name is also the identifier, so you should not change it.

This is supposed to be read-only I think, though maybe it's needed to be able to change group nodes.

This issue is part of a deeper problem. Sockets are not uniquely named. Unlike everything in else in Blender, multiple nodes can have the same socket names (even the same node can have the same socket names). I don't think this is good or consistent behavior. There's three things that could solve this issue...

  1. Socket Names (or maybe identifier's instead) follow the same unique naming conventions as datablocks and structs within Blender.
  2. You can no longer change Socket Names. Or, allow the user to change socket names as long as you...
  3. Disassociate the socket name with the socket identifier. This is not clearly outlined in the Python API, as the Socket Identifier is a 'unique", read only property for mapping sockets, and the name property is just the name. Most structs in Blender have this "name" property. It should behave the same way, consistently throughout the software.