UV Set names are only for display purposes only - the true identity of a uv set is its index. Renaming UV Sets should absolutely not re-order the indices. As I see it, if you want set X to be the -real- primary one (ie: its on slot 0) the only way is to create temporary UV sets and start copying sets around - or is there some easier way of doing it? The 3D Artists exports a mesh thinking that map1 is texCoords0 when in fact Maya thinks that whatever set which is on position 0 in the array is the correct one.Īlso, say that a minor studio without their own export tools would have to deal with this: how would you modify the order of that array? Say that I want a minor tool for simply changing the UV set order (move up, move down, move to top etc). I´ve talked to a 3D artist at DICE about this and he told me they´ve been having some problems with this situation. But, if the user then exports the mesh (to obj or FBX), does the exporter look at the array or at the names (strings) of the UV set? A tools coder/TA would most likely just go with the names here in order to not confuse the artists (I would) - but what about those small studios who don´t have their own exporters, those who have to rely on the native OBJ/FBX exporter in Maya? Renaming a set to map1 does not make it the primary set (as Maya see it) because the set on slot 0 in the array does not switch place with the set that the user is trying to make primary by renaming. The way Maya is dealing with UV sets are indeed funky. I forgot to thank you Theodox for your awesome functions - they will definetly come in use. Lvi = lambda uv_obj: len(cmds.polyUVSet(uv_obj, q=True, auv=True)) > 1Ĭollapse UV sets and make sure that the surviving UV channel is named 'map1' for finicky programs that care aboutĬmds.polyUVSet(obj, rename=True, newUVSet="map_rename_temp")Ĭmds.polyUVSet(obj, rename=True, newUVSet="map1") Returns a list of all the meshes in the scene with multiple UV sets Returns a string list of the deleted channel namesĬmds.polyUVSet(obj, cp=True, uvs=map, nuv=indices)Ĭur_map = cmds.polyUVSet(obj, q=True, cuv=True)Ĭmds.polyUVSet(obj, cp=True, uvs=cur_map, nuv=indices)Ĭmds.polyUVSet(obj, delete=True, uvs=indices)ĭeletes all empty UV channels on the supplied the first UV channel is not touched, even it if is empty, since it cannot be deleted.Ĭt = cmds.polyEvaluate(obj, uv=True, uvs=indices) If the optional map parameter is supplied, that map will be copied into Uvnames = cmds.polyUVSet(obj, q=True, auv=True) or ĭeletes all UV channes except the first. Uvindices = cmds.polyUVSet(obj, q=True, uvn=True) or
Returns am index:name dictionary of the uvsets on the supplied object Uvnames = cmds.polyUVSet(obj, q=True, auv=True) Uvindices = cmds.polyUVSet(obj, q=True, uvn=True) Returns a name:index dictionary of the uvsets on the supplied object This is also important when you need to paint textures, fur, or hair onto a 3D model.Namespace for uv manipulation and queries
Understanding the concept of UVs and how to map them to a surface, and subsequently lay them out accurately is essential for producing textures on polygonal and subdivision surfaces when working in Maya. Otherwise, changing the model will create a mismatch between the model and the UVs, and affect how any textures appear on the model. In most cases, you map and arrange UVs after you have completed your modeling, but before you assign textures to the model.
In addition, the location of the UV texture coordinates do not automatically update when you edit a surface mesh. Textures applied to polygon or subdivision surfaces that do not possess UV texture coordinates will not render.Īlthough Maya creates UVs by default for many primitive types, you’ll need to rearrange the UVs in most cases, because the default arrangement will usually not match any subsequent edits to the model you may make. That is, UVs act as marker points that control which points (pixels) on the texture map correspond to which points (vertices) on the mesh. UVs are essential in that they provide the connection between the surface mesh and how the image texture gets mapped onto the surface mesh. UV texture space facilitates the placement of image texture maps on a 3D surface. UV texture space uses the letters U and V to indicate the axes in 2D. UVs exist to define a two-dimensional texture coordinate system, called UV texture space.
UVs (pronounced U-VEEZ) are two-dimensional texture coordinates that reside with the vertex component information for polygonal and subdivision surface meshes.