fbitonti
12-09-2006, 05:04 PM
I have a ton of nurbs curves in a file each one has been given a different color based on a variety of paramiters. I need to be able to select each of these depending on what color they are at a particular time. The script is working as far as I can tell by printing text at varrious points. however the selection function is not working. The nurbs are all seperate objects and not connected in any way. I have tried it with both the -add and -tgl flag and neither seem to be working. can some one please any information would be awsome.
this is the code i'm workig with.
global proc selectCurvesOne (){
//setup you need to select your nurbs objects in order
//in the outliner select the first one on the list then
//shift select the last one in the sequence.
FEMresultArray;
selFEMresult;
string $FEM_selected[] = `ls -sl`;
$femSize=size($FEM_selected);
global string $stressOne[];
global string $stressTwo[];
global string $stressThree[];
global string $stressFour[];
global string $stressFive[];
global string $stressSix[];
global string $stressSeven[];
global string $stressEight[];
int $a = 0;
for ($i = 0; $i < $femSize; $i++) {
string $FEM_shapeNode[] = `pickWalk -d "down" $FEM_selected[$i]`;
int $FEM_getTheColor = getAttr ($FEM_shapeNode[$i] + ".overrideColor");
//sort edges
if ($FEM_getTheColor == 28){
print "SELECTED!";
select -tgl $FEM_selected[$i];
$a++;
}
}
}
this is the code i'm workig with.
global proc selectCurvesOne (){
//setup you need to select your nurbs objects in order
//in the outliner select the first one on the list then
//shift select the last one in the sequence.
FEMresultArray;
selFEMresult;
string $FEM_selected[] = `ls -sl`;
$femSize=size($FEM_selected);
global string $stressOne[];
global string $stressTwo[];
global string $stressThree[];
global string $stressFour[];
global string $stressFive[];
global string $stressSix[];
global string $stressSeven[];
global string $stressEight[];
int $a = 0;
for ($i = 0; $i < $femSize; $i++) {
string $FEM_shapeNode[] = `pickWalk -d "down" $FEM_selected[$i]`;
int $FEM_getTheColor = getAttr ($FEM_shapeNode[$i] + ".overrideColor");
//sort edges
if ($FEM_getTheColor == 28){
print "SELECTED!";
select -tgl $FEM_selected[$i];
$a++;
}
}
}
