I have a heightmap of the height of terrain above and below sea level as a single object. I wish to colour it such that any part of the object that is below sea level (z<0) is coloured blue, and any part above sea level (z>0) is coloured green. How would I do this using a python script?
Asked
Active
Viewed 25 times
0
-
Hello, how do you want to apply the color ? Vertex colors ? Texture map ? Procedural shader ? – Gorgious Jun 08 '21 at 12:56
-
@Gorgious whichever would take the least time to execute whilst putting the change in colour at exactly z=0 – Bob Jun 08 '21 at 13:34
-
https://blender.stackexchange.com/questions/5491/how-do-i-colour-a-3d-terrain-based-on-its-height – batFINGER Jun 08 '21 at 14:16
-
Yeah those are what I would like to do but using a python script. – Bob Jun 08 '21 at 14:33
-
... yeah initially closed as dupe, then re-opened since the question related to python. Dupe gives examples of a material to create. There are numerous answers re adding a material with python. Sometimes you can make no effort and get lucky, sometimes not. Also consider accepting and or up-voting answers to your questions that have helped or answered them. – batFINGER Jun 08 '21 at 19:21