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
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user