I'm writing a simple script for my wife, when I click this button it checks to see if one of the UV sets is named lightmap and should producer an error and stop. If it doesn't find light map it should run the second part of the script. For some reason even when light map exists as a UV set it runs the error, but then also…
gmatch allows you to use wildcards to do a partial string match - like you would do in maya's 'select by name' function http://download.autodesk.com/us/maya/2009help/Commands/gmatch.html So the way I've used gmatch it matches with lightmap1 or lightmap2 or lightmap365
ok the problem is that you're applying the if statement to each part of the array of UV's. This is a modified version that only does something after you've checked each uv set global proc uvsetTest()
{ string $danaUVs[] = `polyUVSet -q -auv`; int $lightMapExists = 0; //this bit checks if lightmaps exists for ($danaSet in…