How to create elevation based height/contour lines for topography?

Hi, I’m using Maya 2013 and created a basic poly hill landscape. Now I need to add the effect of height lines across the landscape, but I’m not sure how to.
(Example: File:Contour2D.svg - Wikipedia )

I tried projecting a grid shader on to the landscape, but then of course wherever the landscape is flat the lines get stretched and no longer look like lines.

I also played around with mental ray contour lines, but as far as I can tell they are only based on poly and object borders, not on elevation or y axis coordinates.

Is there a script, plugin or shader setup that can display height lines correctly? (I have no scripting experience …)

Thanks in advance!

Planar projecting horizontal lines (Photoshop) onto a uv map seems the best way to go. For the smeared flat areas, you could reassign the material on just those faces of the terrain mesh to be identical to the material of the terrain that has the projection in the color channel, but without the projection applied. On a true elevation contour map, flat areas would be clear of contour lines since there’s no gradient there.

Here’s a Python slope shader script that may also work to erase the elevation lines on flat areas of the terrain for you: