Unlink texture from node in python

Hi! Can anybody tell me how to remove the texture from a texture node from python? I can’t find indication or documentation about it.

This the code that must be completed

bpy.context.active_object.material_slots[0].material.node_tree.nodes[“Graphic element”].

See the image to better undestand the problem

Thanks!

Attachments


Assign None to the material property:

bpy.context.object.material_slots[0].material.node_tree.nodes["Graphic element"].material = None

You might want to use this access path instead:

bpy.context.object.active_material.node_tree.nodes.active.material

None! That was the answer! Not null! :smiley: Thankyou very much!