1
$\begingroup$

First ever blender post. I am trying to make an animated graphic equaliser using some cubes and "bake sound to F-curves". The animation is fine, but I want to colour the cube with a colour ramp (green-yellow-red transition). I tried using Texture Coordinate->Mapping->Gradient Texture->ColorRamp method, which gives me the desired look, however, it calculates the ramp for each frame, and hence size, of animated cube, rather than giving a consistent colour across all bars, with only the tallest ones having the red...

I saw another post, where this "colour gradient exposed dependent on length" requirement was done with hair objects I guess: How to change hair color along length of strand?

Can this be done with cubes with baked animations? cheers...

$\endgroup$
6
  • $\begingroup$ Hello, is the scale of your objects animated in your animation ? $\endgroup$ – Gorgious Jul 6 '20 at 13:28
  • $\begingroup$ What texture coordinate are you using, UV, generated, or object? $\endgroup$ – Christopher Bennett Jul 6 '20 at 13:30
  • $\begingroup$ Also, is the origin of each of your cubes at the same place or do they each have their own origin ? $\endgroup$ – Gorgious Jul 6 '20 at 13:33
  • $\begingroup$ @Gorgious, Z delta scale only is animated using "Bake sound to F-curves". Origin of object is set to 3d cursor (so it only animates in one direction, upwards. I used this tutorial: youtube.com/watch?v=qjSSiltPMyk $\endgroup$ – Slaybells Jul 6 '20 at 13:42
  • $\begingroup$ @ChristopherBennett, I tried all 3 :-) But I expected "object" to be the one to use. $\endgroup$ – Slaybells Jul 6 '20 at 13:43
1
$\begingroup$

You need to define common scale and coordinates that are independent of the other objects dimensions. If you add an empty to the scene, you can use it to control the sizing, so that the gradient remains constant regardless of the dimensions of the object.

In this example 3 different cubes of different sizes have the same material.

enter image description here

It doesn't have to be an empty, it can be any object.

$\endgroup$
1
  • 1
    $\begingroup$ Ah! now I got it, thanks. It works perfectly. Wow, you guys are fast! $\endgroup$ – Slaybells Jul 6 '20 at 14:11

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.