L3DT users' community
Large 3D terrain generator

Batch Exporting HeightMaps

Got a problem or need advice?

Batch Exporting HeightMaps

Postby cmder » Thu Dec 28, 2017 3:44 pm

Hi all!

Is there a way to either:
1. Export heightmaps in bmp format, or another image format when running batches
2. Convert hfz to bmp format, or another image format programatically

Thanks in advance!
Posts: 1
Joined: Thu Dec 28, 2017 3:39 pm

Re: Batch Exporting HeightMaps

Postby Aaron » Mon Jan 08, 2018 2:15 pm

Hi cmder,

I'm sorry for the delay. Yes, you can export heightmaps as BMP (or any other supported format) when running batches. For this you need to use a '.run' batch definition file, which should look something like this:

Code: Select all
L3DT Batch File
Version:   Release 2.6

Map definition:   "perlin_1025x512.def.xml"
Completion script: "ExportBMP.zs"
Number of copies:   2

Map definition:   "di64_1024x1536.def.xml"
Completion script: "ExportBMP.zs"

In the above example, there are two batches to be generated, the first being two copies using the settings from the 'perlin_1025x512.def.xml' map definition file, and one copy of 'di64_1024x1536.def.xml'. In both batches, the 'ExportBMP.zs' script file is called after each map is generated to export the heightmap as a bitmap. The contents of the 'ExportBMP.zs' script file will look like:

Code: Select all
string OutputFileExt
set OutputFileExt "bmp" // change this if you want to export as a different file type

// format the file name (will save HF as BMP in project directory)
string FileName
set FileName <strcat <strcat <file.TrimExt <map.GetFilename <GetMap "HF">>> "."> OutputFileExt>

// and export
map.SaveFile2 <GetMap "HF"> FileName false true

The files required to run this batch (the '.run', the '.def.xml', and the '.zs' files) should all be in the same directory.

Please let me know if you find any problem with this.

Best regards,
User avatar
Site Admin
Posts: 3680
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Return to Help and support

Who is online

Users browsing this forum: No registered users and 4 guests