Hello,
I’m finishing a script but I have in small problem to replace a string with a variable that contains the same name string.
I have this line :
bpy.ops.node.add_node(use_transform=True, type=“CompositorNodeGroup”, settings=[{“name”:“node_tree”, “value”:“bpy.data.node_groups[‘my_node_group’]”}])
I’d like to replace the node group by a variable but I don’t know how to do without errors. I tried this:
my_var = “my_node_group”
bpy.ops.node.add_node(use_transform=True, type=“CompositorNodeGroup”, settings=[{“name”:“node_tree”, “value”:“bpy.data.node_groups[”+my_var+"]"}]) # and also …+str(my_var)+…
The error says that ‘my_node_group’ is not defined.
What did I wrong?
Thanks!