Table of Contents
Scripts > Import HF
AboutThis 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 <not <project.IsInit>> project.InitProject endif hvar hMap set hMap <GetMap "HF"> assert hMap "Cannot get heightfield!" // exit immediately if HF is not initialised if <not <iseq 0 <map.GetWidth hMap>>> // 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 <EditUI &FS "Select heightfield to import"> "Import aborted" // initialise and edit settings list assert <map.LoadFile2 hMap <filesel.GetPathA &FS> 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" Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
|