zachgrachan
09-13-2003, 09:49 PM
any body know how to make a runtime expression that only goes every so many frames? for instance, say you wanted the radius of your "spheres" particles to change randomly every 10 frames - seems to me that
if (time % 10 != 0)
particleShape1.radiusPP=rand (.5, 1);
should work, but it still changes every frame. if I change the != to ==, I get no changes at all.
any ideas?
*edit*
I realised that Maya wasn't chopping the decimal like c++ does, so I changed it to :
int $isTenth = frame % 10;
if (abs($isTenth) <= .49)
{
particleShape1.radiusPP=rand(.5,1);
print("Remainder is: " + time % 10 + "\n");
}
if (time % 10 != 0)
particleShape1.radiusPP=rand (.5, 1);
should work, but it still changes every frame. if I change the != to ==, I get no changes at all.
any ideas?
*edit*
I realised that Maya wasn't chopping the decimal like c++ does, so I changed it to :
int $isTenth = frame % 10;
if (abs($isTenth) <= .49)
{
particleShape1.radiusPP=rand(.5,1);
print("Remainder is: " + time % 10 + "\n");
}
