mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 04:45:31 +00:00
shifts getImageFilename to getImagePath on ImageAsset
Adjusts references to utilize getImagePath to ensure things using the image asset gets the proper full path Adjusts image import logic to import finding associated images Adds logic so if a roughness map is imported, the generated material asset has the invertSmoothness flag on.
This commit is contained in:
parent
8d3071fb72
commit
686975c8ee
4 changed files with 15 additions and 7 deletions
|
|
@ -1317,7 +1317,7 @@ void AssetImporter::processImageAsset(AssetImportObject* assetItem)
|
|||
{
|
||||
if (!assetItem->filePath.isEmpty())
|
||||
{
|
||||
materialAsset = addImportingAsset("MaterialAsset", "", nullptr, noSuffixName);
|
||||
materialAsset = addImportingAsset("MaterialAsset", assetItem->filePath, nullptr, noSuffixName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2466,6 +2466,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
|
|||
dSprintf(lineBuffer, 1024, " mapTo=\"%s\";", assetName);
|
||||
file->writeLine((U8*)lineBuffer);
|
||||
|
||||
bool hasRoughness = false;
|
||||
for (U32 i = 0; i < assetItem->childAssetItems.size(); i++)
|
||||
{
|
||||
AssetImportObject* childItem = assetItem->childAssetItems[i];
|
||||
|
|
@ -2502,6 +2503,7 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
|
|||
else if (imageType == ImageAsset::ImageTypes::Roughness)
|
||||
{
|
||||
mapFieldName = "RoughnessMap";
|
||||
hasRoughness = true;
|
||||
}
|
||||
|
||||
assetFieldName = mapFieldName + "Asset";
|
||||
|
|
@ -2515,6 +2517,12 @@ Torque::Path AssetImporter::importMaterialAsset(AssetImportObject* assetItem)
|
|||
file->writeLine((U8*)lineBuffer);
|
||||
}
|
||||
|
||||
if (hasRoughness)
|
||||
{
|
||||
file->writeLine((U8*)" invertSmoothness = true;");
|
||||
|
||||
}
|
||||
|
||||
file->writeLine((U8*)"};");
|
||||
file->writeLine((U8*)"//--- OBJECT WRITE END ---");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue