Getting UV Shell color from Identity Map in Maya with python or pymel

I was given the task of taking one model — that has multiple UV Shells with an identity map — and turning it into multiple objects based on the color of the UV shell. I found another script to get all of the UV shells of an object in another discussion on here, but I have run into the problem of getting the color that is associated with the shell.
Does anyone know how to get the color of a UV shell programmatically? I haven’t had any luck searching through the maya documentation or anywhere else online.

you could try Baking the Texture Color to the Vertex-Faces of the Model, then collecting all the Faces together with the Same Vertex Color and Separating them off.

@rgkovach123 Thanks for that suggestion and I tried it but I ended up having issues due to some vertices being involved in multiple UV shells where those shells interact. Still looking to see if this can be done programmatically or if I will need to break up the model by hand.

So one option is to just split the edges of uv shells and then bake the colors down.
Another less destructive option is to convert the shells to vertex-faces before applying the vertex colors, that will allow you to have vertices along the edges have multiple colors assigned.

1 Like