LYN-2537 engine assets (#254)
* LYN-2537 Moved the Engine and Editor folder to be within the EngineAssets folder * Fixed Documentation in bootstrap.cfg to correct the path to the user project specific registry file * Adding a newline to the output of AssetCatalog 'Registering asset..., but type is not set' message * Updating the AssetProcessorPlatformConfig.setreg Scan Folder to detect the @ENGINEROOT@/EngineAssets/Engine path for engine runtime assets and @ENGINEROOT@/EngineAssets/Editor path for engine tool assets * Updating references to Icons and other assets to account for moving the Engine and Editor folder under a single EngineAssets folder * Moving the Engine Settings Registry folder from Engine/Registry -> Registry * Removed the LY_PROJECT_CMAKE_PATH define as it is not portable to other locations. It is hard coded to the project location that was used for the CMake configuration. Furthermore it paths with backslashes within it are treated as escape characters and not a path separator * Updated the LyTestTools asset_processor.py script to copy the exclude.filetag from the EngineAssets/Engine directory now * Fixed Atom Shader Preprocessing when running using an External Project * Updated the TSGenerateAction.cpp to fix the build error with using a renamed variable * Updated the Install_Common.cmake ly_setup_others function to install the EngineAssets directory and the each of the Gem's Assets directory while maintaining the relative directory structure to the Engine Root Also updated the install step to install the Registry folder at the engine root * Fixed the copying of the Registry folder to be in the install root, instead of under a second 'Registry' folder * Moving the AssetProcessorPlatformConfig.setreg file over to the Registry folder * Updated the LyTestTools and C++ code to point that the new location of the AssetProcessorPlatformConfig.setreg file inside of the Registry folder * Renamed Test AssetProcessor*Config.ini files to have the .setreg extension * Converted the AssetProcessor test setreg files from ini format to json format using the SerializeContextTools convert-ini command * Updated the AssetProcessor CMakeLists.txt to copy over the test setreg files to the build folder * Updated the assetprocessor test file list to point at the renamed AsssetProcessor*Config setreg filenames * Removed the Output Prefix code from the AssetProcessor. The complexity that it brought to the AP code is not needed, as users can replicate the behavior by just moving there assets underneath a another folder, underneath the scan folder * Adding back support to read the AssetProcessorPlatformConfig.setreg file from the asset root. This is only needed for C++ UnitTests as they run in an environment where the accessing the Engine Settings Registry is not available * Updating the Install_common.cmake logic to copy any "Assets" folder to the install layout. The Script has also been updated to copy over the "Assets" folder in the Engine Root to the install layout instead of an "EngineAssets" folder * Updating References to EngineAssets source asset folder in code to be the Assets source folder * Moved the Engine Source Asset folder of 'EngineAssets' to a new folder name of 'Assets'. This is inline with the naming scheme we use for Gem asset folders * Adding the EngineFinder.cmake to the AutomatedTesting project to allow it to work in a project centric manner * Updating the LyTestTools copy_assets_to_project function to be able to copy assets with folders to the temporary project root Fixed an issue in LyTestTools where the temporary log directory could have shutil.rmtree being called twice on it leading to an exception which fails an automated test Updated the asset_procesor_gui_tests_2 AddScanFolder test to not use the output prefix, but instead place the source asset root into a subdirectory * Correct the AssetProcessorPlatformConfig Scan Folders for the EngineAssets directory to point at the Assets directory * Updated the asset procesor batch dependency test scan folder to point at the 'Assets' folder instead of 'EngineAssets'
This commit is contained in:
committed by
GitHub
parent
ed74bb9166
commit
3dec5d3b71
@@ -951,17 +951,7 @@ namespace AssetProcessor
|
||||
// the subId part of the assetId will always be set to zero.
|
||||
assetInfo.m_assetId = AZ::Data::AssetId(entry.m_sourceGuid, 0);
|
||||
|
||||
// the Scan Folder may have an output prefix, so we must remove it from the relpath.
|
||||
// this involves deleting the output prefix and the first slash ('editor/') which is why
|
||||
// we remove the length of outputPrefix and one extra character.
|
||||
if (!scanEntry.m_outputPrefix.empty())
|
||||
{
|
||||
assetInfo.m_relativePath = entry.m_sourceName.substr(static_cast<int>(scanEntry.m_outputPrefix.size()) + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
assetInfo.m_relativePath = entry.m_sourceName;
|
||||
}
|
||||
assetInfo.m_relativePath = entry.m_sourceName;
|
||||
AZStd::string absolutePath;
|
||||
AzFramework::StringFunc::Path::Join(scanEntry.m_scanFolder.c_str(), assetInfo.m_relativePath.c_str(), absolutePath);
|
||||
assetInfo.m_sizeBytes = AZ::IO::SystemFile::Length(absolutePath.c_str());
|
||||
@@ -1375,17 +1365,7 @@ namespace AssetProcessor
|
||||
AzToolsFramework::AssetDatabase::ScanFolderDatabaseEntry scanEntry;
|
||||
if (m_db->GetScanFolderByScanFolderID(entry.m_scanFolderPK, scanEntry))
|
||||
{
|
||||
// the Scan Folder may have an output prefix, so we must remove it from the relpath.
|
||||
// this involves deleting the output prefix and the first slash ('editor/') which is why
|
||||
// we remove the length of outputPrefix and one extra character.
|
||||
if (!scanEntry.m_outputPrefix.empty())
|
||||
{
|
||||
relativePath = entry.m_sourceName.substr(static_cast<int>(scanEntry.m_outputPrefix.size()) + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
relativePath = entry.m_sourceName;
|
||||
}
|
||||
relativePath = entry.m_sourceName;
|
||||
|
||||
watchFolder = scanEntry.m_scanFolder;
|
||||
|
||||
@@ -1530,28 +1510,7 @@ namespace AssetProcessor
|
||||
watchFolder = sourceInfo.m_watchFolder.toStdString().c_str();
|
||||
|
||||
AZStd::string sourceNameStr(sourceInfo.m_sourceName.toStdString().c_str());
|
||||
|
||||
// the Scan Folder may have an output prefix, so we must remove it from the relpath.
|
||||
// this involves deleting the output prefix and the first slash ('editor/') which is why
|
||||
// we remove the length of outputPrefix and one extra character.
|
||||
const AssetProcessor::ScanFolderInfo* info = m_platformConfig->GetScanFolderByPath(watchFolder.c_str());
|
||||
if ((info)&&(!info->GetOutputPrefix().isEmpty()))
|
||||
{
|
||||
const int prefixLength = static_cast<int>(info->GetOutputPrefix().length()) + 1;
|
||||
AZ_Assert(sourceNameStr.length() > prefixLength, "Source name [%s] was invalid compared to the output prefix.", sourceNameStr.c_str() != nullptr ? sourceNameStr.c_str() : "");
|
||||
if (sourceNameStr.length() > prefixLength)
|
||||
{
|
||||
assetInfo.m_relativePath = sourceNameStr.substr(prefixLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
assetInfo.m_relativePath.swap(sourceNameStr);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assetInfo.m_relativePath.swap(sourceNameStr);
|
||||
}
|
||||
assetInfo.m_relativePath.swap(sourceNameStr);
|
||||
|
||||
assetInfo.m_assetId = foundSource->first;
|
||||
|
||||
@@ -1598,15 +1557,7 @@ namespace AssetProcessor
|
||||
return false;
|
||||
}
|
||||
QString databasePath = QString::fromUtf8(sourceDatabaseName);
|
||||
if (!scanFolderInfo->GetOutputPrefix().isEmpty() && databasePath.startsWith(scanFolderInfo->GetOutputPrefix(), Qt::CaseInsensitive))
|
||||
{
|
||||
QString relativePath = databasePath.right(databasePath.length() - scanFolderInfo->GetOutputPrefix().length() - 1); // also eat the slash, hence -1
|
||||
assetInfo.m_relativePath = relativePath.toUtf8().data();
|
||||
}
|
||||
else
|
||||
{
|
||||
assetInfo.m_relativePath = sourceDatabaseName;
|
||||
}
|
||||
assetInfo.m_relativePath = sourceDatabaseName;
|
||||
|
||||
AZStd::string absolutePath;
|
||||
AzFramework::StringFunc::Path::Join(watchFolder, assetInfo.m_relativePath.c_str(), absolutePath);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace AssetProcessor
|
||||
|
||||
if (!AzFramework::StringFunc::Path::IsRelative(path.c_str()))
|
||||
{
|
||||
if (m_platformConfig->ConvertToRelativePath(QString::fromUtf8(path.c_str()), relativePath, scanFolder, true))
|
||||
if (m_platformConfig->ConvertToRelativePath(QString::fromUtf8(path.c_str()), relativePath, scanFolder))
|
||||
{
|
||||
auto* scanFolderInfo = m_platformConfig->GetScanFolderByPath(scanFolder);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ Please note that only those seed files will get updated that are active for your
|
||||
else
|
||||
{
|
||||
QString relativePathQString;
|
||||
if (!PlatformConfiguration::ConvertToRelativePath(normalizedSource.c_str(), scanFolderInfo, relativePathQString, false))
|
||||
if (!PlatformConfiguration::ConvertToRelativePath(normalizedSource.c_str(), scanFolderInfo, relativePathQString))
|
||||
{
|
||||
return AZ::Failure(AZStd::string::format("Failed to convert path to relative path. %s\n", normalizedSource.c_str()));
|
||||
}
|
||||
@@ -167,16 +167,6 @@ Please note that only those seed files will get updated that are active for your
|
||||
return AZ::Success();
|
||||
}
|
||||
|
||||
AZStd::string SourceFileRelocator::RemoveDatabasePrefix(const ScanFolderInfo* scanFolder, AZStd::string sourceName)
|
||||
{
|
||||
if (!scanFolder->GetOutputPrefix().isEmpty())
|
||||
{
|
||||
return sourceName.substr(scanFolder->GetOutputPrefix().size() + 1); //+1 to remove the slash after the prefix
|
||||
}
|
||||
|
||||
return sourceName;
|
||||
}
|
||||
|
||||
QHash<QString, int> SourceFileRelocator::GetSources(QStringList pathMatches, const ScanFolderInfo* scanFolderInfo,
|
||||
SourceFileRelocationContainer& sources) const
|
||||
{
|
||||
@@ -188,7 +178,7 @@ Please note that only those seed files will get updated that are active for your
|
||||
PlatformConfiguration::ConvertToRelativePath(file, scanFolderInfo, databaseSourceName);
|
||||
m_stateData->QuerySourceBySourceNameScanFolderID(databaseSourceName.toUtf8().constData(), scanFolderInfo->ScanFolderID(), [this, &sources, &scanFolderInfo, &sourceIndexMap, &databaseSourceName](const AzToolsFramework::AssetDatabase::SourceDatabaseEntry& entry)
|
||||
{
|
||||
sources.emplace_back(entry, GetProductMapForSource(entry.m_sourceID), RemoveDatabasePrefix(scanFolderInfo, entry.m_sourceName), scanFolderInfo);
|
||||
sources.emplace_back(entry, GetProductMapForSource(entry.m_sourceID), entry.m_sourceName, scanFolderInfo);
|
||||
sourceIndexMap[databaseSourceName] = aznumeric_cast<int> (sources.size() - 1);
|
||||
return true;
|
||||
});
|
||||
@@ -357,12 +347,6 @@ Please note that only those seed files will get updated that are active for your
|
||||
|
||||
QString relativeFileName(normalizedSource.c_str());
|
||||
|
||||
//if relative path starts with the output prefix than remove it first
|
||||
if (!scanFolderInfo->GetOutputPrefix().isEmpty() && relativeFileName.startsWith(scanFolderInfo->GetOutputPrefix(), Qt::CaseInsensitive))
|
||||
{
|
||||
relativeFileName = relativeFileName.right(relativeFileName.length() - (scanFolderInfo->GetOutputPrefix().length() + 1)); // adding 1 for slash
|
||||
}
|
||||
|
||||
QDir rooted(scanFolderInfo->ScanPath());
|
||||
QString absolutePath = rooted.absoluteFilePath(relativeFileName);
|
||||
|
||||
@@ -620,7 +604,7 @@ Please note that only those seed files will get updated that are active for your
|
||||
{
|
||||
QString relativePath;
|
||||
QString scanFolderName;
|
||||
m_platformConfig->ConvertToRelativePath(newDestinationPath.c_str(), relativePath, scanFolderName, false);
|
||||
m_platformConfig->ConvertToRelativePath(newDestinationPath.c_str(), relativePath, scanFolderName);
|
||||
|
||||
relocationInfo.m_newAbsolutePath = newDestinationPath;
|
||||
relocationInfo.m_newRelativePath = relativePath.toUtf8().constData();
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace AssetProcessor
|
||||
SourceFileRelocationInfo(const AZStd::string& filePath, const ScanFolderInfo* scanFolder)
|
||||
{
|
||||
QString relFilePath;
|
||||
PlatformConfiguration::ConvertToRelativePath(filePath.c_str(), scanFolder, relFilePath, true);
|
||||
PlatformConfiguration::ConvertToRelativePath(filePath.c_str(), scanFolder, relFilePath);
|
||||
m_oldRelativePath = relFilePath.toUtf8().data();
|
||||
AzFramework::StringFunc::Path::ConstructFull(scanFolder->ScanPath().toUtf8().constData(), m_oldRelativePath.c_str(), m_oldAbsolutePath, false);
|
||||
m_oldAbsolutePath = AssetUtilities::NormalizeFilePath(m_oldAbsolutePath.c_str()).toUtf8().constData();
|
||||
@@ -191,7 +191,6 @@ namespace AssetProcessor
|
||||
SourceFileRelocator(AZStd::shared_ptr<AzToolsFramework::AssetDatabase::AssetDatabaseConnection> stateData, PlatformConfiguration* platformConfiguration);
|
||||
~SourceFileRelocator();
|
||||
|
||||
static AZStd::string RemoveDatabasePrefix(const ScanFolderInfo* scanFolder, AZStd::string sourceName);
|
||||
static void MakePathRelative(const AZStd::string& parentPath, const AZStd::string& childPath, AZStd::string& parentRelative, AZStd::string& childRelative);
|
||||
|
||||
static AZ::Outcome<AZStd::string, AZStd::string> HandleWildcard(AZStd::string_view absFile, AZStd::string_view absSearch, AZStd::string destination);
|
||||
|
||||
@@ -142,11 +142,6 @@ namespace AssetProcessor
|
||||
QString databaseSourceName = QString::fromUtf8(entry.m_sourceName.c_str());
|
||||
QString scanFolderPath = QString::fromUtf8(entry.m_scanFolder.c_str());
|
||||
QString relativeToScanFolderPath = databaseSourceName;
|
||||
if (!entry.m_outputPrefix.empty())
|
||||
{
|
||||
relativeToScanFolderPath = relativeToScanFolderPath.remove(0, static_cast<int>(entry.m_outputPrefix.size()) + 1);
|
||||
}
|
||||
|
||||
QString finalAbsolute = (QString("%1/%2").arg(scanFolderPath).arg(relativeToScanFolderPath));
|
||||
m_sourceFilesInDatabase[finalAbsolute] = { scanFolderPath, relativeToScanFolderPath, databaseSourceName, entry.m_analysisFingerprint.c_str() };
|
||||
|
||||
@@ -173,12 +168,6 @@ namespace AssetProcessor
|
||||
if (scanFolderInfo.ScanFolderID() == entry.m_scanFolderPK)
|
||||
{
|
||||
scanFolderPath = scanFolderInfo.ScanPath();
|
||||
|
||||
if (!scanFolderInfo.GetOutputPrefix().isEmpty())
|
||||
{
|
||||
relativeToScanFolderPath = relativeToScanFolderPath.remove(0, static_cast<int>(scanFolderInfo.GetOutputPrefix().size()) + 1);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -470,12 +459,12 @@ namespace AssetProcessor
|
||||
return;
|
||||
}
|
||||
|
||||
// note that m_SourceFilesInDatabase is a map from (full absolute path) --> (database name for file, which includes outputprefix)
|
||||
// note that m_SourceFilesInDatabase is a map from (full absolute path) --> (database name for file)
|
||||
for (auto iter = m_sourceFilesInDatabase.begin(); iter != m_sourceFilesInDatabase.end(); iter++)
|
||||
{
|
||||
// CheckDeletedSourceFile actually expects the database name as the second value
|
||||
// iter.key is the full path normalized. iter.value is the database path.
|
||||
// we need the relative path too, which involves removing the scan folder outputprefix it present:
|
||||
// we need the relative path too:
|
||||
CheckDeletedSourceFile(
|
||||
iter.key(), iter.value().m_sourceRelativeToWatchFolder, iter.value().m_sourceDatabaseName,
|
||||
AZStd::chrono::system_clock::now());
|
||||
@@ -1633,27 +1622,7 @@ namespace AssetProcessor
|
||||
AzToolsFramework::AssetDatabase::ScanFolderDatabaseEntry scanfolder;
|
||||
if (m_stateData->GetScanFolderByScanFolderID(source.m_scanFolderPK, scanfolder))
|
||||
{
|
||||
// there's one more thing to account for here, and thats the fact that the sourceName may have an outputPrefix appended on to it
|
||||
// so for example, the scan folder might be c:/ly/dev/Gems/Clouds/Assets
|
||||
// but the outputPrefix might be Clouds/Assets, meaning "put it in that folder in the cache instead of just at the root"
|
||||
// When we have an outputprefix, we prepend it to SourceName so that its a unique source
|
||||
// so for example, the sourceName might be Clouds/Assets/blah.tif
|
||||
// if you were to blindly concatenate them you'd end up with c:/ly/dev/Gems/Clouds/Assets/Clouds/Assets/blah.tif
|
||||
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
// The watch folder is here
|
||||
// ^^^^^^^^^^^^^^
|
||||
// Prefix prepended
|
||||
// ^^^^^^^^
|
||||
// actual name
|
||||
// so remove the output prefix from sourcename if present before doing any source ops on it.
|
||||
|
||||
AZStd::string sourceName(source.m_sourceName);
|
||||
|
||||
if (!scanfolder.m_outputPrefix.empty())
|
||||
{
|
||||
sourceName = sourceName.substr(scanfolder.m_outputPrefix.size() + 1);
|
||||
}
|
||||
AZStd::string fullSourcePath = AZStd::string::format("%s/%s", scanfolder.m_scanFolder.c_str(), sourceName.c_str());
|
||||
AZStd::string fullSourcePath = AZStd::string::format("%s/%s", scanfolder.m_scanFolder.c_str(), source.m_sourceName.c_str());
|
||||
|
||||
AssessFileInternal(fullSourcePath.c_str(), false);
|
||||
}
|
||||
@@ -2001,18 +1970,7 @@ namespace AssetProcessor
|
||||
//remove the jobs associated with these products
|
||||
m_stateData->RemoveJob(oldJobInfo.m_jobID);
|
||||
|
||||
// note that JobRemoved is supposed to emit a jobinfo that is not output-prefixed
|
||||
if (!scanFolder->GetOutputPrefix().isEmpty())
|
||||
{
|
||||
JobInfo newJobInfo(oldJobInfo);
|
||||
QString sourcePathWithPrefix = QString::fromUtf8(oldJobInfo.m_sourceFile.c_str());
|
||||
newJobInfo.m_sourceFile = (sourcePathWithPrefix.right(sourcePathWithPrefix.length() - (scanFolder->GetOutputPrefix().length() + 1))).toUtf8().constData();
|
||||
Q_EMIT JobRemoved(newJobInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_EMIT JobRemoved(oldJobInfo);
|
||||
}
|
||||
Q_EMIT JobRemoved(oldJobInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2239,7 +2197,7 @@ namespace AssetProcessor
|
||||
}
|
||||
|
||||
AzToolsFramework::AssetDatabase::SourceDatabaseEntryContainer sources;
|
||||
QString sourceName = scanFolderInfo->GetOutputPrefix().isEmpty() ? relativePath : QDir::cleanPath(scanFolderInfo->GetOutputPrefix() + QDir::separator() + relativePath);
|
||||
QString sourceName = relativePath;
|
||||
m_stateData->GetSourcesLikeSourceName(sourceName, AzToolsFramework::AssetDatabase::AssetDatabaseConnection::StartsWith, sources);
|
||||
|
||||
AZ_TracePrintf(AssetProcessor::DebugChannel, "CheckDeletedSourceFolder: %i matching files.\n", sources.size());
|
||||
@@ -2250,11 +2208,6 @@ namespace AssetProcessor
|
||||
// reconstruct full path:
|
||||
QString actualRelativePath = source.m_sourceName.c_str();
|
||||
|
||||
if (!scanFolderInfo->GetOutputPrefix().isEmpty())
|
||||
{
|
||||
actualRelativePath = actualRelativePath.right(actualRelativePath.length() - (scanFolderInfo->GetOutputPrefix().length() + 1)); // adding one for separator
|
||||
}
|
||||
|
||||
QString finalPath = scanFolder.absoluteFilePath(actualRelativePath);
|
||||
|
||||
if (!QFile::exists(finalPath))
|
||||
@@ -2513,11 +2466,6 @@ namespace AssetProcessor
|
||||
const ScanFolderInfo* scanFolderInfo = m_platformConfig->GetScanFolderForFile(normalizedPath);
|
||||
|
||||
relativePathToFile = databasePathToFile;
|
||||
// remove output prefix if present to generate relative path
|
||||
if ((scanFolderInfo)&&(!scanFolderInfo->GetOutputPrefix().isEmpty()))
|
||||
{
|
||||
relativePathToFile = relativePathToFile.remove(0, static_cast<int>(scanFolderInfo->GetOutputPrefix().length()) + 1);
|
||||
}
|
||||
|
||||
if (normalizedPath.length() >= AP_MAX_PATH_LEN)
|
||||
{
|
||||
@@ -2537,7 +2485,7 @@ namespace AssetProcessor
|
||||
job.m_jobEntry = JobEntry(
|
||||
QString::fromUtf8(jobInfo.m_watchFolder.c_str()),
|
||||
relativePathToFile,
|
||||
databasePathToFile, // with outputprefix
|
||||
databasePathToFile,
|
||||
jobInfo.m_builderGuid,
|
||||
*platformFromInfo,
|
||||
jobInfo.m_jobKey.c_str(), 0, GenerateNewJobRunKey(),
|
||||
@@ -2646,7 +2594,7 @@ namespace AssetProcessor
|
||||
// to call the expensive function to discover correct case.
|
||||
QString pathRelativeToScanFolder;
|
||||
QString scanFolderPath;
|
||||
m_platformConfig->ConvertToRelativePath(overrider, pathRelativeToScanFolder, scanFolderPath, false /*include output prefix*/);
|
||||
m_platformConfig->ConvertToRelativePath(overrider, pathRelativeToScanFolder, scanFolderPath);
|
||||
AssetUtilities::UpdateToCorrectCase(scanFolderPath, pathRelativeToScanFolder);
|
||||
overrider = QDir(scanFolderPath).absoluteFilePath(pathRelativeToScanFolder);
|
||||
}
|
||||
@@ -3367,10 +3315,6 @@ namespace AssetProcessor
|
||||
newSourceInfo.m_watchFolder = scanFolder->ScanPath();
|
||||
newSourceInfo.m_sourceDatabaseName = databasePathToFile;
|
||||
newSourceInfo.m_sourceRelativeToWatchFolder = databasePathToFile;
|
||||
if (!scanFolder->GetOutputPrefix().isEmpty())
|
||||
{
|
||||
newSourceInfo.m_sourceRelativeToWatchFolder = newSourceInfo.m_sourceRelativeToWatchFolder.remove(0, static_cast<int>(scanFolder->GetOutputPrefix().length()) + 1);
|
||||
}
|
||||
|
||||
{
|
||||
// this scope exists only to narrow the range of m_sourceUUIDToSourceNameMapMutex
|
||||
@@ -3644,12 +3588,6 @@ namespace AssetProcessor
|
||||
continue;
|
||||
}
|
||||
|
||||
//if relative path starts with the output prefix then remove it first
|
||||
if (!scanFolderInfo->GetOutputPrefix().isEmpty() && knownPathBeforeWildcard.startsWith(scanFolderInfo->GetOutputPrefix(), Qt::CaseInsensitive))
|
||||
{
|
||||
knownPathBeforeWildcard = knownPathBeforeWildcard.right(knownPathBeforeWildcard.length() - (scanFolderInfo->GetOutputPrefix().length() + 1)); // adding 1 for slash
|
||||
}
|
||||
|
||||
QDir rooted(scanFolderInfo->ScanPath());
|
||||
QString absolutePath = rooted.absoluteFilePath(knownPathBeforeWildcard);
|
||||
|
||||
@@ -3950,7 +3888,6 @@ namespace AssetProcessor
|
||||
scanFolderFromConfigFile.ScanPath().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetDisplayName().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetPortableKey().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetOutputPrefix().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.IsRoot());
|
||||
//remove this scan path from the scan folders so what is left can deleted
|
||||
m_scanFoldersInDatabase.erase(found);
|
||||
@@ -3962,7 +3899,6 @@ namespace AssetProcessor
|
||||
scanFolderFromConfigFile.ScanPath().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetDisplayName().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetPortableKey().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.GetOutputPrefix().toUtf8().constData(),
|
||||
scanFolderFromConfigFile.IsRoot());
|
||||
}
|
||||
|
||||
@@ -4006,11 +3942,7 @@ namespace AssetProcessor
|
||||
result.m_sourceDatabaseName = QString::fromUtf8(sourceDatabaseEntry.m_sourceName.c_str());
|
||||
result.m_watchFolder = QString::fromUtf8(scanFolder.m_scanFolder.c_str());
|
||||
result.m_sourceRelativeToWatchFolder = result.m_sourceDatabaseName;
|
||||
if (!scanFolder.m_outputPrefix.empty())
|
||||
{
|
||||
result.m_sourceRelativeToWatchFolder = result.m_sourceRelativeToWatchFolder.remove(0, static_cast<int>(scanFolder.m_outputPrefix.size()) + 1);
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
// this scope exists to restrict the duration of the below lock.
|
||||
AZStd::lock_guard<AZStd::mutex> lock(m_sourceUUIDToSourceInfoMapMutex);
|
||||
@@ -4088,16 +4020,7 @@ namespace AssetProcessor
|
||||
{
|
||||
sourceDatabaseEntry.m_scanFolderPK = scanFolder->ScanFolderID();
|
||||
|
||||
if (!scanFolder->GetOutputPrefix().isEmpty())
|
||||
{
|
||||
// replace the "output prefix" part of the file name with the one from the ini file to sort out case sensitivity problems.
|
||||
QString withoutOutputPrefix = relativeSourceFilePath.remove(0, scanFolder->GetOutputPrefix().length() + 1);
|
||||
sourceDatabaseEntry.m_sourceName = AZStd::string::format("%s/%s", scanFolder->GetOutputPrefix().toUtf8().constData(), withoutOutputPrefix.toUtf8().data());
|
||||
}
|
||||
else
|
||||
{
|
||||
sourceDatabaseEntry.m_sourceName = relativeSourceFilePath.toUtf8().constData();
|
||||
}
|
||||
sourceDatabaseEntry.m_sourceName = relativeSourceFilePath.toUtf8().constData();
|
||||
|
||||
sourceDatabaseEntry.m_sourceGuid = AssetUtilities::CreateSafeSourceUUIDFromName(sourceDatabaseEntry.m_sourceName.c_str());
|
||||
|
||||
@@ -4709,7 +4632,7 @@ namespace AssetProcessor
|
||||
|
||||
QString databasePath;
|
||||
QString scanFolderPath;
|
||||
m_platformConfig->ConvertToRelativePath(metaDataFileName, databasePath, scanFolderPath, true);
|
||||
m_platformConfig->ConvertToRelativePath(metaDataFileName, databasePath, scanFolderPath);
|
||||
outFilesToFingerprint.insert(AZStd::make_pair(metaDataFileName.toUtf8().constData(), databasePath.toUtf8().constData()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace AssetProcessor
|
||||
//! Internal structure that will hold all the necessary source info
|
||||
struct SourceFileInfo
|
||||
{
|
||||
QString m_databasePath; // clarification: this is the database path (ie, includes outputprefix)
|
||||
QString m_databasePath; // clarification: this is the database path
|
||||
QString m_pathRelativeToScanFolder;
|
||||
AZ::Uuid m_uuid;
|
||||
const ScanFolderInfo* m_scanFolder{ nullptr };
|
||||
@@ -222,7 +222,7 @@ namespace AssetProcessor
|
||||
//! Emit whenever a new asset is found or an existing asset is updated
|
||||
void AssetMessage(AzFramework::AssetSystem::AssetNotificationMessage message);
|
||||
|
||||
// InputAssetProcessed - uses absolute asset path of input file - no outputprefix
|
||||
// InputAssetProcessed - uses absolute asset path of input file
|
||||
void InputAssetProcessed(QString fullAssetPath, QString platform);
|
||||
|
||||
void RequestInputAssetStatus(QString inputAssetPath, QString platform, QString jobDescription);
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace AssetProcessor
|
||||
QString path,
|
||||
QString displayName,
|
||||
QString portableKey,
|
||||
QString prefix,
|
||||
bool isRoot,
|
||||
bool recurseSubFolders,
|
||||
AZStd::vector<AssetBuilderSDK::PlatformInfo> platforms = AZStd::vector<AssetBuilderSDK::PlatformInfo>{},
|
||||
@@ -38,7 +37,6 @@ namespace AssetProcessor
|
||||
: m_scanPath(path)
|
||||
, m_displayName(displayName)
|
||||
, m_portableKey (portableKey)
|
||||
, m_outputPrefix(prefix)
|
||||
, m_isRoot(isRoot)
|
||||
, m_recurseSubFolders(recurseSubFolders)
|
||||
, m_order(order)
|
||||
@@ -62,11 +60,6 @@ namespace AssetProcessor
|
||||
return m_displayName;
|
||||
}
|
||||
|
||||
QString GetOutputPrefix() const
|
||||
{
|
||||
return m_outputPrefix;
|
||||
}
|
||||
|
||||
bool IsRoot() const
|
||||
{
|
||||
return m_isRoot;
|
||||
@@ -110,7 +103,6 @@ namespace AssetProcessor
|
||||
private:
|
||||
QString m_scanPath; // the local path to scan ("C:\\whatever")
|
||||
QString m_displayName; // the display name to show in GUIs that show it.
|
||||
QString m_outputPrefix; // the output prefix to target results into (eg, put things in a certain subfolder of @assets@ rather than the relative to assets itself)
|
||||
QString m_portableKey; // a key that remains the same even if the asset database is moved from computer to computer.
|
||||
bool m_isRoot = false; // is it 'the' root folder?
|
||||
bool m_recurseSubFolders = true;
|
||||
|
||||
@@ -126,7 +126,7 @@ void AssetScannerWorker::ScanForSourceFiles(const ScanFolderInfo& scanFolderInfo
|
||||
{
|
||||
//Entry is a directory
|
||||
m_folderList.insert(AZStd::move(assetFileInfo));
|
||||
ScanFolderInfo tempScanFolderInfo(absPath, "", "", "", false, true);
|
||||
ScanFolderInfo tempScanFolderInfo(absPath, "", "", false, true);
|
||||
ScanForSourceFiles(tempScanFolderInfo, rootScanFolder);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user