|
@@ -29,78 +29,119 @@ namespace
|
|
|
|
|
|
namespace AssetProcessor
|
|
|
{
|
|
|
-
|
|
|
- void AssetImporterPathsVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view, AZ::SettingsRegistryInterface::Type,
|
|
|
- AZStd::string_view value)
|
|
|
+ struct AssetImporterPathsVisitor
|
|
|
+ : AZ::SettingsRegistryInterface::Visitor
|
|
|
{
|
|
|
- auto found = value.find('.');
|
|
|
- if (found != AZStd::string::npos)
|
|
|
+ AssetImporterPathsVisitor(AZ::SettingsRegistryInterface* settingsRegistry, AZStd::vector<AZStd::string>& supportedExtension)
|
|
|
+ : m_settingsRegistry(settingsRegistry)
|
|
|
+ , m_supportedFileExtensions(supportedExtension)
|
|
|
{
|
|
|
- m_supportedFileExtensions.emplace_back(value.substr(found + 1));
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- m_supportedFileExtensions.emplace_back(value);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- struct PlatformsInfoVisitor
|
|
|
- : AZ::SettingsRegistryInterface::Visitor
|
|
|
- {
|
|
|
- AZ::SettingsRegistryInterface::VisitResponse Traverse(AZStd::string_view jsonPath, AZStd::string_view valueName,
|
|
|
- AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type) override
|
|
|
+ using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
+ void Visit(const AZ::SettingsRegistryInterface::VisitArgs&, AZStd::string_view value) override
|
|
|
{
|
|
|
- constexpr AZStd::string_view PlatformInfoPrefix = "Platform ";
|
|
|
- switch (action)
|
|
|
+ if (auto found = value.find('.'); found != AZStd::string::npos)
|
|
|
{
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::Begin:
|
|
|
- {
|
|
|
- // Only continue traversal if the path is exactly the AssetProcessorSettingsKey (which indicates the start of traversal)
|
|
|
- // or if a "Platform *" object and it's children are being traversed
|
|
|
- if (jsonPath == AssetProcessorSettingsKey)
|
|
|
- {
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
- if (valueName.starts_with(PlatformInfoPrefix))
|
|
|
- {
|
|
|
- // Retrieve the platform name from the rest of valueName portion of the key "Platform (.*)"
|
|
|
- AZStd::string platformIdentifier = valueName.substr(PlatformInfoPrefix.size());
|
|
|
- // Lowercase the platformIdentifier and store it in the stack
|
|
|
- AZStd::to_lower(platformIdentifier.begin(), platformIdentifier.end());
|
|
|
-
|
|
|
- m_platformIdentifierStack.push(AZStd::move(platformIdentifier));
|
|
|
- }
|
|
|
+ m_supportedFileExtensions.emplace_back(value.substr(found + 1));
|
|
|
}
|
|
|
- break;
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::End:
|
|
|
+ else
|
|
|
{
|
|
|
- if (valueName.starts_with(PlatformInfoPrefix))
|
|
|
- {
|
|
|
- AZ_Assert(!m_platformIdentifierStack.empty(), "PlatformInfo stack should not be empty. More stack pops, than pushes");
|
|
|
- m_platformIdentifierStack.pop();
|
|
|
- }
|
|
|
+ m_supportedFileExtensions.emplace_back(value);
|
|
|
}
|
|
|
- break;
|
|
|
+ }
|
|
|
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+ AZ::SettingsRegistryInterface* m_settingsRegistry;
|
|
|
+ AZStd::vector<AZStd::string> m_supportedFileExtensions;
|
|
|
+ };
|
|
|
+
|
|
|
+ //! Visitor for reading the "/Amazon/AssetProcessor/Settings/ScanFolder *" entries from the Settings Registry
|
|
|
+ //! Expects the key to path to the visitor to be "/Amazon/AssetProcessor/Settings"
|
|
|
+ struct ScanFolderVisitor
|
|
|
+ : AZ::SettingsRegistryVisitorUtils::ObjectVisitor
|
|
|
+ {
|
|
|
+ using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs) override;
|
|
|
+
|
|
|
+ struct ScanFolderInfo
|
|
|
+ {
|
|
|
+ AZStd::string m_scanFolderIdentifier;
|
|
|
+ AZStd::string m_scanFolderDisplayName;
|
|
|
+ AZ::IO::Path m_watchPath{ AZ::IO::PosixPathSeparator };
|
|
|
+ AZStd::vector<AZStd::string> m_includeIdentifiers;
|
|
|
+ AZStd::vector<AZStd::string> m_excludeIdentifiers;
|
|
|
+ int m_scanOrder{};
|
|
|
+ bool m_isRecursive{};
|
|
|
+ };
|
|
|
+ AZStd::vector<ScanFolderInfo> m_scanFolderInfos;
|
|
|
+ };
|
|
|
+
|
|
|
+ struct ExcludeVisitor
|
|
|
+ : AZ::SettingsRegistryVisitorUtils::ObjectVisitor
|
|
|
+ {
|
|
|
+ using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs) override;
|
|
|
+
|
|
|
+ AZStd::vector<ExcludeAssetRecognizer> m_excludeAssetRecognizers;
|
|
|
+ };
|
|
|
|
|
|
- return !m_platformIdentifierStack.empty() ? AZ::SettingsRegistryInterface::VisitResponse::Continue
|
|
|
- : AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
+ struct SimpleJobVisitor
|
|
|
+ : AZ::SettingsRegistryVisitorUtils::ObjectVisitor
|
|
|
+ {
|
|
|
+ SimpleJobVisitor(const AZStd::vector<AssetBuilderSDK::PlatformInfo>& enabledPlatforms)
|
|
|
+ : m_enabledPlatforms(enabledPlatforms)
|
|
|
+ {
|
|
|
}
|
|
|
+ using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs) override;
|
|
|
+
|
|
|
+ struct SimpleJobAssetRecognizer
|
|
|
+ {
|
|
|
+ AssetRecognizer m_recognizer;
|
|
|
+ AZStd::string m_defaultParams;
|
|
|
+ bool m_ignore{};
|
|
|
+ };
|
|
|
+ AZStd::vector<SimpleJobAssetRecognizer> m_assetRecognizers;
|
|
|
+ private:
|
|
|
+ void ApplyParamsOverrides(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs,
|
|
|
+ SimpleJobAssetRecognizer& assetRecognizer);
|
|
|
|
|
|
+ const AZStd::vector<AssetBuilderSDK::PlatformInfo>& m_enabledPlatforms;
|
|
|
+ };
|
|
|
+
|
|
|
+ //! This vistor reads in the Asset Cache Server configuration elements from the settings registry
|
|
|
+ struct ACSVisitor
|
|
|
+ : AZ::SettingsRegistryVisitorUtils::ObjectVisitor
|
|
|
+ {
|
|
|
+ using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs) override;
|
|
|
+
|
|
|
+ AZStd::vector<AssetRecognizer> m_assetRecognizers;
|
|
|
+ };
|
|
|
+
|
|
|
+ struct PlatformsInfoVisitor
|
|
|
+ : AZ::SettingsRegistryVisitorUtils::ObjectVisitor
|
|
|
+ {
|
|
|
using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
- void Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value) override
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs) override
|
|
|
{
|
|
|
- if (m_platformIdentifierStack.empty())
|
|
|
+ // Visit any each "Platform *" field that is a direct child of the object at the AssetProcessorSettingsKey
|
|
|
+ constexpr AZStd::string_view PlatformInfoPrefix = "Platform ";
|
|
|
+ if (!visitArgs.m_fieldName.starts_with(PlatformInfoPrefix))
|
|
|
{
|
|
|
- return;
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- if (valueName == "tags")
|
|
|
+ // Retrieve the platform name from the rest of valueName portion of the key "Platform (.*)"
|
|
|
+ AZStd::string platformIdentifier = visitArgs.m_fieldName.substr(PlatformInfoPrefix.size());
|
|
|
+ // Lowercase the platformIdentifier
|
|
|
+ AZStd::to_lower(platformIdentifier.begin(), platformIdentifier.end());
|
|
|
+
|
|
|
+ // Look up the "tags" field that is child of the "Platform (.*)" field
|
|
|
+ using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
|
|
|
+ const auto tagKeyPath = FixedValueString(visitArgs.m_jsonKeyPath) + "/tags";
|
|
|
+ if (AZStd::string tagValue; visitArgs.m_registry.Get(tagValue, tagKeyPath))
|
|
|
{
|
|
|
- AZStd::string_view platformIdentifier = m_platformIdentifierStack.top();
|
|
|
AZStd::unordered_set<AZStd::string> platformTags;
|
|
|
auto JoinTags = [&platformTags](AZStd::string_view token)
|
|
|
{
|
|
@@ -108,23 +149,23 @@ namespace AssetProcessor
|
|
|
AZStd::to_lower(cleanedTag.begin(), cleanedTag.end());
|
|
|
platformTags.insert(AZStd::move(cleanedTag));
|
|
|
};
|
|
|
- AZ::StringFunc::TokenizeVisitor(value, JoinTags, ',');
|
|
|
+ AZ::StringFunc::TokenizeVisitor(tagValue, JoinTags, ',');
|
|
|
m_platformInfos.emplace_back(platformIdentifier, platformTags);
|
|
|
}
|
|
|
+
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
AZStd::vector<AssetBuilderSDK::PlatformInfo> m_platformInfos;
|
|
|
- private:
|
|
|
- AZStd::stack<AZStd::string> m_platformIdentifierStack;
|
|
|
};
|
|
|
|
|
|
struct MetaDataTypesVisitor
|
|
|
: AZ::SettingsRegistryInterface::Visitor
|
|
|
{
|
|
|
using AZ::SettingsRegistryInterface::Visitor::Visit;
|
|
|
- void Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value) override
|
|
|
+ void Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs, AZStd::string_view value) override
|
|
|
{
|
|
|
- m_metaDataTypes.push_back({ AZ::IO::PathView(valueName, AZ::IO::PosixPathSeparator).LexicallyNormal().String(), value });
|
|
|
+ m_metaDataTypes.push_back({ AZ::IO::PathView(visitArgs.m_fieldName, AZ::IO::PosixPathSeparator).LexicallyNormal().String(), value });
|
|
|
}
|
|
|
|
|
|
struct MetaDataType
|
|
@@ -135,193 +176,79 @@ namespace AssetProcessor
|
|
|
AZStd::vector<MetaDataType> m_metaDataTypes;
|
|
|
};
|
|
|
|
|
|
- AZ::SettingsRegistryInterface::VisitResponse ScanFolderVisitor::Traverse(AZStd::string_view jsonPath, AZStd::string_view valueName,
|
|
|
- AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type)
|
|
|
- {
|
|
|
- constexpr AZStd::string_view ScanFolderInfoPrefix = "ScanFolder ";
|
|
|
- switch (action)
|
|
|
- {
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::Begin:
|
|
|
- {
|
|
|
- if (jsonPath == AssetProcessorSettingsKey)
|
|
|
- {
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
- if (valueName.starts_with(ScanFolderInfoPrefix))
|
|
|
- {
|
|
|
- // Retrieve the ScanFolder identifier from "Scan Folder *"
|
|
|
- AZStd::string scanFolderDisplayName = valueName.substr(ScanFolderInfoPrefix.size());
|
|
|
- m_scanFolderStack.push(scanFolderDisplayName);
|
|
|
-
|
|
|
- ScanFolderInfo& scanFolderInfo = m_scanFolderInfos.emplace_back();
|
|
|
- scanFolderInfo.m_scanFolderIdentifier = scanFolderDisplayName;
|
|
|
- scanFolderInfo.m_scanFolderDisplayName = AZStd::move(scanFolderDisplayName);
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::End:
|
|
|
- {
|
|
|
- if (valueName.starts_with(ScanFolderInfoPrefix))
|
|
|
- {
|
|
|
- AZ_Assert(!m_scanFolderStack.empty(), "ScanFolder identifier stack should not be empty. More stack pops, than pushes");
|
|
|
- m_scanFolderStack.pop();
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- return !m_scanFolderStack.empty() ? AZ::SettingsRegistryInterface::VisitResponse::Continue
|
|
|
- : AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
- }
|
|
|
- void ScanFolderVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZ::s64 value)
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse ScanFolderVisitor::Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs)
|
|
|
{
|
|
|
+ constexpr AZStd::string_view ScanFolderInfoPrefix = "ScanFolder ";
|
|
|
// Check if a "ScanFolder *" element is being traversed
|
|
|
- if (m_scanFolderStack.empty())
|
|
|
+ if (!visitArgs.m_fieldName.starts_with(ScanFolderInfoPrefix))
|
|
|
{
|
|
|
- return;
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- AZStd::string_view currentScanFolderIdentifier = m_scanFolderStack.top();
|
|
|
-
|
|
|
- // Find ScanFolder element being iterated over.
|
|
|
- // It should be the last element in ScanFolderInfo vector
|
|
|
- auto scanFolderEntryIt = AZStd::find_if(m_scanFolderInfos.rbegin(), m_scanFolderInfos.rend(),
|
|
|
- [¤tScanFolderIdentifier](const ScanFolderInfo& scanFolderInfo)
|
|
|
- {
|
|
|
- return scanFolderInfo.m_scanFolderIdentifier == currentScanFolderIdentifier;
|
|
|
- });
|
|
|
- if (scanFolderEntryIt == m_scanFolderInfos.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ AZStd::string_view currentScanFolderIdentifier = visitArgs.m_fieldName.substr(ScanFolderInfoPrefix.size());
|
|
|
|
|
|
- ScanFolderInfo& scanFolderEntry = *scanFolderEntryIt;
|
|
|
- if (valueName == "recursive")
|
|
|
- {
|
|
|
- scanFolderEntry.m_isRecursive = value != 0;
|
|
|
- }
|
|
|
- else if (valueName == "order")
|
|
|
- {
|
|
|
- scanFolderEntry.m_scanOrder = static_cast<int>(value);
|
|
|
- }
|
|
|
- }
|
|
|
+ ScanFolderInfo& scanFolderInfo = m_scanFolderInfos.emplace_back();
|
|
|
+ scanFolderInfo.m_scanFolderIdentifier = currentScanFolderIdentifier;
|
|
|
+ scanFolderInfo.m_scanFolderDisplayName = currentScanFolderIdentifier;
|
|
|
|
|
|
- void ScanFolderVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value)
|
|
|
- {
|
|
|
- // Check if a "ScanFolder *" element is being traversed
|
|
|
- if (m_scanFolderStack.empty())
|
|
|
+ using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
|
|
|
+ if (AZ::s64 value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/recursive"))
|
|
|
{
|
|
|
- return;
|
|
|
+ scanFolderInfo.m_isRecursive = value != 0;
|
|
|
}
|
|
|
-
|
|
|
- AZStd::string_view currentScanFolderIdentifier = m_scanFolderStack.top();
|
|
|
-
|
|
|
- // Find ScanFolder element being iterated over.
|
|
|
- // It should be the last element in ScanFolderInfo vector
|
|
|
- auto scanFolderEntryIt = AZStd::find_if(m_scanFolderInfos.rbegin(), m_scanFolderInfos.rend(),
|
|
|
- [¤tScanFolderIdentifier](const ScanFolderInfo& scanFolderInfo)
|
|
|
+ if (AZ::s64 value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/order"))
|
|
|
{
|
|
|
- return scanFolderInfo.m_scanFolderIdentifier == currentScanFolderIdentifier;
|
|
|
- });
|
|
|
- if (scanFolderEntryIt == m_scanFolderInfos.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
+ scanFolderInfo.m_scanOrder = static_cast<int>(value);
|
|
|
}
|
|
|
|
|
|
- ScanFolderInfo& scanFolderEntry = *scanFolderEntryIt;
|
|
|
- if (valueName == "watch")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/watch"))
|
|
|
{
|
|
|
- scanFolderEntry.m_watchPath = value;
|
|
|
+ scanFolderInfo.m_watchPath = value;
|
|
|
}
|
|
|
- else if (valueName == "display" && !value.empty())
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/display")
|
|
|
+ && !value.empty())
|
|
|
{
|
|
|
- scanFolderEntry.m_scanFolderDisplayName = value;
|
|
|
+ scanFolderInfo.m_scanFolderDisplayName = value;
|
|
|
}
|
|
|
- else if (valueName == "include")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/include"))
|
|
|
{
|
|
|
- auto JoinTags = [&scanFolderEntry](AZStd::string_view token)
|
|
|
+ auto JoinTags = [&scanFolderInfo](AZStd::string_view token)
|
|
|
{
|
|
|
- scanFolderEntry.m_includeIdentifiers.push_back(token);
|
|
|
+ scanFolderInfo.m_includeIdentifiers.push_back(token);
|
|
|
};
|
|
|
AZ::StringFunc::TokenizeVisitor(value, JoinTags, ',');
|
|
|
}
|
|
|
- else if (valueName == "exclude")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/exclude"))
|
|
|
{
|
|
|
- auto JoinTags = [&scanFolderEntry](AZStd::string_view token)
|
|
|
+ auto JoinTags = [&scanFolderInfo](AZStd::string_view token)
|
|
|
{
|
|
|
- scanFolderEntry.m_excludeIdentifiers.push_back(token);
|
|
|
+ scanFolderInfo.m_excludeIdentifiers.push_back(token);
|
|
|
};
|
|
|
AZ::StringFunc::TokenizeVisitor(value, JoinTags, ',');
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- AZ::SettingsRegistryInterface::VisitResponse ExcludeVisitor::Traverse(AZStd::string_view jsonPath, AZStd::string_view valueName,
|
|
|
- AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type)
|
|
|
- {
|
|
|
- constexpr AZStd::string_view ExcludeNamePrefix = "Exclude ";
|
|
|
- switch (action)
|
|
|
- {
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::Begin:
|
|
|
- {
|
|
|
- if (jsonPath == AssetProcessorSettingsKey)
|
|
|
- {
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
- if (valueName.starts_with(ExcludeNamePrefix))
|
|
|
- {
|
|
|
- // Extract the substr that is part of the valueName "Exclude *"
|
|
|
- AZStd::string excludeName = valueName.substr(ExcludeNamePrefix.size());
|
|
|
- m_excludeNameStack.push(excludeName);
|
|
|
-
|
|
|
- ExcludeAssetRecognizer& excludeAssetRecognizer = m_excludeAssetRecognizers.emplace_back();
|
|
|
- excludeAssetRecognizer.m_name = QString::fromUtf8(excludeName.c_str(), aznumeric_cast<int>(excludeName.size()));
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::End:
|
|
|
- {
|
|
|
- if (valueName.starts_with(ExcludeNamePrefix))
|
|
|
- {
|
|
|
- AZ_Assert(!m_excludeNameStack.empty(), "Exclude stack should not be empty. More stack pops, than pushes");
|
|
|
- m_excludeNameStack.pop();
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
|
|
|
- return !m_excludeNameStack.empty() ? AZ::SettingsRegistryInterface::VisitResponse::Continue
|
|
|
- : AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- void ExcludeVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value)
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse ExcludeVisitor::Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs)
|
|
|
{
|
|
|
- if (m_excludeNameStack.empty())
|
|
|
+ constexpr AZStd::string_view ExcludeNamePrefix = "Exclude ";
|
|
|
+ if (!visitArgs.m_fieldName.starts_with(ExcludeNamePrefix))
|
|
|
{
|
|
|
- return;
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- AZStd::string_view excludeNameView = m_excludeNameStack.top();
|
|
|
- auto excludeName = QString::fromUtf8(excludeNameView.data(), aznumeric_cast<int>(excludeNameView.size()));
|
|
|
-
|
|
|
- // Find ScanFolder element being iterated over.
|
|
|
- // It should be the last element in ScanFolderInfo vector
|
|
|
- auto excludeAssetRecognizerEntryIt = AZStd::find_if(m_excludeAssetRecognizers.rbegin(), m_excludeAssetRecognizers.rend(),
|
|
|
- [&excludeName](const ExcludeAssetRecognizer& excludeAssetRecognizer)
|
|
|
- {
|
|
|
- return excludeAssetRecognizer.m_name == excludeName;
|
|
|
- });
|
|
|
- if (excludeAssetRecognizerEntryIt == m_excludeAssetRecognizers.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ AZStd::string_view excludeName = visitArgs.m_fieldName.substr(ExcludeNamePrefix.size());
|
|
|
+ ExcludeAssetRecognizer& excludeAssetRecognizer = m_excludeAssetRecognizers.emplace_back();
|
|
|
+ excludeAssetRecognizer.m_name = QString::fromUtf8(excludeName.data(), aznumeric_cast<int>(excludeName.size()));
|
|
|
|
|
|
- ExcludeAssetRecognizer& excludeAssetRecognizer = *excludeAssetRecognizerEntryIt;
|
|
|
|
|
|
// The "pattern" and "glob" entries were previously parsed by QSettings which un-escapes the values
|
|
|
// To compensate for it the AssetProcessorPlatformConfig.ini was escaping the
|
|
@@ -351,7 +278,9 @@ namespace AssetProcessor
|
|
|
return unescapedResult;
|
|
|
};
|
|
|
|
|
|
- if (valueName == "pattern")
|
|
|
+ using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/pattern"))
|
|
|
{
|
|
|
if (!value.empty())
|
|
|
{
|
|
@@ -359,7 +288,8 @@ namespace AssetProcessor
|
|
|
excludeAssetRecognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "glob")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/glob"))
|
|
|
{
|
|
|
if (!excludeAssetRecognizer.m_patternMatcher.IsValid())
|
|
|
{
|
|
@@ -367,147 +297,63 @@ namespace AssetProcessor
|
|
|
excludeAssetRecognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- AZ::SettingsRegistryInterface::VisitResponse SimpleJobVisitor::Traverse(AZStd::string_view jsonPath, AZStd::string_view valueName,
|
|
|
- AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type)
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse SimpleJobVisitor::Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs)
|
|
|
{
|
|
|
constexpr AZStd::string_view RCNamePrefix = "RC "; // RC = Resource Compiler
|
|
|
constexpr AZStd::string_view SJNamePrefix = "SJ "; // SJ = Simple Job
|
|
|
- switch (action)
|
|
|
- {
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::Begin:
|
|
|
- {
|
|
|
- if (jsonPath == AssetProcessorSettingsKey)
|
|
|
- {
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
- if (valueName.starts_with(RCNamePrefix) || valueName.starts_with(SJNamePrefix))
|
|
|
- {
|
|
|
- // Extract the substr that is part of the valueName "Exclude *"
|
|
|
- AZStd::string rcName = valueName.substr(SJNamePrefix.size());
|
|
|
- m_simpleJobNameStack.push(rcName);
|
|
|
|
|
|
- auto& assetRecognizer = m_assetRecognizers.emplace_back();
|
|
|
- assetRecognizer.m_recognizer.m_name = rcName;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::End:
|
|
|
- {
|
|
|
- if (valueName.starts_with(RCNamePrefix) || valueName.starts_with(SJNamePrefix))
|
|
|
- {
|
|
|
- AZ_Assert(!m_simpleJobNameStack.empty(), "SimpleJob name stack should not be empty. More stack pops, than pushes");
|
|
|
- ApplyParamsOverrides(jsonPath);
|
|
|
- m_simpleJobNameStack.pop();
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
-
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- return !m_simpleJobNameStack.empty() ? AZ::SettingsRegistryInterface::VisitResponse::Continue
|
|
|
- : AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
- }
|
|
|
-
|
|
|
- void SimpleJobVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, bool value)
|
|
|
- {
|
|
|
- if (m_simpleJobNameStack.empty())
|
|
|
+ if (!visitArgs.m_fieldName.starts_with(RCNamePrefix) && !visitArgs.m_fieldName.starts_with(SJNamePrefix))
|
|
|
{
|
|
|
- return;
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- AZStd::string_view sjNameView = m_simpleJobNameStack.top();
|
|
|
+ AZStd::string_view sjNameView = visitArgs.m_fieldName.starts_with(SJNamePrefix)
|
|
|
+ ? visitArgs.m_fieldName.substr(SJNamePrefix.size())
|
|
|
+ : visitArgs.m_fieldName.substr(RCNamePrefix.size());
|
|
|
|
|
|
- // Find AssetRecognizer identified by the top entry in the name stack
|
|
|
- auto assetRecognizerEntryIt = AZStd::find_if(m_assetRecognizers.rbegin(), m_assetRecognizers.rend(),
|
|
|
- [&sjNameView](const auto& assetRecognizer)
|
|
|
- {
|
|
|
- return assetRecognizer.m_recognizer.m_name == sjNameView;
|
|
|
- });
|
|
|
- if (assetRecognizerEntryIt == m_assetRecognizers.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ auto& assetRecognizer = m_assetRecognizers.emplace_back();
|
|
|
+ assetRecognizer.m_recognizer.m_name = sjNameView;
|
|
|
|
|
|
- auto& assetRecognizer = *assetRecognizerEntryIt;
|
|
|
- if (valueName == "ignore")
|
|
|
+ using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/ignore"))
|
|
|
{
|
|
|
assetRecognizer.m_ignore = value;
|
|
|
}
|
|
|
- else if (valueName == "lockSource")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/lockSource"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_testLockSource = value;
|
|
|
}
|
|
|
- else if (valueName == "critical")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/critical"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_isCritical = value;
|
|
|
}
|
|
|
- else if (valueName == "checkServer")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/checkServer"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_checkServer = value;
|
|
|
}
|
|
|
- else if (valueName == "supportsCreateJobs")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/supportsCreateJobs"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_supportsCreateJobs = value;
|
|
|
}
|
|
|
- else if (valueName == "outputProductDependencies")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/outputProductDependencies"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_outputProductDependencies = value;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- void SimpleJobVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZ::s64 value)
|
|
|
- {
|
|
|
- if (m_simpleJobNameStack.empty())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- AZStd::string_view sjNameView = m_simpleJobNameStack.top();
|
|
|
-
|
|
|
- // Find AssetRecognizer identified by the top entry in the name stack
|
|
|
- auto assetRecognizerEntryIt = AZStd::find_if(m_assetRecognizers.rbegin(), m_assetRecognizers.rend(),
|
|
|
- [&sjNameView](const auto& assetRecognizer)
|
|
|
- {
|
|
|
- return assetRecognizer.m_recognizer.m_name == sjNameView;
|
|
|
- });
|
|
|
- if (assetRecognizerEntryIt == m_assetRecognizers.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- auto& assetRecognizer = *assetRecognizerEntryIt;
|
|
|
- if (valueName == "priority")
|
|
|
+ if (AZ::s64 value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/priority"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_priority = static_cast<int>(value);
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- void SimpleJobVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value)
|
|
|
- {
|
|
|
- if (m_simpleJobNameStack.empty())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- AZStd::string_view sjNameView = m_simpleJobNameStack.top();
|
|
|
-
|
|
|
-
|
|
|
- // Find AssetRecognizer identified by the top entry in the name stack
|
|
|
- auto assetRecognizerEntryIt = AZStd::find_if(m_assetRecognizers.rbegin(), m_assetRecognizers.rend(),
|
|
|
- [&sjNameView](const SimpleJobAssetRecognizer& assetRecognizer)
|
|
|
- {
|
|
|
- return assetRecognizer.m_recognizer.m_name == sjNameView;
|
|
|
- });
|
|
|
- if (assetRecognizerEntryIt == m_assetRecognizers.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- auto& assetRecognizer = *assetRecognizerEntryIt;
|
|
|
|
|
|
// The "pattern" and "glob" entries were previously parsed by QSettings which un-escapes the values
|
|
|
// To compensate for it the AssetProcessorPlatformConfig.ini was escaping the
|
|
@@ -537,7 +383,8 @@ namespace AssetProcessor
|
|
|
return unescapedResult;
|
|
|
};
|
|
|
|
|
|
- if (valueName == "pattern")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/pattern"))
|
|
|
{
|
|
|
if (!value.empty())
|
|
|
{
|
|
@@ -545,7 +392,8 @@ namespace AssetProcessor
|
|
|
assetRecognizer.m_recognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "glob")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/glob"))
|
|
|
{
|
|
|
// Add the glob pattern if it the matter matcher doesn't already contain a valid regex pattern
|
|
|
if (!assetRecognizer.m_recognizer.m_patternMatcher.IsValid())
|
|
@@ -554,11 +402,13 @@ namespace AssetProcessor
|
|
|
assetRecognizer.m_recognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "version")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/version"))
|
|
|
{
|
|
|
assetRecognizer.m_recognizer.m_version = value;
|
|
|
}
|
|
|
- else if (valueName == "productAssetType")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/productAssetType"))
|
|
|
{
|
|
|
if (!value.empty())
|
|
|
{
|
|
@@ -569,35 +419,18 @@ namespace AssetProcessor
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "params")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/params"))
|
|
|
{
|
|
|
assetRecognizer.m_defaultParams = value;
|
|
|
}
|
|
|
+
|
|
|
+ ApplyParamsOverrides(visitArgs, assetRecognizer);
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
- void SimpleJobVisitor::ApplyParamsOverrides(AZStd::string_view path)
|
|
|
+ void SimpleJobVisitor::ApplyParamsOverrides(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs, SimpleJobAssetRecognizer& assetRecognizer)
|
|
|
{
|
|
|
- if (m_simpleJobNameStack.empty())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- AZStd::string_view sjNameView = m_simpleJobNameStack.top();
|
|
|
-
|
|
|
-
|
|
|
- // Find AssetRecognizer identified by the top entry in the name stack
|
|
|
- auto assetRecognizerEntryIt = AZStd::find_if(m_assetRecognizers.rbegin(), m_assetRecognizers.rend(),
|
|
|
- [&sjNameView](const SimpleJobAssetRecognizer& assetRecognizer)
|
|
|
- {
|
|
|
- return assetRecognizer.m_recognizer.m_name == sjNameView;
|
|
|
- });
|
|
|
- if (assetRecognizerEntryIt == m_assetRecognizers.rend())
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- auto& assetRecognizer = *assetRecognizerEntryIt;
|
|
|
-
|
|
|
/* so in this particular case we want to end up with an AssetPlatformSpec struct that
|
|
|
has only got the platforms that 'matter' in it
|
|
|
so for example, if you have the following enabled platforms
|
|
@@ -643,12 +476,12 @@ namespace AssetProcessor
|
|
|
AZStd::string_view currentParams = assetRecognizer.m_defaultParams;
|
|
|
// The "/Amazon/AssetProcessor/Settings/SJ */<platform>" entry will be queried
|
|
|
AZ::IO::Path overrideParamsKey = AZ::IO::Path(AZ::IO::PosixPathSeparator);
|
|
|
- overrideParamsKey /= path;
|
|
|
+ overrideParamsKey /= visitArgs.m_jsonKeyPath;
|
|
|
overrideParamsKey /= platform.m_identifier;
|
|
|
|
|
|
AZ::SettingsRegistryInterface::FixedValueString overrideParamsValue;
|
|
|
// Check if the enabled platform identifier matches a key within the "SJ *" object
|
|
|
- if (m_registry.Get(overrideParamsValue, overrideParamsKey.Native()))
|
|
|
+ if (visitArgs.m_registry.Get(overrideParamsValue, overrideParamsKey.Native()))
|
|
|
{
|
|
|
currentParams = overrideParamsValue;
|
|
|
}
|
|
@@ -658,7 +491,7 @@ namespace AssetProcessor
|
|
|
for (const AZStd::string& tag : platform.m_tags)
|
|
|
{
|
|
|
overrideParamsKey.ReplaceFilename(AZ::IO::PathView(tag));
|
|
|
- if (m_registry.Get(overrideParamsValue, overrideParamsKey.Native()))
|
|
|
+ if (visitArgs.m_registry.Get(overrideParamsValue, overrideParamsKey.Native()))
|
|
|
{
|
|
|
// if we get here it means we found a tag that applies to this platform
|
|
|
currentParams = overrideParamsValue;
|
|
@@ -675,115 +508,50 @@ namespace AssetProcessor
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Find the current AssetRecognizer identified by the top entry in the name stack
|
|
|
- AssetRecognizer* ACSVisitor::CurrentAssetRecognizer()
|
|
|
- {
|
|
|
- if (m_nameStack.empty())
|
|
|
- {
|
|
|
- return nullptr;
|
|
|
- }
|
|
|
-
|
|
|
- auto& nameView = m_nameStack.top();
|
|
|
-
|
|
|
- auto assetRecognizerEntryIt = AZStd::find_if(m_assetRecognizers.rbegin(), m_assetRecognizers.rend(),
|
|
|
- [&nameView](const AssetRecognizer& assetRecognizer)
|
|
|
- {
|
|
|
- return assetRecognizer.m_name == nameView;
|
|
|
- });
|
|
|
- if (assetRecognizerEntryIt == m_assetRecognizers.rend())
|
|
|
- {
|
|
|
- return nullptr;
|
|
|
- }
|
|
|
- return &(*assetRecognizerEntryIt);
|
|
|
- }
|
|
|
-
|
|
|
- AZ::SettingsRegistryInterface::VisitResponse ACSVisitor::Traverse(AZStd::string_view jsonPath, AZStd::string_view valueName,
|
|
|
- AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type)
|
|
|
+ AZ::SettingsRegistryInterface::VisitResponse ACSVisitor::Visit(const AZ::SettingsRegistryInterface::VisitArgs& visitArgs)
|
|
|
{
|
|
|
constexpr AZStd::string_view ACSNamePrefix = "ACS ";
|
|
|
- switch (action)
|
|
|
- {
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::Begin:
|
|
|
+ if (!visitArgs.m_fieldName.starts_with(ACSNamePrefix))
|
|
|
{
|
|
|
- if (jsonPath == AssetProcessorServerKey)
|
|
|
- {
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
- if (valueName.starts_with(ACSNamePrefix))
|
|
|
- {
|
|
|
- AZStd::string name = valueName.substr(ACSNamePrefix.size());
|
|
|
- m_nameStack.push(name);
|
|
|
-
|
|
|
- AssetRecognizer& assetRecognizer = m_assetRecognizers.emplace_back();
|
|
|
- assetRecognizer.m_name = name;
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case AZ::SettingsRegistryInterface::VisitAction::End:
|
|
|
- {
|
|
|
- if (valueName.starts_with(ACSNamePrefix))
|
|
|
- {
|
|
|
- AZ_Assert(!m_nameStack.empty(), "Name stack should not be empty. More stack pops, than pushes");
|
|
|
- m_nameStack.pop();
|
|
|
- }
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
- break;
|
|
|
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
+ AZStd::string name = visitArgs.m_fieldName.substr(ACSNamePrefix.size());
|
|
|
|
|
|
- return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
|
|
- }
|
|
|
+ AssetRecognizer& assetRecognizer = m_assetRecognizers.emplace_back();
|
|
|
+ assetRecognizer.m_name = name;
|
|
|
|
|
|
- void ACSVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, bool value)
|
|
|
- {
|
|
|
- auto* assetRecognizer = CurrentAssetRecognizer();
|
|
|
- if (!assetRecognizer)
|
|
|
+ using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString;
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/lockSource"))
|
|
|
{
|
|
|
- return;
|
|
|
+ assetRecognizer.m_testLockSource = value;
|
|
|
}
|
|
|
- else if (valueName == "lockSource")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/critical"))
|
|
|
{
|
|
|
- assetRecognizer->m_testLockSource = value;
|
|
|
+ assetRecognizer.m_isCritical = value;
|
|
|
}
|
|
|
- else if (valueName == "critical")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/checkServer"))
|
|
|
{
|
|
|
- assetRecognizer->m_isCritical = value;
|
|
|
+ assetRecognizer.m_checkServer = value;
|
|
|
}
|
|
|
- else if (valueName == "checkServer")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/supportsCreateJobs"))
|
|
|
{
|
|
|
- assetRecognizer->m_checkServer = value;
|
|
|
+ assetRecognizer.m_supportsCreateJobs = value;
|
|
|
}
|
|
|
- else if (valueName == "supportsCreateJobs")
|
|
|
+ if (bool value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/outputProductDependencies"))
|
|
|
{
|
|
|
- assetRecognizer->m_supportsCreateJobs = value;
|
|
|
+ assetRecognizer.m_outputProductDependencies = value;
|
|
|
}
|
|
|
- else if (valueName == "outputProductDependencies")
|
|
|
- {
|
|
|
- assetRecognizer->m_outputProductDependencies = value;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- void ACSVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZ::s64 value)
|
|
|
- {
|
|
|
- auto* assetRecognizer = CurrentAssetRecognizer();
|
|
|
- if (!assetRecognizer)
|
|
|
+ if (AZ::s64 value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/priority"))
|
|
|
{
|
|
|
- return;
|
|
|
- }
|
|
|
- else if (valueName == "priority")
|
|
|
- {
|
|
|
- assetRecognizer->m_priority = aznumeric_cast<int>(value);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- void ACSVisitor::Visit([[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, AZStd::string_view value)
|
|
|
- {
|
|
|
- auto* assetRecognizer = CurrentAssetRecognizer();
|
|
|
- if (!assetRecognizer)
|
|
|
- {
|
|
|
- return;
|
|
|
+ assetRecognizer.m_priority = aznumeric_cast<int>(value);
|
|
|
}
|
|
|
|
|
|
// The "pattern" and "glob" entries were previously parsed by QSettings which un-escapes the values
|
|
@@ -814,38 +582,44 @@ namespace AssetProcessor
|
|
|
return unescapedResult;
|
|
|
};
|
|
|
|
|
|
- if (valueName == "pattern")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/pattern"))
|
|
|
{
|
|
|
if (!value.empty())
|
|
|
{
|
|
|
const auto patternType = AssetBuilderSDK::AssetBuilderPattern::Regex;
|
|
|
- assetRecognizer->m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
+ assetRecognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "glob")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/glob"))
|
|
|
{
|
|
|
// Add the glob pattern if it the matter matcher doesn't already contain a valid regex pattern
|
|
|
- if (!assetRecognizer->m_patternMatcher.IsValid())
|
|
|
+ if (!assetRecognizer.m_patternMatcher.IsValid())
|
|
|
{
|
|
|
const auto patternType = AssetBuilderSDK::AssetBuilderPattern::Wildcard;
|
|
|
- assetRecognizer->m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
+ assetRecognizer.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher(UnescapePattern(value), patternType);
|
|
|
}
|
|
|
}
|
|
|
- else if (valueName == "version")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/version"))
|
|
|
{
|
|
|
- assetRecognizer->m_version = value;
|
|
|
+ assetRecognizer.m_version = value;
|
|
|
}
|
|
|
- else if (valueName == "productAssetType")
|
|
|
+ if (AZStd::string value;
|
|
|
+ visitArgs.m_registry.Get(value, FixedValueString(visitArgs.m_jsonKeyPath) + "/productAssetType"))
|
|
|
{
|
|
|
if (!value.empty())
|
|
|
{
|
|
|
AZ::Uuid productAssetType{ value.data(), value.size() };
|
|
|
if (!productAssetType.IsNull())
|
|
|
{
|
|
|
- assetRecognizer->m_productAssetType = productAssetType;
|
|
|
+ assetRecognizer.m_productAssetType = productAssetType;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ return AZ::SettingsRegistryInterface::VisitResponse::Skip;
|
|
|
}
|
|
|
|
|
|
const char AssetConfigPlatformDir[] = "AssetProcessorConfig/";
|
|
@@ -1488,7 +1262,7 @@ namespace AssetProcessor
|
|
|
m_excludeAssetRecognizers[excludeRecognizer.m_name] = AZStd::move(excludeRecognizer);
|
|
|
}
|
|
|
|
|
|
- SimpleJobVisitor simpleJobVisitor(*settingsRegistry, m_enabledPlatforms);
|
|
|
+ SimpleJobVisitor simpleJobVisitor(m_enabledPlatforms);
|
|
|
settingsRegistry->Visit(simpleJobVisitor, AssetProcessorSettingsKey);
|
|
|
for (auto&& sjRecognizer : simpleJobVisitor.m_assetRecognizers)
|
|
|
{
|