I would like to select multiple objects and add a custom UV set to all of them. My version works for one selected object only but not for multiple selected objects.
import bpy
# Get all selected objects
selected_objects = bpy.context.selected_objects
for obj in selected_objects:
# Add new UV set
bpy.ops.mesh.uv_texture_add()
# Set new UV set name for active UV set
bpy.context.object.data.uv_layers.active.name = "UV_ao"
What's wrong with my code?