Adds cleanup of material and terrain material objects when creating a new asset of the respective type to avoid collisions when we immediately properly init the asset on creation

Reorganizes the terrainMaterialDlg to use a split container for better usability, fixed some minor layout issues, and added in FX material fields to be able to edit those directly via the terrain mat editor
Updated the terrainMaterialDlg save logic to better sequence the steps for saving to allow stable in-place creation of asset for stub materials due to missing references
Updated the terrainMaterialDlg save logic to properly save out all the material effects stuff like footstep flags, effect colors, or sounds.
This commit is contained in:
JeffR 2022-03-30 01:38:15 -05:00
parent 81aa43a4bd
commit 85bb4cbff3
4 changed files with 442 additions and 1286 deletions

View file

@ -21,6 +21,9 @@ function AssetBrowser::createMaterialAsset(%this)
TamlWrite(%asset, %tamlpath);
//cleanup before proper init'ing
%assetName.delete();
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);

View file

@ -48,6 +48,10 @@ function AssetBrowser::createTerrainMaterialAsset(%this)
TamlWrite(%asset, %tamlpath);
//cleanup before proper init'ing
%matDef.delete();
%fxMatDef.delete();
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);