Hello.
I’m finding that the built in get and set functions for vertices’ UV maps are kinda half-hazard. The getUV functions only get the first or second index (according to which function you use), and similarly for the setUV functions. The uvs property has all of the UV values in a single list, and while you can use it to alter the UV map of each channel, it’s a bit awkward because as far as I can tell, you have to do this for all 8 channels at the same time, even if you only want to alter one, or even if you only have one channel actually created in Blender.
So, I propose an idea for a slight refactoring to see what others think.
Firstly, a SetUV() function that takes an argument (optionally) in addition to the UV values of the vertex to set that indicate what channel to set these UV values to. If left blank, then the channel will default to 0 (the first one). Also, a GetUV() function that takes an argument (optionally) to get the UV values of a specific channel.
Both of these are already implemented, of course; it’s just about being able to pass your specified channel to the underlying C++ function.
A function that returns a dictionary of UVs, organized according to the name of UV channel (and sorted in ascending order, if possible) would be nice, but would be the hardest to implement, for me. Perhaps I could get help on that sometime. In any case, the first two would be the ones to approach for me (a newbie C++ coder, essentially, haha).
Note that this proposal is INSTEAD of the current functions, so they would be basically deleted, or at least deprecated. I personally wouldn’t mind simply getting rid of the extraneous portions of the API, since they’ve been around for so long.
Thoughts?
EDIT: Vertex Color stuff moved to another thread as it’s a more complex, thoughtful discussion.