0
$\begingroup$

I accidentally added 2 UV maps to an object, and the wrong one is selected to be used in the render. The problem is, I have over 100 non-linked duplicated of this object in my scene. How do I remove a UV map from all of them (quickly)?

$\endgroup$
2

4 Answers 4

1
$\begingroup$

you may have to join the objects together and simply go into the image texture editor and remove them both with the little negative sign on the right to remove the custom textures in the slot of the object. if you still don't get it please say or if I'm not answering the right problem that you are experiencing.

Thanks and good luck!

$\endgroup$
1
  • 2
    $\begingroup$ Hi, why don't you add what should the OP do to get back all separated objects, after? That would make this answer much more useful... $\endgroup$
    – m.ardito
    Commented Apr 3, 2018 at 7:20
6
$\begingroup$

I'm using Blender 2.8 beta, and this is the modified version of the script I'm using to delete all the unwanted UV Map Layers from all the selected objects at once:

import bpy
selected = bpy.context.selected_objects

bad_uvmap = 'UVChannel_2' # Enter the UV map name you want to remove here
print("Deleting unwanted UV Layers")
 for obj in selected:
   if obj.type == "MESH":
     bad_uvlayer = obj.data.uv_layers.get(bad_uvmap)
     if bad_uvlayer != None:
       obj.data.uv_layers.remove(bad_uvlayer)

Hope this helps!

$\endgroup$
4
$\begingroup$

You can use the following script:

import bpy

selected = bpy.context.selected_objects

bad_uvmap = 'UVMap.001' # Enter the UV map name you want to remove here

for obj in selected:
    try:
        badUV = obj.data.uv_textures[ bad_uvmap ]
        obj.data.uv_textures.remove( badUV )
    except:
        pass
  • Paste it in the text editor (open a text editor view, use the "new" button and paste).
  • Change the line "bad_uvmap = 'UVMap.001'" by replacing 'UVMap.001' by the name of the UV map you want to remove
  • Select all the concerned objects in the 3D view
  • Come back to the text editor and use 'run script' or AltP
$\endgroup$
1
  • 1
    $\begingroup$ For 2.8 replace uv_textures with uv_layers $\endgroup$
    – batFINGER
    Commented Jan 19, 2020 at 15:33
2
$\begingroup$

For blender 3.3+:

import bpy

# Get selected objects
selected_objects = bpy.context.selected_objects

# Loop through selected objects
for obj in selected_objects:
    # Check if object has UV maps
    if obj.data.uv_layers:
        # Remove all UV maps
        while obj.data.uv_layers:
            obj.data.uv_layers.remove(obj.data.uv_layers[0])
$\endgroup$

You must log in to answer this question.

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