Random Particle Colors on Chain

I've been browsing through the forum all morning looking at the various threads about randomizing the colors of particles, but it hasn't helped me, so far. (My end goal is a still image, not an animation.)

I'm using a Chain to create a necklace, and I want the beads to be three randomly chosen colors, but studying the examples I've found, I've had no luck yet.

I found this image, which sure seems to suggests what I want is possible, but I haven't been able to duplicate it either.

gradient_particle_example.jpg


From what I understand, the output of the RAND port of the Instance node is a (mostly) random number between 0 and 1, which should work well with the Position port of the Gradient node.

I think I'm close, but I'm out of guesses. Perhaps I need a Particle Tag applied somewhere? Any suggestions?

Necklace_Jun-13_a.jpg
Necklace_specs.jpg
 
I found one flaw, but it's very minor.

Because I'm dealing with 3 colors, I started with a multiple of three instances to get the best chance for a roughly even split between them, even though it's actually randomized. ( also because I want to try to get a regular repeating color sequence on the same model using a different custom texture to see which looks better. That's the next test. )

Since Particle Spline doesn't have an "Offset" value for the initial particle and there are an odd number of particles, it renders the first half of the first particle in a randomly chosen color, and when it completes the loop, it renders the last half of that same particle in a randomly chosen color. So, two times out of three, it chooses a different color for the two halves. Fortunately, Cheetah3D lets us choose the Random Seed for the Particle Spline, so it's easy to find one that renders both halves in the same color.

Now, I'll see if I can come up with a reliable repeating sequence generator, maybe using a Pulse node.

Again, thanks for your help!
 
Last edited:
Turns out the regular pattern was easy by multiplying UVW (which delivers sequential values between 0 and 1 while rendering the particles) by 63, using Modulo to divide by 3 ( which delivers 0, 1, or 2 ), dividing that by 3 to feed it to the Gradient.

Curiously, I have to tell the Particle Spline to render 64 items in order to get 63 particles in the render. I have no idea why.
Necklace_random.jpgNecklace_sequential.jpg
 
Last edited:
Back
Top