====== Scripts > Import HF ====== ^ Description | Import a heightfield. | ^ Author | Aaron Torpy | ^ Created | 2014/02/22 03:58 | ^ Requires | L3DT v11.11 | ^ Download | {{:scripts:import_hf.zs|import_hf.zs}} | ===== About ===== This script allows users to import a heightfield into an existing project without having to start a new project. It can be used to re-import a heightfield after editing in other software. ===== Script contents ===== // Author: A. Torpy // Created: 22 Feb 2014 // Purpose: Load a heightfield into an existing project if > project.InitProject endif hvar hMap set hMap assert hMap "Cannot get heightfield!" // exit immediately if HF is not initialised if >> // store a backup L3DTio_Backup.BackupMap "HF" "Import HF" 0 "view.ShowMap \"HF\"" // free HF map.Free hMap endif // initialise and edit file selector filesel FS filesel.Init &FS true NULL "Heightfield files|*.hfz;*.hf2;*.hff;*.ter;*.bt;*.png;*.bmp;*.tga|All files (*.*)|*.*|" NULL NULL assert "Import aborted" // initialise and edit settings list assert HF false true> "Error loading file" map.SetFlag hMap 1 true // set 'Ready' flag map.SetFlag hMap 5 false // clear 'modified' flag // refresh the heightfield view.ShowMap "HF"