You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-69759 #rb Jamie.Dale #ROBOMERGE-OWNER: lina.halper #ROBOMERGE-AUTHOR: lauren.ridge #ROBOMERGE-SOURCE: CL 4963057 in //UE4/Release-4.22/... via CL 4968554 #ROBOMERGE-BOT: ANIM (Main -> Dev-Anim) [CL 5027793 by lauren ridge in Dev-Anim branch]
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AdvancedCopyCustomization.h"
|
|
#include "Containers/UnrealString.h"
|
|
#include "AssetRegistryModule.h"
|
|
#include "Interfaces/IPluginManager.h"
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "AdvancedCopyCustomization"
|
|
|
|
|
|
UAdvancedCopyCustomization::UAdvancedCopyCustomization(const class FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
, bShouldGenerateRelativePaths(true)
|
|
{
|
|
FilterForExcludingDependencies.PackagePaths.Add(TEXT("/Engine"));
|
|
for (TSharedRef<IPlugin>& Plugin : IPluginManager::Get().GetDiscoveredPlugins())
|
|
{
|
|
if (Plugin->GetType() != EPluginType::Project)
|
|
{
|
|
FilterForExcludingDependencies.PackagePaths.Add(FName(*("/" + Plugin->GetName())));
|
|
}
|
|
}
|
|
|
|
FilterForExcludingDependencies.bRecursivePaths = true;
|
|
FilterForExcludingDependencies.bRecursiveClasses = true;
|
|
}
|
|
|
|
void UAdvancedCopyCustomization::SetPackageThatInitiatedCopy(const FString& InBasePackage)
|
|
{
|
|
FString TempPackage = InBasePackage;
|
|
|
|
FAssetRegistryModule& AssetRegistryModule = FModuleManager::Get().LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
|
|
TArray<FAssetData> DependencyAssetData;
|
|
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
|
|
AssetRegistry.GetAssetsByPackageName(FName(*InBasePackage), DependencyAssetData);
|
|
// We found a folder
|
|
if (DependencyAssetData.Num() == 0)
|
|
{
|
|
// Take off the name of the folder we copied so copied files are still nested
|
|
TempPackage.Split(TEXT("/"), &TempPackage, nullptr, ESearchCase::IgnoreCase, ESearchDir::FromEnd);
|
|
}
|
|
|
|
if (!TempPackage.EndsWith(TEXT("/")))
|
|
{
|
|
TempPackage += TEXT("/");
|
|
}
|
|
PackageThatInitiatedCopy = TempPackage;
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|