Quellcode durchsuchen

Update more APM code to work with SourceAssetReference instead of strings

Signed-off-by: amzn-mike <[email protected]>
amzn-mike vor 2 Jahren
Ursprung
Commit
1306284814

+ 51 - 0
Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.cpp

@@ -400,6 +400,20 @@ namespace AzToolsFramework
             static const auto s_queryProductBySourcename = MakeSqlQuery(QUERY_PRODUCT_BY_SOURCENAME, QUERY_PRODUCT_BY_SOURCENAME_STATEMENT, LOG_NAME,
                     SqlParam<const char*>(":sourcename"));
 
+            static const char* QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID = "AzToolsFramework::AssetDatabase::QueryProductBySourceNameScanFolderID";
+            static const char* QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_STATEMENT =
+                "SELECT Products.*, Jobs.* FROM Sources LEFT JOIN Jobs "
+                                                                       "ON Sources.SourceID = Jobs.SourcePK INNER JOIN Products "
+                                                                       "ON Jobs.JobID = Products.JobPK WHERE "
+                                                                       "Sources.SourceName = :sourcename AND Sources.ScanFolderPK = :scanfolderid;";
+
+            static const auto s_queryProductBySourcenameScanFolderId = MakeSqlQuery(
+                QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID,
+                QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_STATEMENT,
+                LOG_NAME,
+                SqlParam<const char*>(":sourcename"),
+                SqlParam<AZ::s64>("scanfolderid"));
+
             //add sql statement for querying everything by source name
             static const char* QUERY_PRODUCT_BY_SOURCENAME_PLATFORM = "AzToolsFramework::AssetDatabase::QueryProductBySourceNamePlatform";
             static const char* QUERY_PRODUCT_BY_SOURCENAME_PLATFORM_STATEMENT =
@@ -413,6 +427,22 @@ namespace AzToolsFramework
                     SqlParam<const char*>(":sourcename"),
                     SqlParam<const char*>(":platform"));
 
+            static const char* QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_PLATFORM = "AzToolsFramework::AssetDatabase::QueryProductBySourceNameScanFolderIDPlatform";
+            static const char* QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_PLATFORM_STATEMENT =
+                "SELECT Products.*, Jobs.* FROM Sources LEFT JOIN Jobs "
+                                                                                "ON Sources.SourceID = Jobs.SourcePK INNER JOIN Products "
+                                                                                "ON Jobs.JobID = Products.JobPK WHERE "
+                                                                                "Jobs.Platform = :platform AND "
+                                                                                "Sources.SourceName = :sourcename AND Sources.ScanFolderPK = :scanfolderid;";
+
+            static const auto s_queryProductBySourcenameScanFolderIdPlatform = MakeSqlQuery(
+                QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_PLATFORM,
+                QUERY_PRODUCT_BY_SOURCENAME_SCANFOLDERID_PLATFORM_STATEMENT,
+                LOG_NAME,
+                SqlParam<const char*>(":sourcename"),
+                SqlParam<const char*>(":platform"),
+                SqlParam<AZ::s64>(":scanfolderid"));
+
             //add sql statement for querying everything by source name
             static const char* QUERY_PRODUCT_LIKE_SOURCENAME = "AzToolsFramework::AssetDatabase::QueryProductLikeSourceName";
             static const char* QUERY_PRODUCT_LIKE_SOURCENAME_STATEMENT =
@@ -1858,7 +1888,9 @@ namespace AzToolsFramework
             AddStatement(m_databaseConnection, s_queryProductLikeProductnamePlatform);
 
             AddStatement(m_databaseConnection, s_queryProductBySourcename);
+            AddStatement(m_databaseConnection, s_queryProductBySourcenameScanFolderId);
             AddStatement(m_databaseConnection, s_queryProductBySourcenamePlatform);
+            AddStatement(m_databaseConnection, s_queryProductBySourcenameScanFolderIdPlatform);
             AddStatement(m_databaseConnection, s_queryProductLikeSourcename);
             AddStatement(m_databaseConnection, s_queryProductLikeSourcenamePlatform);
             AddStatement(m_databaseConnection, s_queryProductByJobIdSubId);
@@ -2265,6 +2297,25 @@ namespace AzToolsFramework
             return s_queryProductBySourcename.BindAndThen(*m_databaseConnection, handler, exactSourceName).Query(&GetProductResult, builderGuid, jobKey, status);
         }
 
+        bool AssetDatabaseConnection::QueryProductBySourceNameScanFolderID(
+            const char* exactSourceName,
+            AZ::s64 scanFolderID,
+            productHandler handler,
+            AZ::Uuid builderGuid,
+            const char* jobKey,
+            const char* platform,
+            AssetSystem::JobStatus status)
+        {
+            if (platform && strlen(platform))
+            {
+                return s_queryProductBySourcenameScanFolderIdPlatform.BindAndThen(*m_databaseConnection, handler, exactSourceName, platform, scanFolderID)
+                    .Query(&GetProductResult, builderGuid, jobKey, status);
+            }
+
+            return s_queryProductBySourcenameScanFolderId.BindAndThen(*m_databaseConnection, handler, exactSourceName, scanFolderID)
+                .Query(&GetProductResult, builderGuid, jobKey, status);
+        }
+
         bool AssetDatabaseConnection::QueryProductLikeSourceName(const char* likeSourceName, LikeType likeType, productHandler handler, AZ::Uuid builderGuid, const char* jobKey, const char* platform, AssetSystem::JobStatus status)
         {
             AZStd::string actualSearchTerm = GetLikeActualSearchTerm(likeSourceName, likeType);

+ 1 - 0
Code/Framework/AzToolsFramework/AzToolsFramework/AssetDatabase/AssetDatabaseConnection.h

@@ -585,6 +585,7 @@ namespace AzToolsFramework
             bool QueryProductLikeProductName(const char* likeProductName, LikeType likeType, productHandler handler, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), const char* jobKey = nullptr, const char* platform = nullptr, AssetSystem::JobStatus status = AssetSystem::JobStatus::Any);
 
             bool QueryProductBySourceName(const char* exactSourceName, productHandler handler, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), const char* jobKey = nullptr, const char* platform = nullptr, AssetSystem::JobStatus status = AssetSystem::JobStatus::Any);
+            bool QueryProductBySourceNameScanFolderID(const char* exactSourceName, AZ::s64 scanFolderID, productHandler handler, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), const char* jobKey = nullptr, const char* platform = nullptr, AssetSystem::JobStatus status = AssetSystem::JobStatus::Any);
             bool QueryProductLikeSourceName(const char* likeSourceName, LikeType likeType, productHandler handler, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), const char* jobKey = nullptr, const char* platform = nullptr, AssetSystem::JobStatus status = AssetSystem::JobStatus::Any);
             bool QueryProductByJobIDSubID(AZ::s64 jobID, AZ::u32 subId, productHandler handler);
 

+ 16 - 0
Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.cpp

@@ -2254,6 +2254,22 @@ namespace AssetProcessor
         return found && succeeded;
     }
 
+    bool AssetDatabaseConnection::GetProductsBySourceNameScanFolderID(QString exactSourceName, AZ::s64 scanFolderId, ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid, QString jobKey, QString platform, JobStatus status)
+    {
+        bool found = false;
+        bool succeeded = QueryProductBySourceNameScanFolderID(exactSourceName.toUtf8().constData(), scanFolderId,
+                [&](ProductDatabaseEntry& product)
+            {
+                found = true;
+                container.emplace_back() = AZStd::move(product);
+                return true; // continue fetching more results.
+            }, builderGuid,
+               jobKey.isEmpty() ? nullptr : jobKey.toUtf8().constData(),
+               platform.isEmpty() ? nullptr : platform.toUtf8().constData(),
+               status);
+        return found && succeeded;
+    }
+
     bool AssetDatabaseConnection::GetProductsLikeSourceName(QString likeSourceName, LikeType likeType, ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid, QString jobKey, QString platform, JobStatus status)
     {
         if (likeSourceName.isEmpty())

+ 1 - 0
Code/Tools/AssetProcessor/native/AssetDatabase/AssetDatabase.h

@@ -135,6 +135,7 @@ namespace AssetProcessor
 
         bool GetProductsBySourceID(AZ::s64 sourceID, AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), QString jobKey = QString(), QString platform = QString(), AzToolsFramework::AssetSystem::JobStatus status = AzToolsFramework::AssetSystem::JobStatus::Any);
         bool GetProductsBySourceName(QString exactSourceName, AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), QString jobKey = QString(), QString platform = QString(), AzToolsFramework::AssetSystem::JobStatus status = AzToolsFramework::AssetSystem::JobStatus::Any);
+        bool GetProductsBySourceNameScanFolderID(QString exactSourceName, AZ::s64 scanFolderId, AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), QString jobKey = QString(), QString platform = QString(), AzToolsFramework::AssetSystem::JobStatus status = AzToolsFramework::AssetSystem::JobStatus::Any);
         bool GetProductsLikeSourceName(QString likeSourceName, LikeType likeType, AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer& container, AZ::Uuid builderGuid = AZ::Uuid::CreateNull(), QString jobKey = QString(), QString platform = QString(), AzToolsFramework::AssetSystem::JobStatus status = AzToolsFramework::AssetSystem::JobStatus::Any);
 
         bool SetProduct(AzToolsFramework::AssetDatabase::ProductDatabaseEntry& entry); //on success sets productID, if it already exists updates it

+ 8 - 6
Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp

@@ -644,7 +644,7 @@ namespace AssetProcessor
         m_sourceUUIDToSourceAssetMap.insert({ sourceUuid, sourceAsset });
 
         //adding legacy source uuid as well
-        m_sourceUUIDToSourceAssetMap.insert({ legacyUuid, sourceAsset });
+            m_sourceUUIDToSourceAssetMap.insert({ legacyUuid, sourceAsset });
 
         m_sourceAssetToSourceUUIDMap.insert({ sourceAsset, sourceUuid });
     }
@@ -660,8 +660,8 @@ namespace AssetProcessor
         }
 
         m_sourceUUIDToSourceAssetMap.erase(sourceUuid);
-        m_sourceUUIDToSourceAssetMap.erase(legacyUuid);
-    }
+            m_sourceUUIDToSourceAssetMap.erase(legacyUuid);
+        }
 
     //////////////////////////////////////////////////////////////////////////
 
@@ -1276,7 +1276,7 @@ namespace AssetProcessor
             }
             else
             {
-                // If we are here it means its a source file, first see whether there is any overriding file and than try to find products
+                // If we are here it means its a source file, first see whether there is any overriding file and then try to find products
                 QString scanFolder;
                 QString relativeName;
                 if (m_platformConfig->ConvertToRelativePath(normalizedSourceOrProductPath, relativeName, scanFolder))
@@ -1293,12 +1293,14 @@ namespace AssetProcessor
                         overridingFile = AssetUtilities::NormalizeFilePath(overridingFile);
                     }
 
-                    if (m_platformConfig->ConvertToRelativePath(overridingFile, relativeName, scanFolder))
+                    const auto* scanFolderInfo = m_platformConfig->GetScanFolderForFile(overridingFile);
+
+                    if (scanFolderInfo && m_platformConfig->ConvertToRelativePath(overridingFile, scanFolderInfo, relativeName))
                     {
                         AZStd::lock_guard<AZStd::mutex> lock(m_databaseMutex);
                         AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer products;
 
-                        if (m_db->GetProductsBySourceName(relativeName, products))
+                        if (m_db->GetProductsBySourceNameScanFolderID(relativeName, scanFolderInfo->ScanFolderID(), products))
                         {
                             resultCode = ConvertDatabaseProductPathToProductFilename(products[0].m_productName, productFileName);
                         }

+ 24 - 28
Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.cpp

@@ -2053,14 +2053,14 @@ namespace AssetProcessor
         }
     }
 
-    void AssetProcessorManager::CheckMissingJobs(QString databasePathToFile, const ScanFolderInfo* scanFolder, const AZStd::vector<JobDetails>& jobsThisTime)
+    void AssetProcessorManager::CheckMissingJobs(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolder, const AZStd::vector<JobDetails>& jobsThisTime)
     {
         // Check to see if jobs were emitted last time by this builder, but are no longer being emitted this time - in which case we must eliminate old products.
         // whats going to be in the database is fingerprints for each job last time
         // this function is called once per source file, so in the array of jobsThisTime,
         // the relative path will always be the same.
 
-        if ((databasePathToFile.length() == 0) && (jobsThisTime.empty()))
+        if (!sourceAsset && jobsThisTime.empty())
         {
             return;
         }
@@ -2070,10 +2070,9 @@ namespace AssetProcessor
         for (const AssetBuilderSDK::PlatformInfo& platformInfo : scanFolder->GetPlatforms())
         {
             QString platform = QString::fromUtf8(platformInfo.m_identifier.c_str());
-            m_stateData->GetJobInfoBySourceNameScanFolderId(databasePathToFile.toUtf8().constData(), scanFolder->ScanFolderID(), jobsFromLastTime, AZ::Uuid::CreateNull(), QString(), platform);
+            m_stateData->GetJobInfoBySourceNameScanFolderId(sourceAsset.RelativePath().c_str(), sourceAsset.ScanFolderId(), jobsFromLastTime, AZ::Uuid::CreateNull(), QString(), platform);
         }
 
-
         // so now we have jobsFromLastTime and jobsThisTime.  Whats in last time that is no longer being emitted now?
         if (jobsFromLastTime.empty())
         {
@@ -2111,7 +2110,7 @@ namespace AssetProcessor
         {
             // ToDo:  Add BuilderUuid here once we do the JobKey feature.
             AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer products;
-            if (m_stateData->GetProductsBySourceName(databasePathToFile, products, oldJobInfo.m_builderGuid, oldJobInfo.m_jobKey.c_str(), oldJobInfo.m_platform.c_str()))
+            if (m_stateData->GetProductsBySourceNameScanFolderID(sourceAsset.RelativePath().c_str(), sourceAsset.ScanFolderId(), products, oldJobInfo.m_builderGuid, oldJobInfo.m_jobKey.c_str(), oldJobInfo.m_platform.c_str()))
             {
                 char tempBuffer[128];
                 oldJobInfo.m_builderGuid.ToString(tempBuffer, AZ_ARRAY_SIZE(tempBuffer));
@@ -2161,7 +2160,7 @@ namespace AssetProcessor
         }
     }
 
-    void AssetProcessorManager::CheckModifiedSourceFile(QString normalizedPath, QString databaseSourceFile, const ScanFolderInfo* scanFolder)
+    void AssetProcessorManager::CheckModifiedSourceFile(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolder)
     {
         // a potential input file was modified or added.  We always pass these through our filters and potentially build it.
         // before we know what to do, we need to figure out if it matches some filter we care about.
@@ -2176,36 +2175,35 @@ namespace AssetProcessor
         //    also queue if products missing.
 
         // Check if this file causes any file types to be re-evaluated
-        CheckMetaDataRealFiles(normalizedPath);
+        CheckMetaDataRealFiles(sourceAsset.AbsolutePath().c_str());
 
         // keep track of its parent folders so that if a folder disappears or is renamed, and we get the notification that this has occurred
         // we will know that it *was* a folder before now (otherwise we'd have no idea)
-        AddKnownFoldersRecursivelyForFile(normalizedPath, scanFolder->ScanPath());
+        AddKnownFoldersRecursivelyForFile(sourceAsset.AbsolutePath().c_str(), sourceAsset.ScanFolderPath().c_str());
 
         ++m_numTotalSourcesFound;
 
         AssetProcessor::BuilderInfoList builderInfoList;
-        EBUS_EVENT(AssetProcessor::AssetBuilderInfoBus, GetMatchingBuildersInfo, normalizedPath.toUtf8().constData(), builderInfoList);
+        EBUS_EVENT(AssetProcessor::AssetBuilderInfoBus, GetMatchingBuildersInfo, sourceAsset.AbsolutePath().c_str(), builderInfoList);
 
         if (builderInfoList.size())
         {
             ++m_numSourcesNeedingFullAnalysis;
-            ProcessBuilders(normalizedPath, databaseSourceFile, scanFolder, builderInfoList);
+            ProcessBuilders(sourceAsset, scanFolder, builderInfoList);
         }
         else
         {
-            CheckMissingJobs(databaseSourceFile.toUtf8().constData(), scanFolder, {});
+            CheckMissingJobs(sourceAsset, scanFolder, {});
 
-            AZ_TracePrintf(AssetProcessor::DebugChannel, "Non-processed file: %s\n", databaseSourceFile.toUtf8().constData());
+            AZ_TracePrintf(AssetProcessor::DebugChannel, "Non-processed file: %s\n", sourceAsset.RelativePath().c_str());
             ++m_numSourcesNotHandledByAnyBuilder;
 
             // Record the modtime for the file so we know we've already processed it
 
-            QString absolutePath = QDir(scanFolder->ScanPath()).absoluteFilePath(normalizedPath);
-            QFileInfo fileInfo(absolutePath);
+            QFileInfo fileInfo(sourceAsset.AbsolutePath().c_str());
             QDateTime lastModifiedTime = fileInfo.lastModified();
 
-            m_stateData->UpdateFileModTimeAndHashByFileNameAndScanFolderId(databaseSourceFile, scanFolder->ScanFolderID(),
+            m_stateData->UpdateFileModTimeAndHashByFileNameAndScanFolderId(sourceAsset.RelativePath().c_str(), sourceAsset.ScanFolderId(),
                 AssetUtilities::AdjustTimestamp(lastModifiedTime),
                 AssetUtilities::GetFileHash(fileInfo.absoluteFilePath().toUtf8().constData()));
         }
@@ -2225,8 +2223,9 @@ namespace AssetProcessor
         {
             // If the fingerprint hasn't changed, we won't process it.. unless...is it missing a product.
             AzToolsFramework::AssetDatabase::ProductDatabaseEntryContainer products;
-            if (m_stateData->GetProductsBySourceName(
+            if (m_stateData->GetProductsBySourceNameScanFolderID(
                     jobDetails.m_jobEntry.m_sourceAssetReference.RelativePath().c_str(),
+                    jobDetails.m_jobEntry.m_sourceAssetReference.ScanFolderId(),
                     products,
                     jobDetails.m_jobEntry.m_builderGuid,
                     jobDetails.m_jobEntry.m_jobKey,
@@ -2932,7 +2931,7 @@ namespace AssetProcessor
                 {
                     // log-spam-reduction - the lack of the prior tag (input was deleted) which is rare can infer that the above branch was taken
                     //AZ_TracePrintf(AssetProcessor::DebugChannel, "Input is modified or is overriding something.\n");
-                    CheckModifiedSourceFile(normalizedPath, sourceAssetReference.RelativePath().c_str(), scanFolderInfo);
+                    CheckModifiedSourceFile(sourceAssetReference, scanFolderInfo);
                 }
             }
         }
@@ -3004,7 +3003,7 @@ namespace AssetProcessor
                     else
                     {
                         // All the jobs of the sourcefile needs to be bundled together to check for missing jobs.
-                        CheckMissingJobs(entry.m_sourceFileInfo.m_sourceAssetReference.RelativePath().c_str(), entry.m_sourceFileInfo.m_scanFolder, entry.m_jobsToAnalyze);
+                        CheckMissingJobs(entry.m_sourceFileInfo.m_sourceAssetReference, entry.m_sourceFileInfo.m_scanFolder, entry.m_jobsToAnalyze);
                         // Update source and job dependency list before forwarding the job to RCController
                         AnalyzeJobDetail(entry);
                     }
@@ -3785,7 +3784,7 @@ namespace AssetProcessor
         return true;
     }
 
-    void AssetProcessorManager::ProcessBuilders(QString normalizedPath, QString databasePathToFile, const ScanFolderInfo* scanFolder, const AssetProcessor::BuilderInfoList& builderInfoList)
+    void AssetProcessorManager::ProcessBuilders(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolder, const AssetProcessor::BuilderInfoList& builderInfoList)
     {
         // this function gets called once for every source file.
         // it is expected to send the file to each builder registered to process that type of file
@@ -3793,10 +3792,7 @@ namespace AssetProcessor
         // it bundles the results up in a JobToProcessEntry struct, while it is doing this:
         JobToProcessEntry entry;
 
-        AZ::Uuid sourceUUID = AssetUtilities::CreateSafeSourceUUIDFromName(databasePathToFile.toUtf8().constData());
-
-        // first, we put the source UUID in the map so that its present for any other queries:
-        SourceAssetReference sourceAsset(scanFolder->ScanPath().toUtf8().constData(), databasePathToFile.toUtf8().constData());
+        AZ::Uuid sourceUUID = AssetUtilities::CreateSafeSourceUUIDFromName(sourceAsset.RelativePath().c_str());
 
         {
             // this scope exists only to narrow the range of m_sourceUUIDToSourceNameMapMutex
@@ -3805,9 +3801,9 @@ namespace AssetProcessor
         }
 
         // insert the new entry into the analysis tracker:
-        auto resultInsert = m_remainingJobsForEachSourceFile.insert_key(normalizedPath.toUtf8().constData());
+        auto resultInsert = m_remainingJobsForEachSourceFile.insert_key(sourceAsset.AbsolutePath().c_str());
         AnalysisTracker& analysisTracker = resultInsert.first->second;
-        analysisTracker.m_databaseSourceName = databasePathToFile.toUtf8().constData();
+        analysisTracker.m_databaseSourceName = sourceAsset.RelativePath().c_str();
         analysisTracker.m_databaseScanFolderId = scanFolder->ScanFolderID();
         analysisTracker.m_buildersInvolved.clear();
         for (const AssetBuilderSDK::AssetBuilderDesc& builderInfo : builderInfoList)
@@ -3887,9 +3883,9 @@ namespace AssetProcessor
                     AssetUtilities::ReadJobLog(resolvedBuffer, response);
                 }
 
-                AutoFailJob(AZStd::string::format("Createjobs Failed: %s.\n", normalizedPath.toUtf8().constData()),
+                AutoFailJob(AZStd::string::format("Createjobs Failed: %s.\n", sourceAsset.AbsolutePath().c_str()),
                             failureMessage,
-                            normalizedPath.toUtf8().constData(),
+                            sourceAsset.AbsolutePath().c_str(),
                             JobEntry(
                                 sourceAsset,
                                 builderInfo.m_busId,
@@ -3995,7 +3991,7 @@ namespace AssetProcessor
 
                         // because we added / created a job for the queue, we increment the number of outstanding jobs for this item now.
                         // when it either later gets analyzed and done, or dropped (because its already up to date), we will decrement it.
-                        UpdateAnalysisTrackerForFile(normalizedPath.toUtf8().constData(), AnalysisTrackerUpdateType::JobStarted);
+                        UpdateAnalysisTrackerForFile(sourceAsset.AbsolutePath().c_str(), AnalysisTrackerUpdateType::JobStarted);
                         m_numOfJobsToAnalyze++;
                     }
                 }

+ 5 - 5
Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h

@@ -262,8 +262,8 @@ namespace AssetProcessor
 
         void SourceDeleted(SourceAssetReference sourceAsset);
         void SourceFolderDeleted(QString folderPath);
-        void SourceQueued(AZ::Uuid sourceUuid, AZ::Uuid legacyUuid, SourceAssetReference sourceAssetReference);
-        void SourceFinished(AZ::Uuid sourceUuid, AZ::Uuid legacyUuid);
+        void SourceQueued(AZ::Uuid sourceUuid, AZStd::unordered_set<AZ::Uuid> legacyUuids, SourceAssetReference sourceAssetReference);
+        void SourceFinished(AZ::Uuid sourceUuid, AZStd::unordered_set<AZ::Uuid> legacyUuids);
         void JobRemoved(AzToolsFramework::AssetSystem::JobInfo jobInfo);
 
         void JobComplete(JobEntry jobEntry, AzToolsFramework::AssetSystem::JobStatus status);
@@ -331,12 +331,12 @@ namespace AssetProcessor
         bool Recv(unsigned int connId, QByteArray payload, R& request);
         void AssessFileInternal(QString fullFile, bool isDelete, bool fromScanner = false);
         void CheckSource(const FileEntry& source);
-        void CheckMissingJobs(QString relativeSourceFile, const ScanFolderInfo* scanFolder, const AZStd::vector<JobDetails>& jobsThisTime);
+        void CheckMissingJobs(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolder, const AZStd::vector<JobDetails>& jobsThisTime);
         void CheckDeletedProductFile(QString normalizedPath);
         void CheckDeletedSourceFile(
             const SourceAssetReference& sourceAsset,
             AZStd::chrono::steady_clock::time_point initialProcessTime);
-        void CheckModifiedSourceFile(QString normalizedPath, QString databaseSourceFile, const ScanFolderInfo* scanFolderInfo);
+        void CheckModifiedSourceFile(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolderInfo);
         bool AnalyzeJob(JobDetails& details);
         void CheckDeletedCacheFolder(QString normalizedPath);
         void CheckDeletedSourceFolder(const SourceAssetReference& sourceAsset);
@@ -367,7 +367,7 @@ namespace AssetProcessor
         void AddKnownFoldersRecursivelyForFile(QString file, QString root);
         void CleanEmptyFolder(QString folder, QString root);
 
-        void ProcessBuilders(QString normalizedPath, QString relativePathToFile, const ScanFolderInfo* scanFolder, const AssetProcessor::BuilderInfoList& builderInfoList);
+        void ProcessBuilders(const SourceAssetReference& sourceAsset, const ScanFolderInfo* scanFolder, const AssetProcessor::BuilderInfoList& builderInfoList);
         AZStd::vector<AZStd::string> GetExcludedFolders();
 
         struct SourceInfoWithFingerprints

+ 1 - 1
Code/Tools/AssetProcessor/native/utilities/assetUtils.cpp

@@ -1466,7 +1466,7 @@ namespace AssetUtilities
 
                 // Note: This call is intentionally re-using the products array.  The new results will be appended to the end (via push_back).
                 // The array will not be cleared.  We're essentially using products as a queue
-                db->GetProductsBySourceName(productPath.GetRelativePath().c_str(), products);
+                db->GetProductsBySourceNameScanFolderID(sources.back().RelativePath().c_str(), sources.back().ScanFolderId(), products);
                 size = products.size(); // Update the loop size since the array grew
             }
         }