I'd like to assign color to boxes based on their height. "Y-distance to pivot point" almost works, but it assigns all of the colors to the sides. Is there a way to color the entire box based on box's top-surface color? I've attached an image which shows the tallest box having a red top, the next tallest, yellow. Is there a way to get the red-topped box to be entirely red, and the yellow-topped box entirely yellow, etc., instead of having a gradient on the side surface?

Related: When a gradient is controlled by spline, the colors are smooth. When it's changed to stepped, there are only a few steps. Is there a way to numerically add steps? (eg 50?)

2. Make weight map with 100% on top four points, and 0% on bottom four points (or reverse). Then use weight map instead of Y axis as input to gradient.

- - - Updated - - -

Originally Posted by medicalart
Related: When a gradient is controlled by spline, the colors are smooth. When it's changed to stepped, there are only a few steps. Is there a way to numerically add steps? (eg 50?)
You would need to quantize input prior plugging it to Gradient node.

3. [QUOTE=Sensei;1367972]Make weight map with 100% on top four points, and 0% on bottom four points (or reverse). Then use weight map instead of Y axis as input to gradient.

- - - Updated - - -

The weight map for gradient does not appear to solve the problem. I don't want the gradient on the box. I am trying to capture a solid color, based on the height of the box, in relation to the gradient. In other words, the tallest box would be colored red (the highest value on the gradient); and the shortest box would be colored green (the lowest value on the gradient). In between sizes would be various colors, depending upon their position on the gradient.
Am I doing something wrong? Any ideas? thanks.

The gray photo shows my result. The white photo is the original photo. Arrows indicate an example of the solid color derived from the gradient.

4. Yes, you are applying the weightmap to each box individually instead of the trio. Another approach would be to use Y distance to object, as your gradient imput, now make sure your object sits at 0. The advantage of using this instead of weightmaps is that you can set it to world coords and animate the bars with a morph and the gradient stays in place as the bar grows.

5. I tried the weight map as a trio, and individually and got the same result. Also tried your suggestion of Y distance to object and that didn't work, either.
The top of the boxes are then correct, but the sides show a gradient instead of a solid color. Is there a way to get a solid color onto the sides of the bars? I had used the "Y distance to pivot" to generate the image with the arrows.

6. Originally Posted by Sensei

You would need to quantize input prior plugging it to Gradient node.
I don't see a quantize node. Is there a quantize node that can be used to add a number of keys to a gradient? None of the numeric ones work. Thanks.

7. It's a very strange request, why can't you just give each box it's own surface?

Anyway....

8. Thanks for the node instruction XswampyX. I would like to give each box it's own surface, but there are too many (2,000 boxes and 200 surface textures required).
I've used a UV map, but I think your gradient node set-up will be better.

9. Originally Posted by medicalart
I don't see a quantize node. Is there a quantize node that can be used to add a number of keys to a gradient? None of the numeric ones work. Thanks.
You need to Multiply, then Floor then Divide by the same value as in multiply.
f.e. 16.
I will make video tutorial later.

10. Originally Posted by medicalart
Thanks for the node instruction XswampyX. I would like to give each box it's own surface, but there are too many (2,000 boxes and 200 surface textures required).
Mine tool WeightPolygonGroups would solve your issue immediately.
You would have different weight map value on each box.
Then just retrieve it using Vertex Maps > Weight Map, and plug to Gradient node, then to Color.

11. Thank you for your suggestions.

12. Where does one find the node "Set Max Height"? (in XswampyX screen capture). I've looked through the node list several times and don't see it anywhere... Thanks.

13. Originally Posted by medicalart
Where does one find the node "Set Max Height"? (in XswampyX screen capture). I've looked through the node list several times and don't see it anywhere... Thanks.
It's just a constant -> scalar set to '5' I think. I use them just to remind me what values I could change later on when I come back to the scene.

Here's the scene... You might want to take the model over into layout and see the extra geometry that's needed to get the sides to render clean.
And it's animated, just scrub the time line and you will see that it's all automatic.

Cheers!

14. Wonderful. Thank you.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•