mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-27 23:35:45 +00:00
Shift file handling in importer to a standardized function
Added santizing of strings to filenames, object names and asset names for the importer process Added sanitizeString console function for above Added processing of terrainBlock object's fields for importer Added check to avoid updateTSShapeLoadProgress spam Adjusted folderPrefix logic to walk up directory to find assetName that isn't already in use.
This commit is contained in:
parent
190343cbc7
commit
48e994f7bd
5 changed files with 227 additions and 137 deletions
|
|
@ -2381,11 +2381,25 @@ void AssetImporter::resolveAssetItemIssues(AssetImportObject* assetItem)
|
|||
}
|
||||
else if (activeImportConfig->DuplicateAutoResolution == String("FolderPrefix"))
|
||||
{
|
||||
//Set trailing number
|
||||
String renamedAssetName = assetItem->assetName;
|
||||
String owningFolder = assetItem->filePath.getDirectory(assetItem->filePath.getDirectoryCount() - 1);
|
||||
|
||||
renamedAssetName = owningFolder + "_" + renamedAssetName;
|
||||
//Set trailing number
|
||||
S32 dirIndex = assetItem->filePath.getDirectoryCount() - 1;
|
||||
while (dirIndex > -1)
|
||||
{
|
||||
renamedAssetName = assetItem->assetName;
|
||||
String owningFolder = assetItem->filePath.getDirectory(dirIndex);
|
||||
|
||||
renamedAssetName = owningFolder + "_" + renamedAssetName;
|
||||
|
||||
if (AssetDatabase.isDeclaredAsset(renamedAssetName))
|
||||
{
|
||||
dirIndex--;
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//Log it's renaming
|
||||
dSprintf(importLogBuffer, sizeof(importLogBuffer), "Asset %s was renamed due to %s as part of the Import Configuration", assetItem->assetName.c_str(), humanReadableReason.c_str());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue