Set active UV layer in python? I'd like to set which UV map is selected in Properties > Object Data > UV Maps. By "selected", I'm referring to the one highlighted, not the one with the camera icon enabled.

I tried

bpy.context.object.data.uv_layers.active = bpy.context.object.data.uv_layers['AO']


But uv_layers.active remained at the previous value and there was no error message.

How can I set the active UV map from python?
Seems that you can set the active UV layer through the uv_textures collection rather than uv_layers:

bpy.context.object.data.uv_textures['AO'].active = True