global string $nsList;
global string $Namespace;
string $curNs = `button -q -label namespaceBtn`;
string $list11 = `ls -recursive 1 "Global_Scale"`;
int $size = `size($list11)`;
if($curNs == $nsList[$i]) //$i
$ElevenNamespace = $nsList[$i+1]; //$i+1
button -e -label $Namespace namespaceBtn;
The problem with this is it loops through to the end of the code. What I need it to do is compare the current namespace given by the label of the button itself with the one in the namespace list. If it matches, it goes to the next one and updates accordingly, and then somehow break out of the loop without continuing to the end, so basically it goes to the end of the namespace list.
Perhaps I'm way over complicating this and there is some magical solution, but I have spent far too long trying to figure out what it is with no results. Currently the full code is hardcoded to only support 3 rigs at a time, and obviously hardcoding is bad practice, so I need any help I can get.