How can I set the output socket type of a nodegroup output socket from python?
I don't even know of any good way to do this in the UI.. The only way I know of in the UI is to connect a node output of the type I want (e.g. a yellow color output) to the Group Output node.
I tried setting
socket.type, however there is no error message and the socket type does not change.
This is important because the default is a
'VALUE' socket, which converts colors into grayscale.
Here is the relevant part of my script:
main_group = bpy.data.node_groups.new(type="ShaderNodeTree", name="Object Color") main_group.outputs.new("NodeSocketFloat", "Object Color") output_node = main_group.nodes.new("NodeGroupOutput") output_node.location = (600, 0) output_node.inputs["Object Color"].type = 'RGBA'