View Single Post
# 3 05-03-2015 , 10:37 PM
Registered User
Join Date: Jul 2014
Posts: 6
Ahh yes that worked!!

Thank you. I was really banging my head against the wall on that one.

I've got a similar issue that I think I'm also getting the wrong syntax on:

I'm trying to assign the Intensity Mult value of a light to a string that gets run through an array but when I try to convert the string that holds the name of the attribute to a float value, it always tells me that it equals zero.

This is what I've got so far:

string $mySel[] = `ls -sl`;
string $myShapeSel[] = `ls -selection -dag -lf -ap`;
string $name;
string $shapeNode;
string $shapeNodeIntensity;
float $testing;
int $arraySize = `size $mySel`;

for ($obj in $myShapeSel) {
$obj = $shapeNode;
setAttr $shapeNode + ".intensityMult";
$testing = (float)$shapeNodeIntensity;
print $testing;
}
for ($i = 0; $i < $arraySize; $i++) {
$name = $mySel[$i];
//$shapeNode = $myShapeSel[$i];
//$myShapeSel[$obj] = $shapeNode;
//$shapeNodeIntensity = ($shapeNode + ".intensityMult");
//$testing = $shapeNodeIntensity;
select -r PLC;
addAttr -ln ($name) -at double -k 1;
//print $shapeNode;

}

I'm wondering if I have to call the objects outside of the for loop first because it doesn't see
$shapeNodeIntensity = ($shapeNode + ".intensityMult");
as equaling a number.

Any ideas?
It seems like the same sort of problem I was having earlier.