You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb ryan.schmidt jimmy.andrews semion.piskarev #jira none #rnx [CL 15677067 by lonnie li in ue5-main branch]
40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#include "MultiSelectionTool.h"
|
|
#include "TargetInterfaces/AssetBackedTarget.h"
|
|
|
|
bool UMultiSelectionTool::GetMapToSharedSourceData(TArray<int32>& MapToFirstOccurrences)
|
|
{
|
|
bool bSharesSources = false;
|
|
MapToFirstOccurrences.SetNumUninitialized(Targets.Num());
|
|
for (int32 ComponentIdx = 0; ComponentIdx < Targets.Num(); ComponentIdx++)
|
|
{
|
|
MapToFirstOccurrences[ComponentIdx] = -1;
|
|
}
|
|
for (int32 ComponentIdx = 0; ComponentIdx < Targets.Num(); ComponentIdx++)
|
|
{
|
|
if (MapToFirstOccurrences[ComponentIdx] >= 0) // already mapped
|
|
{
|
|
continue;
|
|
}
|
|
|
|
MapToFirstOccurrences[ComponentIdx] = ComponentIdx;
|
|
|
|
IAssetBackedTarget* Target = Cast<IAssetBackedTarget>(Targets[ComponentIdx]);
|
|
if (!Target)
|
|
{
|
|
continue;
|
|
}
|
|
for (int32 VsIdx = ComponentIdx + 1; VsIdx < Targets.Num(); VsIdx++)
|
|
{
|
|
IAssetBackedTarget* OtherTarget = Cast<IAssetBackedTarget>(Targets[VsIdx]);
|
|
if (OtherTarget && OtherTarget->GetSourceData() == Target->GetSourceData())
|
|
{
|
|
bSharesSources = true;
|
|
MapToFirstOccurrences[VsIdx] = ComponentIdx;
|
|
}
|
|
}
|
|
}
|
|
return bSharesSources;
|
|
}
|
|
|