I want to dissolve
REROUTE nodes with Python.
Is there any way other than using
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
You could search the node tree for nodes of type REROUTE and then check their input and output socket paths and reconnect them while deleting the reroute node, since there is no direct way to dissolve the node. In this example I traverse check the shader node tree of the material named "Material":
import bpy node_tree = bpy.data.materials['Material'].node_tree for node in node_tree.nodes[:]: if node.type != 'REROUTE': continue input_socket = node.inputs output_socket = node.outputs for link in output_socket.links: node_tree.links.new(input_socket.links.from_socket, link.to_socket) node_tree.nodes.remove(node)