incrementing variables in loops
Hey, so there a way to create incremented variables inside of loops, for instance...
/////////////////// // select some objects string $selObjects[] = `ls -sl`; // loop through items in selection and store their bounding box info for ($i=0;$i<$selObjects;$i++) { float $agentBBox[] = `xform -q -ws -boundingBox ("object_" + $i)`;// cylinder's BBox } ////////////////// This will store each objects bounding box once and then overwrite it the next time it goes through the loop, what I would like to do would be to create a new float array each time it goes through the loop. Many thanks, Chris |
Not sure about that but I think you have to define the array outside the loop. Have a look into this.
Benny |
u can create on array outside the loop and store incrementally a bounding box property in each element. u dont have to create a new array each time.
|
All times are GMT. The time now is 01:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018