Merge pull request #277 from Azaezel/alpha40_matAssetMangles

from @OTHGMars: AssetImporter type and path for material look-ups.
This commit is contained in:
Brian Roberts 2020-08-08 00:55:26 -05:00 committed by GitHub
commit 08f8d8abf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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