0
$\begingroup$

I have hundreds of objects. Some have uvmap named "UVMap" while others have some other names. How do I change the uvmap name in all objects to UVMap?

I did find this but the script adds a new uvmap (UVMap.001) if the existing one is already named as UVMap: How to rename UVs of all the objects?. Because blender search does not sort by uvmap name I can't limit my selection to objects that have other name.

$\endgroup$

1 Answer 1

0
$\begingroup$

I figured out a very simple answer. First rename all uvmaps to something random like "bnoterp" that is not anywhere. That changes all (primary?) uvmaps to that name. Then after that rename all of them to "UVMap". That way the script does not create new uvmaps called UVMap.001 when it finds uvmaps with the same name as the script.

$\endgroup$
3
  • $\begingroup$ What exactly do you mean? The script renames all found UV maps to 'UVmap' it is Blender that adds .001 automatically the moment it encounters any repeating name so no matter what you do, if an object has a few UV maps and all of them are named the same it will add the number after the name for every one of them after the first one. UV map names in a single object must be unique and it cannot be any other way no matter what you do. What is it that you solve by renaming twice? $\endgroup$ Commented Jun 25, 2019 at 15:41
  • $\begingroup$ I thought I made it very clear. Imagine you have several hundreds of objects. Some have uvmap named UVMap, some have aabbcc, some have ccddee, some have something else. But each has and can only have one uvmap (I can't have more than one). To change all their uvmap names to "UVMap" you need first name them to something else or x percentage of those objects now have two uvmaps. One called UVMap and one called UVMap.001 becauset he script creates duplicates if it finds already existing uvmaps with the same name. $\endgroup$
    – tgerrons
    Commented Jun 25, 2019 at 21:40
  • 1
    $\begingroup$ You must be mistaken. There is no code there that could create a UV map. It just goes through existing UV maps and names them. For every UV map: for uvmap in obj.data.uv_layers it names the UV map uvmap.name = 'UVMap' This is all it does. That cannot possibly create anything because it only sets a value for something that exists already. Only if the objects have multiple UV maps already before the script is run, you will see the numbers added to the names. $\endgroup$ Commented Jun 25, 2019 at 22:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .