Add a wildcard source dependecy to the scene builder for wrinklemasks

This commit is contained in:
Tommy Walton
2021-04-23 16:04:17 -07:00
parent fb26308a26
commit 991fb071a5
@@ -98,7 +98,7 @@ namespace SceneBuilder
descriptor.m_jobKey = "Scene compilation";
descriptor.SetPlatformIdentifier(enabledPlatform.m_identifier.c_str());
descriptor.m_failOnError = true;
descriptor.m_priority = 11; // more important than static mesh files, since these may control logic (actors and motions specifically)
descriptor.m_priority = 11; // these may control logic (actors and motions specifically)
descriptor.m_additionalFingerprintInfo = GetFingerprint();
AZ::SceneAPI::SceneBuilderDependencyBus::Broadcast(&AZ::SceneAPI::SceneBuilderDependencyRequests::ReportJobDependencies,
@@ -107,11 +107,17 @@ namespace SceneBuilder
response.m_createJobOutputs.push_back(descriptor);
}
// Adding corresponding material file as a source file dependency
// Adding corresponding _wrinklemask folder as a source file dependency
// This enables morph target assets to get references to the wrinkle masks
// in the MorphTargetExporter, so they can be automatically applied at runtime
AssetBuilderSDK::SourceFileDependency sourceFileDependencyInfo;
AZStd::string relPath = request.m_sourceFile.c_str();
AzFramework::StringFunc::Path::ReplaceExtension(relPath, "mtl");
AzFramework::StringFunc::Path::StripExtension(relPath);
relPath += "_wrinklemasks";
AzFramework::StringFunc::Path::AppendSeparator(relPath);
relPath += "*_wrinklemask.*";
sourceFileDependencyInfo.m_sourceFileDependencyPath = relPath;
sourceFileDependencyInfo.m_sourceDependencyType = AssetBuilderSDK::SourceFileDependency::SourceFileDependencyType::Wildcards;
response.m_sourceFileDependencyList.push_back(sourceFileDependencyInfo);
response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success;