1
$\begingroup$

Blender 2.79, Cycles, Animation Node add-on

I'm trying to set up a node group to let me create stacks of books that will use the same UV mapped Image Texture, where I've randomized the X & Y on Location, Rotation, and Scale. That part works beautifully. Now I'm trying to give each book in the stack a random pick between 5 colors. Here is my AN set up:

Randomized Book Stack - AN Set Up

Here is the Material set up for the cover (the text block uses two other images that I don't want to change the colors for):

Randomized Book Stack - Cover Material Set Up

Unfortunately, instead of changing the color of each book selecting between positions 0 to 4, it's mixing the colors of Pos 1 and 2 together.

enter image description here

I've tried adding in CMO nodes for the X and Y locations but there was no change. The only tutorials I've been able to find on how to change colors require timing or location changes. I want the book colors to remain static so that I can be flexible on where I position each stack (and how tall the stack is) in the environment. I'll be creating multiple copies of the nodes so that each stack will vary.

Clearly I'm missing something, but since I'm still brand new to AN I have no idea what and there aren't that many tutorials out there that I can read/watch to help me through this. Any and all suggestions are welcome!

$\endgroup$
0
$\begingroup$

Your Animation Nodes look fine. I think your issue is with the Cycles NodeTree. There are a couple of issues. First, this connection:

image-color-ramp link

doesn't do what you think it does. Right now, it takes the luminance of the image texture and colors the each pixel of the image based on its luminance. The modification you make to the ColorRamp node with Animation Nodes is overridden. If you want to change the colors, you should use a MixRGB node to mix (or multiply) the ColorRamp output with the image texture:

enter image description here

There is still another problem, though. All of your objects will use the same material, so you can't set the color randomly with Animation Nodes; all of your objects will use the most recent modification of the material since they all point to the same material datablock.

Instead, you can use the Object Info node in Cycles to give a random color on a per-object basis to your material:

enter image description here

$\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.