RigVM: Avoid type dialog for pins supporting both float and double

#rb sara.schvartzman
#jira na
#preflight https://horde.devtools.epicgames.com/job/63f4b777500c05a6249423c8

[CL 24337789 by Helge Mathee in ue5-main branch]
This commit is contained in:
Helge Mathee
2023-02-21 07:51:04 -05:00
parent 0897beff44
commit ae70e508f4

View File

@@ -16782,6 +16782,46 @@ bool URigVMController::PrepareToLink(URigVMPin* FirstToResolve, URigVMPin* Secon
return false;
}
// reduce matching types by duplicate entries for float / double
{
TArray<TRigVMTypeIndex> FilteredMatchingTypes;
FilteredMatchingTypes.Reserve(MatchingTypes.Num());
for(const TRigVMTypeIndex& MatchingType : MatchingTypes)
{
// special case float singe & array
if(MatchingType == RigVMTypeUtils::TypeIndex::Float)
{
if(MatchingTypes.Contains(RigVMTypeUtils::TypeIndex::Double))
{
continue;
}
}
if(MatchingType == RigVMTypeUtils::TypeIndex::FloatArray)
{
if(MatchingTypes.Contains(RigVMTypeUtils::TypeIndex::DoubleArray))
{
continue;
}
}
bool bAlreadyContainsMatch = false;
for(const TRigVMTypeIndex& FilteredType : FilteredMatchingTypes)
{
if(Registry.CanMatchTypes(MatchingType, FilteredType, true))
{
bAlreadyContainsMatch = true;
break;
}
}
if(bAlreadyContainsMatch)
{
continue;
}
FilteredMatchingTypes.Add(MatchingType);
}
Swap(FilteredMatchingTypes, MatchingTypes);
}
TRigVMTypeIndex FinalType = INDEX_NONE;
if (MatchingTypes.Num() > 1)
{