Ver Fonte

from @OTHGMars: AssetImporter type and path for material look-ups.
(and fix for pbrconfig<map> entry)

AzaezelX há 5 anos atrás
pai
commit
284ad3e083
1 ficheiros alterados com 5 adições e 5 exclusões
  1. 5 5
      Engine/source/T3D/assets/assetImporter.cpp

+ 5 - 5
Engine/source/T3D/assets/assetImporter.cpp

@@ -1345,7 +1345,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
             for (U32 i = 0; i < suffixCount; i++)
             {
                //First, try checking based on the material's assetName for our patternbase
-               String testPath = assetItem->filePath.getPath();
+               String testPath = assetItem->filePath.getRootAndPath();
                testPath += "/" + assetItem->cleanAssetName + StringUnit::getUnit(suffixList.c_str(), i, ",;");
 
                String imagePath = AssetImporter::findImagePath(testPath);
@@ -1355,7 +1355,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
                   //got a match!
                   AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
 
-                  newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)i);
+                  newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
 
                   matchedImageTypes[t] = newImageAssetObj;
                   break;
@@ -1364,7 +1364,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
                {
                   if(materialImageNoSuffix.isNotEmpty())
                   {
-                     testPath = assetItem->filePath.getPath();
+                     testPath = assetItem->filePath.getRootAndPath();
                      testPath += "/" + materialImageNoSuffix + StringUnit::getUnit(suffixList.c_str(), i, ",;");
 
                      imagePath = AssetImporter::findImagePath(testPath);
@@ -1374,7 +1374,7 @@ void AssetImporter::processMaterialAsset(AssetImportObject* assetItem)
                         //got a match!
                         AssetImportObject* newImageAssetObj = addImportingAsset("ImageAsset", imagePath, assetItem, "");
 
-                        newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)i);
+                        newImageAssetObj->imageSuffixType = ImageAsset::getImageTypeNameFromType((ImageAsset::ImageTypes)t);
 
                         matchedImageTypes[t] = newImageAssetObj;
                         break;
@@ -2337,7 +2337,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
          }
          else if (imageType == ImageAsset::ImageTypes::PBRConfig)
          {
-            mapFieldName = "PBRConfig";
+            mapFieldName = "PBRConfigMap";
          }
          else if (imageType == ImageAsset::ImageTypes::Metalness)
          {