I am trying to write an addon, I am making a node group that will be created with a single button however I have run into issues with these final lines:
custom_node_name = "dust"
my_group = create_dust_group(self, context, custom_node_name)
dust_node = context.material.node_tree.nodes.new('ShaderNodeGroup')
dust_node.node_tree = bpy.data.node_groups[my_group.name]
dust_node.use_custom_color = True
dust_node.color = (0.5, 0.3, 0.9)
the problem I'm having is with the line
dust_node = context.material.node_tree.nodes.new('ShaderNodeGroup')
I don't know how to get it to work for creating a material
any help or suggestions would be greatly appreciated
thank you