Importing Terrain Height map (RAW) with c#

Hi all,

After many hours I can’t find any reference to importing RAW height maps into a terrain using c#.
I’m trying to batch import hundreds of terrain height maps tiles but there doesn’t appear to be pre-defined function.

So the question is, is there pre-defined functions or is there another method I’m missing?

Any help would be much appreciated.
Ved

There’s no predefined functions. The API is of course the TerrainData.SetHeights() call:

If you have a lot, you probably want some type of editor script that produces the new Terrain object, gives it a new TerrainData object, pulls in the heightmap, writes it to disk, creating a fresh asset each time.

I suspect something like that might already exist out there, but obviously any data / scaling assumptions would need to be reconciled with your data.

I have some random terrain modification examples in my MakeGeo project.

MakeGeo is presently hosted at these locations:

https://bitbucket.org/kurtdekker/makegeo

Hi Kurt,

Thanks for the reply and links. I’ll have a look through :slight_smile:

I have a script setup to generate, resize, position and map aerial imagery but the last thing is to import the corresponding heightmap to terrain object. I’m really surprised the tool that is available via UI (Import RAW) isn’t available via code :eyes:

Kind Regards
Ved