We can get access to an object’s UV layers using the Blender Python API through it’s “uv_layers” list By referring to any UV layer from the list, we can make it active for using and for rendering.
To make a flat UV layer with the desired name active, we need to set the layer’s active property to True.
Let’s make the layer with the “UVMap.001” name active:
1 |
bpy.context.object.data.uv_layers['UVMap.001'].active = True |
To set the desired UV layer active for rendering, we need to set its “active_render” property to True.
The following command will set the “UVMap.001” layer:
1 |
bpy.context.object.data.uv_layers['UVMap.001'].active_render = True |
as active for rendering.