Get objects that are not uv-ed

Hi all,

I have this model in which some of the geometries within are not uv-ed.
As in, you select the geometry >> open up uv editor >> it is blank.

And so it is causing some problems with a script I am doing. Are there any ways in which I can use python to check for such geos with the blank uvs?

FYI, there is only 1 uv set for this model.

If this is in Maya. Something like this should work and be pretty fast. For some reason though even if you delete all the uvs in a set one uv still seems to be mapped somewhere.

from maya import cmds

def find_unmapped_meshes():
	unmapped_meshes = []
	for mesh in cmds.ls(type='mesh'):
		uvs = cmds.polyListComponentConversion(mesh, toUV=True)
		uvs = cmds.ls(uvs, fl=True)
		if len(uvs) < 2:
			unmapped_meshes.append(mesh)
	return unmapped_meshes

Hi, thanks. your code works totally to my cause.

However I think there is a mistake in your code.
It should be

if len(uvs) < 2:

You are totally correct. Fixed that so anyone else won’t get tripped up by my goof.

On a related note, this is a good use case for minq

where the query would be:

from minq import *
no_uvs = Meshes().where_not(lambda p: using(p).get(UVPointCount).first())

Which roughly means:

from all meshes get the ones where the UV point count is not above 1

Minq’s got a bit of a learning curve but once you get used to it this sort of thing becomes very simple

1 Like

are you looking for meshes that have completely empty UV sets or meshes that are only partially covered by a uv set?