Adding specific uv map to UVMap node in python script I am trying to create a script that at one part of it select a specific UV from the active object
(e.g. Cube object ⇒ 'UVMap_final')
I have managed to create the new node using:
uv_map_node = bpy.context.object.active_material.node_tree.nodes.new('ShaderNodeUVMap')
But I cannot understand how to select and assign a UV to this node.
Appreciate the help!
If you have enabled Developer Extras in the preferences, you can see the attribute name linked to the field while hovering over it : uv_map

The field is a StringProperty, meaning you have to set it to a str value. It doesn't matter if it doesn't exist yet on the object data. If it doesn't it will be filled with red.
See :
import bpy

uv_map_node = bpy.context.object.active_material.node_tree.nodes.new('ShaderNodeUVMap')
uv_map_node.uv_map = &quot;test&quot;

uv_map_node2 = bpy.context.object.active_material.node_tree.nodes.new('ShaderNodeUVMap')
uv_map_node2.uv_map = &quot;UVMap&quot;