Reworks the terrain loader code to work with the assets.

Fixes the terrain asset creation, makes the loading logic go through the asset auto-import behavior when a filename or assetid is bound that is not found.
Corrects terrain material binding to properly save and load
Makes the terrain asset inspector fields work as expected.
This commit is contained in:
Areloch 2020-06-25 23:33:01 -05:00
parent 3e1795ba1d
commit 4ce558f042
15 changed files with 500 additions and 283 deletions

View file

@ -38,20 +38,11 @@ function AssetBrowser::createTerrainAsset(%this)
AssetBrowser.refresh();
//Save out a basic terrain block here
/*%terrBlock = new TerrainBlock() { terrainFile = %terPath; };
%terrBlock.save(%terPath);
%terrBlock.delete();*/
//the terrain block creation is...weird and does coded path stuff engine-side.
//this needs reworking, but this is a sidestep for now
%misFile = $Client::MissionFile;
$Client::MissionFile = %terPath;
//
$createdTerrainBlock = TerrainBlock::createNew( %assetName, %this.newAssetSettings.resolution, "", %this.newAssetSettings.genWithNoise );
$Client::MissionFile = %misFile;
$createdTerrainBlock.terrainAsset = %moduleName @ ":" @ %assetName;
$createdTerrainBlock.terrainFile = "";
return %tamlpath;
}