浏览代码

Merge pull request #1402 from Azaezel/alpha41/mumbledMat

prexisting material asset safety check
Brian Roberts 7 月之前
父节点
当前提交
09cf5a0425
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Engine/source/T3D/assets/assetImporter.cpp

+ 7 - 0
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));