فهرست منبع

Add intermediate asset scanfolder

Signed-off-by: amzn-mike <[email protected]>
amzn-mike 3 سال پیش
والد
کامیت
8983ab6e81

+ 30 - 0
Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.cpp

@@ -812,6 +812,9 @@ namespace AssetProcessor
             }
             }
             return IsValid();
             return IsValid();
         }
         }
+
+        AddIntermediateScanFolder();
+
         if (!noGemScanFolders && addGemsConfigs)
         if (!noGemScanFolders && addGemsConfigs)
         {
         {
             if (settingsRegistry == nullptr || !AzFramework::GetGemsInfo(m_gemInfoList, *settingsRegistry))
             if (settingsRegistry == nullptr || !AzFramework::GetGemsInfo(m_gemInfoList, *settingsRegistry))
@@ -1652,6 +1655,33 @@ namespace AssetProcessor
         return m_maxJobs;
         return m_maxJobs;
     }
     }
 
 
+    void PlatformConfiguration::AddIntermediateScanFolder()
+    {
+        auto settingsRegistry = AZ::SettingsRegistry::Get();
+        AZ::SettingsRegistryInterface::FixedValueString cacheRootFolder;
+        settingsRegistry->Get(cacheRootFolder, AZ::SettingsRegistryMergeUtils::FilePathKey_CacheProjectRootFolder);
+
+        AZ::IO::Path scanfolderPath = cacheRootFolder.c_str();
+        scanfolderPath /= IntermediateAssetsFolderName;
+
+        AZStd::vector<AssetBuilderSDK::PlatformInfo> platforms;
+        PopulatePlatformsForScanFolder(platforms);
+
+        // By default the project scanfolder is recursive with an order of 0
+        // The intermediate assets folder needs to be higher priority since its a subfolder (otherwise GetScanFolderForFile won't pick the right scanfolder)
+        constexpr int order = -1;
+
+        AddScanFolder(ScanFolderInfo{
+            scanfolderPath.c_str(),
+            "Intermediate Assets",
+            "Intermediate Assets",
+            false,
+            true,
+            platforms,
+            order
+        });
+    }
+
     void PlatformConfiguration::AddGemScanFolders(const AZStd::vector<AzFramework::GemInfo>& gemInfoList)
     void PlatformConfiguration::AddGemScanFolders(const AZStd::vector<AzFramework::GemInfo>& gemInfoList)
     {
     {
         int gemOrder = g_gemStartingOrder;
         int gemOrder = g_gemStartingOrder;

+ 1 - 0
Code/Tools/AssetProcessor/native/utilities/PlatformConfiguration.h

@@ -246,6 +246,7 @@ namespace AssetProcessor
         //! Gets the minumum jobs specified in the configuration file
         //! Gets the minumum jobs specified in the configuration file
         int GetMinJobs() const;
         int GetMinJobs() const;
         int GetMaxJobs() const;
         int GetMaxJobs() const;
+        void AddIntermediateScanFolder();
 
 
         //! Return how many scan folders there are
         //! Return how many scan folders there are
         int GetScanFolderCount() const;
         int GetScanFolderCount() const;