# How to make a single user copy of a group of nodes in matrial on python in Blender?

I have a material on one object and I need to copy it to another object.

I do ... material.copy () but the group node in the material copy does not become a single-user copy. How can this problem be solved?

## 1 Answer

The copy function can be used on the node tree as well. The copy function returns the copied node group, so it can be used replace the original group with the single user copy:

original_group = bpy.context.objects['Object'].material_slots['Material'].material.node_tree.nodes['Baking_node'].node_tree
single_user_group = original_group.copy()
original_group = single_user_group


Then just loop that over all your materials

• Use bpy.context.object for the context object, bpy.context.scene.objects.get("Object") for an object named "Object" in the context scene. There is no context.objects. – batFINGER Mar 2 at 4:39