1

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

susu
  • 14,002
  • 3
  • 25
  • 48
Slaybells
  • 13
  • 2
  • Hello, is the scale of your objects animated in your animation ? – Gorgious Jul 06 '20 at 13:28
  • What texture coordinate are you using, UV, generated, or object? – Christopher Bennett Jul 06 '20 at 13:30
  • Also, is the origin of each of your cubes at the same place or do they each have their own origin ? – Gorgious Jul 06 '20 at 13:33
  • @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: https://www.youtube.com/watch?v=qjSSiltPMyk – Slaybells Jul 06 '20 at 13:42
  • @ChristopherBennett, I tried all 3 :-) But I expected "object" to be the one to use. – Slaybells Jul 06 '20 at 13:43
  • @susu - trying to understand (I am very much a beginner). So, I bake the sound to an empty for the animation, how to link it to the cube for re-sizing? – Slaybells Jul 06 '20 at 13:45

1 Answers1

1

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.

susu
  • 14,002
  • 3
  • 25
  • 48