- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to store my UV shells into an array and loop through them, the problem is UVs change their index if you apply UV mapping after storing the shells in an array which I need to do in my script. So I need to store each UV shell in a face array and then loop through each shell in face mode not each face individually. I can store the face collections in arrays using the eval command, but I can't figure out how to get them out of that loop, I can't figure out how to store them in global variables and then select those global variables in the next loop. Here's what I've got anyone know how to finish it?
To run the script you need to select all the faces of some individual shells in the UV editor.
ConvertSelectionToUVShell;
string $findShells[] = texGetShells();
int $numbShells = `size $findShells`;
int $shellIndex = 0;
string $shellToken[] = {};
int $fCounter = 0;
for ($item = 0; $item < $numbShells; ++$item)
{
tokenize($findShells[$shellIndex], $shellToken);
select $shellToken;
ConvertSelectionToFaces;
eval ("global string $testFaces" + $sCounter + "[];");
eval ("$testFaces" + $sCounter + " = `ls -sl -fl`;");
$fCounter = $fCounter + 1;
$shellIndex = $shellIndex + 1;
}
//This next part of the code doesn't work and I'm not sure why it won't select the shells I defined above?
$fCounter = 0;
for ($item = 0; $item < $numbShells; ++$item)
{
eval ("global string $testFaces" + $sCounter + "[];");
eval ("select $testFaces" + $sCounter + ";");
//Do code here
print "Found shell\n";
$fCounter = $fCounter + 1;
}
Solved! Go to Solution.