I am having difficulty creating a link using the new method of creating sockets in Blender 4.0's python api. More details on the changes here, while it doesn't cover links or the issues I'm having: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API
My question is: How do we access the "NodeSocket" type needed to create links from the "NodeTreeInterfaceSocketType"?
Error message from example code below:
Error: TypeError: NodeLinks.new(): error with argument 1, "input" - Function.input expected a NodeSocket type, not NodeTreeInterfaceSocketFloat
Example Code:
group = bpy.data.node_groups.new("group_name", type='ShaderNodeTree')
nodes = group.nodes
links = group.links
input_node= nodes.new(type='NodeGroupInput')
#Example math node to link to
math_node = nodes.new(type='ShaderNodeMath')
Input_1 = group.interface.new_socket(name='Input Name', in_out='INPUT', socket_type='NodeSocketFloat',)
links.new(Input_1,math_node.inputs[0])