Setting all default_values of nodes to 0 does not result in expected black output
Some nodes like the RGB nodes have only outputs and they have to be processed as well if one wants to controll all possible inputs using the API. Also some nodes could have additional variables like "operation" mode or "use_clamp" in the Multiply node.



To gain complete control it is necessary to look at inputs as well as outputs. In the node setup above the RGB nodes are the main expected user input/control. These nodes do not have any input-(sockets) only one output(-socket). In the node editor this is obvious as the RGB node has no input socket. Working with the autocompletion in the blender python console does not reveal this information as easily.



If we expand the metallic paint material in this blendswap scene by elbrujodealtribu we see that there are even more cases to consider. The Multiply node has also a boolean use_clamp this will require special treatment. The second value of the multiply node is not linked and therefore would require to be set while the first value of the Multiply node is linked and therefore does not require to be set. Therefore each type of node (node.type) will likely require special treatment