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)?
-
2While you're waiting for a proper answer, one possible workaround would be to just explicit set the map you want in the shader and just ignore the other map: https://blender.stackexchange.com/questions/2176/can-cycles-use-multiple-uv-layers – JtheNinja Apr 03 '18 at 06:44
-
related keep-specific-uv-layer-and-remove-the-rest – Ratt Jan 20 '23 at 12:40
4 Answers
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!
- 294
- 3
- 3
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
- 60,295
- 3
- 66
- 136
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!
- 303
- 1
- 11
-
2Hi, 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... – m.ardito Apr 03 '18 at 07:20
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])
- 871
- 6
- 16