jporter313
04-22-2008, 09:19 PM
hi all, I'm trying to use a loop to go through each particle in a particle object I created and set it's color individually. My question is, how do I set a per-particle attribute using the setAttr command.
Currently I am trying to do it this way:
setAttr ( $particleObjectName + ".rgbPP[" + $colorIndex + "]") $colorArray[0] $colorArray[1] $colorArray[2];
where $particleObjectName is the name of the particle object being acted on, $colorIndex is an incremented variable used to specify the ID of the Particle I'm trying to affect, and $colorArray is a floating point array set up to temporarily store the RGB values that I want to apply to the particle.
When I run it, I get this error:
// Error: No object matches name: Particle_Test_Output.rgbPP[0] //
"Particle_Test_Output" is the value stored in the $particleObjectName variable.
Can anyone tell me what I'm doing wrong and how to make it right?
Currently I am trying to do it this way:
setAttr ( $particleObjectName + ".rgbPP[" + $colorIndex + "]") $colorArray[0] $colorArray[1] $colorArray[2];
where $particleObjectName is the name of the particle object being acted on, $colorIndex is an incremented variable used to specify the ID of the Particle I'm trying to affect, and $colorArray is a floating point array set up to temporarily store the RGB values that I want to apply to the particle.
When I run it, I get this error:
// Error: No object matches name: Particle_Test_Output.rgbPP[0] //
"Particle_Test_Output" is the value stored in the $particleObjectName variable.
Can anyone tell me what I'm doing wrong and how to make it right?
