1
$\begingroup$

Is it possible in python to look at the output or input of a node to which it is connected in order to delete it?

( Blender v2.92.0 )

Pic example

$\endgroup$

1 Answer 1

2
$\begingroup$

The case in your picture can be done like

in_soc = your_principled_node.inputs['Base Color']  # example
if in_soc.links:
    from_node = in_soc.links[0].from_node
    your_material.node_tree.nodes.remove(from_node)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.