global proc string [] KTgetUVShells()
{
string $shellList[];
string $objects[] = `ls -o -sl`;
int $shellAmt[];
int $num;
int $shellIds[];
int $counter = 0 ;
for ($obj in $objects)
{
$shellAmt[0] = `polyEvaluate -uvShell $obj`; // get amount of uvshells in object
$num = $shellAmt[0]; // cast the shellAmt to num to be used in for loop condition
for($i = 0; $i < $num; $i++);
{
$shellIds[size($shellIds)] = $counter;
$counter += 1;
}
for ($s in $shellIds)
{
string $uvsInShell[] = `polyEvaluate -uis $s $obj`; //gets the .map of the corresponding uv shell ID
$shellList[size($shellList)] = stringArrayToString($uvsInShell, " "); //storing the uv shell into array
}
}
return $shellList;
}
KTgetUVShells;
if you run this on a mesh selected it will give
// Error: line 11: Cannot convert data of type int[] to type int. //
https://www.artstation.com/kelvintam