From bc9ed3e10aa7fb89f991d40cf5678cf601ceaacc Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sat, 1 Mar 2025 17:17:24 -0600 Subject: [PATCH] prexisting material asset safety check from steve_yorkshire don't try and create a new suffixed materiaAsset if one already exists --- Engine/source/T3D/assets/assetImporter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Engine/source/T3D/assets/assetImporter.cpp b/Engine/source/T3D/assets/assetImporter.cpp index 58d956ef5..dd529cd7f 100644 --- a/Engine/source/T3D/assets/assetImporter.cpp +++ b/Engine/source/T3D/assets/assetImporter.cpp @@ -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));