I thought there must be another way to do this either with procedural textures generated from the slopes of the terrain or by using Mel. >> It would be a lot quicker for look development to just tweak a few values rather than repainting the
Procedurals can be baed to textures/vertex attributes. Does the same thing.
slopes of the terrain or by using Mel.
Doing things in mel do not change the toolset. So if you can do it manually you can record the manual steps and viola you have mel. So the essence of being able to do a script is being able to do it manually without mel. So being able to do it manually is a prerequisite to mel.
So in this lightt didn't say anything about not doing it in mel i just pointed out that the steps are superflous. You donbt need to cull based on anything the toolset is allready there. Use it trough mel or not.
So i was talking of programming in mel. The setps you propose are extra steps as far as mayas concerned. But thenagain you can do this with expressions so no need for mel, python or api.
Only downside is the code is horrendously slow 
oh dear oh dear o dear.
You huys should actullys top thinking of code and start thinking of nodes. Start by reading the node reference.
PS: anyway its far more trivial with paint objects (no you odnt need to paint you can floodbased on the texture), if for some reasin you dont really want to use instances (tough even that is a option.)