2
$\begingroup$

I currently have a model coming from an external source (Revit Architecture) with lots of objects (+3000). I have tidied the model up somewhat and have reduced object count to under 100 by joining objects. This results in objects that have hundreds of UV maps.

Deleting UV maps one at a time is time consuming and tedious. Is there a way to get rid of all the UV maps on an object with a single command or does this require some clever python scripting?

$\endgroup$
  • $\begingroup$ you go via python: blender.stackexchange.com/questions/36523/… $\endgroup$ – MCunha Oct 27 '16 at 13:25
  • $\begingroup$ Thank you! How would you modify the last script (delete by index) to go through the whole list of UV map indexes the mesh has? $\endgroup$ – rautavirta Oct 27 '16 at 13:47
  • $\begingroup$ if your UVmaps have consecutive names (UVMap01, UVMap02, etc) you can create a cycle to run through all UVMaps. If not, you have to create a list with the names, then read the names from that list. $\endgroup$ – MCunha Oct 27 '16 at 14:08
  • $\begingroup$ The UV maps are not consecutively named. How would I go around creating a list of the names? $\endgroup$ – rautavirta Oct 27 '16 at 14:28
0
$\begingroup$

as in https://blenderartists.org/forum/showthread.php?254004-Accessing-UV-data-in-Python-script

import bpy
obj= bpy.context.selected_objects
for ob in obj:
    if ob.type == 'MESH':
        bpy.context.scene.objects.active = ob
        while(len(ob.data.uv_textures)):
            bpy.ops.mesh.uv_texture_remove()
$\endgroup$
  • $\begingroup$ you have to try if it works. Maybe change "texture" with "map" or something... I'm a complete noob in python $\endgroup$ – MCunha Oct 27 '16 at 14:56
  • 2
    $\begingroup$ I'd go for the low level approach used by @CoDEmanX in post 13 of that BA thread blenderartists.org/forum/… $\endgroup$ – batFINGER Oct 28 '16 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.