Page 1 of 1

Batch Exporting HeightMaps

PostPosted: Thu Dec 28, 2017 3:44 pm
by cmder
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!

Re: Batch Exporting HeightMaps

PostPosted: Mon Jan 08, 2018 2:15 pm
by Aaron
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,
Aaron.