Amazing! I was missing that that view_layer.objects.active = ob line, thank you m00k! Also, about setting code in here in the forums, it can be confusing sometimes how to do so without the page destroying your indentations haha. What I do is go to a new line, type crap like ojifdg, highlight that and make it into the code…
The UV channel swapping is now implemented. When there is no UV channel it shows a button to quickly generate a UV via smart projection. @Jakro: I managed to actually reduce the code to 1 operator (handles up or down) with 60 lines of code. See source code
I know nothing about coding, but I'd suggest you to go to #blender and #blendercode IRC and also on Blender's Artist "Beginning Blender Code" session. Good luck on this :D
No need to press anything else ^^ It's the beauty of your code :smiley: I think the code must be different to make it possible. Right now it's working, but it's not perfect, we cannot deselect components. Haven't tryed more than that, but the possibilities are really great.