How Can We Help?

nParticles and AiRandom

You are here:
< Back to Wiki

Getting random colors per frame?

Particles have a unique identifier called “nodeHandle”.

  • Using aiUserDataInt
    • attribute “particleId”
  • aiRandom
    • type : color
    • Plug aiUserDataInt into the aiRandom color
  • TIP: Using a aiRange to take the Red from the Random and range it.
    • Example range Red float 0-1 to 0-7 for things like switch nodes

What this does is takes the particle ID ( Number could be in the millions) and uses that to drive a random number. The aiRandom outputs a Red value of 0-1.

https://forums.autodesk.com/t5/maxtoa-forum/how-do-i-avoid-color-jitter-to-animate/td-p/11043979

Leave a Reply

Table of Contents