4
$\begingroup$

I would like to give the objects in an array (using array modifier) different colors. Right now the array of objects is just one color, and i would like to give each member of the array a different color, using a gradient. Is this possible? I have tried using the Particle Info node to no avail.

Thanks!

$\endgroup$
9
$\begingroup$

I think you need to apply your array modifier, and then separate by loose parts in edit mode. Press P>loose parts to do this.

Add an object info node to your material, and use the random output. This will assign each object assigned the material a color from the gradient. A basic setup would look something like this: enter image description here

This is an example of the effect with an arrayed Suzanne with setup shown:

enter image description here

$\endgroup$
6
$\begingroup$

Use "Object" from "Texture coordinate" input node (without applying the arrays).

enter image description here

The object output is relative to "position coordinate in the object space" (see the documentation).

enter image description here

From that you can separate the coordinate in X, Y, Z and use these inputs as R G B channels.

In the exemple below, I used a multiply but you can choose the way you want (color ramp, ...).

After that, recompose all in a "combine RGB" node as color input for your shader.

enter image description here

As you can see, the result is very bright : this is because the values are above 1. The value input node is here to modulate theses values, in order to obtain the intensity you want.

$\endgroup$
  • $\begingroup$ Vector and Color types are identical (XYZ => RGB) and thus can be plugged into each others' sockets without a problem. So a simpler but equivalent setup would be to plug the Value into a color multiply node. $\endgroup$ – PGmath Jan 17 '17 at 0:11
1
$\begingroup$

You can assign different materials to the faces of each object in the array, and that will allow you to apply different textures as well, without having to separate the array first.

Just go into Edit mode. select the faces you want to assign a specific color to, add a new material, and then assign it while the faces are selected. Do this for each object in the array.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.