Refactor use of OrderOnce for materials to limit to materialtype dependencies only.

Signed-off-by: Robin <rbarrand@amazon.com>
This commit is contained in:
Robin
2021-09-21 12:17:33 -07:00
parent 0ed82e21d5
commit b78e41f5a8
2 changed files with 34 additions and 23 deletions
@@ -44,7 +44,7 @@ namespace AZ
if (auto* serialize = azrtti_cast<SerializeContext*>(context))
{
serialize->Class<MaterialAssetDependenciesComponent, Component>()
->Version(4)
->Version(5)
->Attribute(Edit::Attributes::SystemComponentTags, AZStd::vector<Crc32>({ AssetBuilderSDK::ComponentTags::AssetBuilder }));
}
}
@@ -88,6 +88,8 @@ namespace AZ
jobDependency.m_sourceFile = materialTypeSource;
jobDependency.m_platformIdentifier = platformIdentifier;
// If includeMaterialPropertyNames is true, then we need materials to depend on materialtype only once in order to get
// the property names. After the initial processing, materials will no longer be dependent on materialtype files.
bool includeMaterialPropertyNames = true;
RPI::MaterialConverterBus::BroadcastResult(includeMaterialPropertyNames, &RPI::MaterialConverterBus::Events::ShouldIncludeMaterialPropertyNames);
jobDependency.m_type = includeMaterialPropertyNames ? AssetBuilderSDK::JobDependencyType::OrderOnce : AssetBuilderSDK::JobDependencyType::Order;