prexisting material asset safety check

from steve_yorkshire
don't try and create a new suffixed materiaAsset if one already exists
This commit is contained in:
AzaezelX 2025-03-01 17:17:24 -06:00
parent 53a87af2b1
commit bc9ed3e10a

View file

@ -1726,6 +1726,13 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
if (activeImportConfig->UseExistingMaterials)
{
//So if the material already exists, we should just use that. So first, let's find out if it already exists
if (activeImportConfig->AlwaysAddMaterialSuffix)
{
StringTableEntry suffix = activeImportConfig->AddedMaterialSuffix.c_str();
char buf[1024];
dSprintf(buf, sizeof(buf), "%s%s", assetName, suffix);
assetName = buf;
}
//check to see if the definition for this already exists
StringTableEntry existingMatAsset = MaterialAsset::getAssetIdByMaterialName(StringTable->insert(assetName));