I have a script that adds a node group in the blackboard via python.
My problem is that If I call my function to add the same node group again, it will be added again but as a duplicate of the first one.
I want to make it single_user (via code) if it is already been called once in the blackboard. How can I achieve that?
if context.material != None:
bpy.ops.node.add_node(
type="ShaderNodeGroup",
use_transform=True,
settings=[{"name":"node_tree", "value": "bpy.data.node_groups[\"%s\"]" % node_group_datablock_name}]
)
# Here is where it doesn't work:
bpy.ops.nodes.copy(bpy.context.active_node)
Thanks.