mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-19 19:35:26 +00:00
Fixed formatting to match the standard for TerrainMaterialAsset inspector fields
Added utility functions to TerrainMaterialAsset for getting the material and fx material definitions Fixed logical flaw with the initialization code that could cause the materialDefinition to be nulled in terrainmaterialassets Fixed layer handling in GroundCover to properly work with TerrainMaterialAssets Added logic to properly exit out of the onAdd in the event no internal name is assigned or if there is a collision. This prevents duplicates from appearing in the terr mat editor when creating a new material Fixed issue where going from a creator item in the AB to selecting a particular asset type would break the filtering because select mode removed collections and creator items, changing all the item ids and breaking references. Added sanity check to prevent attempting to acquire non-assets in the AB, such as creator entries, which would cause console spam Added optional field to provide an override new asset name to the New Asset window Added logic so in the event no FX Material is found when importing a terrain material, it will create a stub entry so it always has one defined Added logic to handle situations where a terrain has a reference to an assetId, but the asset does not exist for whatever reason. Will prompt to create the missing asset, then continue on with the regular saving/editing process as normal Fixed issue where the terrain material editor would try and reference the preview images being used in the display on the editor instead of the proper assetId itself
This commit is contained in:
parent
3e39347167
commit
81aa43a4bd
9 changed files with 142 additions and 134 deletions
|
|
@ -137,13 +137,19 @@ bool TerrainMaterial::onAdd()
|
|||
SimSet *set = Sim::getTerrainMaterialSet();
|
||||
|
||||
// Make sure we have an internal name set.
|
||||
if ( !mInternalName || !mInternalName[0] )
|
||||
Con::warnf( "TerrainMaterial::onAdd() - No internal name set!" );
|
||||
if (!mInternalName || !mInternalName[0])
|
||||
{
|
||||
Con::warnf("TerrainMaterial::onAdd() - No internal name set!");
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SimObject *object = set->findObjectByInternalName( mInternalName );
|
||||
if ( object )
|
||||
Con::warnf( "TerrainMaterial::onAdd() - Internal name collision; '%s' already exists!", mInternalName );
|
||||
if (object)
|
||||
{
|
||||
Con::warnf("TerrainMaterial::onAdd() - Internal name collision; '%s' already exists!", mInternalName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
set->addObject( this );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue