Quickly rename the UV layer for all selected objects in Blender

If we need to quickly rename the desired UV Layer for all selected objects in Blender, we can use a simple Python API script to do this in a one button press.

In general, the name of an object’s UV layer can be accessed through its “data.uv_layers” property, which stores a list of all the object’s UV layers.

So for the current active object:

UV layers are sorted in the list in the same order in which they are displayed in the interface panel.

We can get a pointer to a specific UV layer by its name

or by its index in a list

Don’t forget that indexes start at 0.

The name of the UV layer is available through the “name” property

To rename a UV layer, we simply need to assign a new value to its “name” property

To do this with all selected objects, we can loop through the selected objects and assign the desired name to the desired UV layer.

This simple script will assign to the second UV layer a new “New UV Layer Name” name for each selected object.

An additional condition checks that the number of UV layers for the current object is at least two, so as not to throw an error if the second UV layer does not exist.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments