View Full Version : select objects with empty uv maps


romeu
09 September 2008, 11:51 AM
Hi

Is there a way to select all objects with empty uv maps, cause i have a really big and messy scene with a lot of meshes, some with the correct uv and a lot with nothing.

Everything renders fine because i using shaders with projections for these objects apart from those that i edited the uv's (every thing is mixed), but the warnings of the empty uv maps cause the render times to slowdown.

So, if you know a way, that would really help me.

Thanks.
Romeu

Norb
09 September 2008, 06:56 PM
This should do the trick. It also spits out the info in the script editor...




global proc findEmptyUVSets()
{
string $saSelected[] = `ls -sl -l`;
string $saEmptyObjs[] = {} ;

if (!size($saSelected))
{
error "Select something\n";
}

for ($sSelected in $saSelected)
{
string $saUVSets[] = `polyUVSet -q -allUVSets $sSelected`;
for ($sUVSet in $saUVSets)
{
polyUVSet -currentUVSet -uvSet $sUVSet $sSelected;
int $iaNumUVs[] = `polyEvaluate -uv $sSelected`;

if (!$iaNumUVs[0])
{
print ("UV set ["+$sUVSet+"] on object ["+$sSelected+"] is empty\n");
$saEmptyObjs[size($saEmptyObjs)] = $sSelected;
}
}
}
select -r $saEmptyObjs;
}
findEmptyUVSets();

romeu
09 September 2008, 07:46 PM
Thanks a lot, works like a charm!:thumbsup:

CGTalk Moderation
09 September 2008, 07:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


1