We’re having issues with some Mirror Data Table curves not mirroring correctly when using the Metahuman Face Archetype Skeleton.
Typically located here: /Game/MetaHumans/Common/Face/Face_Archetype_Skeleton.Face_Archetype_Skeleton.
Most curves ending in non _L or _R (example _UL/_UR) aren’t being mirrored properly despite the replace rule being in place.
[Image Removed]
The Left/Right expressions not following an underscore aren’t being mirrored properly despite the replace rule being in place.
[Image Removed]Some of the Skeleton’s CTRL_ curves are missing.
[Image Removed]
Note: Ticket was entered at the request of Paulo Souza as this was deemed not to be specific to Metah
[Attachment Removed]
Hi Tania,
Thanks for the patience and for reaching out. Additionally, I appreciate the detailed repro steps - these always make it easier to get to the root of the problem.
I’ve reproduced the issue and I’m working on a fix for this. I’ll share a public ticket soon to track this and/or CL which fixes the issue.
Best,
- RM
[Attachment Removed]
Hi Tania,
Big thanks for the patience on this ticket, I was out in vacation and was not able to take a look at this issue before being OOO!
First, there is an issue in the way you’ve constructed the Find Replace Expressions shared, in that the expression number 24 is a catch all and will always be a valid pattern match preventing any rules after it from executing, to avoid this please make this replace expression be the last one. In general, it is recommended to go from specific to broad as the fist match in a find/replace expression halts any further matching, therefore specific suffix/prefix matches should be first that the catch all find / replace expressions.
Here is the expression causing the issue due to where its located within the array:
[Image Removed]
Secondly, there is an issue with the MDT failing to properly match the suffix/prefix here is the local fix I have for this issue. Please look at the already shared public JIRA ticket to follow progress for when the makes it into next engine release (UE-328809).
FName UMirrorDataTable::GetMirrorName(FName InName, const TArray<FMirrorFindReplaceExpression>& MirrorFindReplaceExpressions)
{
FName ReplacedName;
FString InNameString = InName.ToString();
bool bFound = false;
for (const FMirrorFindReplaceExpression& regExStr : MirrorFindReplaceExpressions)
{
FString FindString = regExStr.FindExpression.ToString();
FString ReplaceString = regExStr.ReplaceExpression.ToString();
switch (regExStr.FindReplaceMethod)
{
case EMirrorFindReplaceMethod::Prefix:
if (InNameString.StartsWith(FindString, ESearchCase::CaseSensitive))
{
ReplaceString = ReplaceString + InNameString.Mid(FindString.Len());
bFound = true;
}
break;
case EMirrorFindReplaceMethod::Suffix:
if (InNameString.EndsWith(FindString, ESearchCase::CaseSensitive))
{
ReplaceString = InNameString.LeftChop(FindString.Len()) + ReplaceString;
bFound = true;
}
break;
case EMirrorFindReplaceMethod::RegularExpression:
FRegexPattern MatherPatter(FindString);
FRegexMatcher Matcher(MatherPatter, InNameString);
while (Matcher.FindNext())
{
for (int32 CaptureIndex = 1; CaptureIndex < 10; CaptureIndex++)
{
FString CaptureResult = Matcher.GetCaptureGroup(CaptureIndex);
int32 CaptureBegin = Matcher.GetCaptureGroupBeginning(CaptureIndex);
int32 CaptureEnd = Matcher.GetCaptureGroupEnding(CaptureIndex);
FString CaptureRegion = CaptureResult.Mid(CaptureBegin, CaptureEnd - CaptureBegin);
if (CaptureResult.IsEmpty())
{
break;
}
FString MatchString = FString::Printf(TEXT("$%i"), CaptureIndex);
ReplaceString = ReplaceString.Replace(*MatchString, *CaptureResult);
}
bFound = true;
}
break;
}
// We found a match. Stop pattern matching.
if (bFound)
{
ReplacedName = *ReplaceString;
break;
}
}
return ReplacedName;
}
In general, I’m working to provide all the regular expressions in an out the box MDT table to ensure mirroring works with MetaHumans without any extra work, but this is still work in progress and may take some time to make it to an engine release.
Anything else, please let me know!
Best,
- RM
[Attachment Removed]
Hi Tania, thanks for you’re help. I’ve marked the Jira ticket as public, it can take up to 24hrs to be available: Unreal Engine Issues and Bug Tracker (UE\-328809\). Thanks!
[Attachment Removed]
Sound good, thanks Roland.
[Attachment Removed]
Hello Roland,
Great to know about the top to bottom ordering of the replace expressions. I’ll keep that in mind for the future.
Thanks for sharing the existing ticket. Seems I don’t seem to have access to it though.
However, I can keep an eye out on the release notes as new engine versions come out. So it’s not a concern.
Having the regular expressions work without any extra work for MetaHumans is something I am sure would be a great addition to have but there’s definitely no rush on that.
Thank you for your detailed response!
Very much appreciated.
[Attachment Removed]