You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Added automatic content monitoring for all mounted content directories Modifications to source content files that reside inside these folders will now automatically be reimported, if they relate to an asset. New files will also be automatically imported, and deleted files will prompt the user to delete associated assets. The feature is currently disabled by default, and enabled in Editor Preferences / Loading and Saving. Notable features still todo/refine: * Source files rename currently process as a delete/add * Slow task dialogs need work. We can hopefully get it running in the background / asynchronously over multiple frames * Batch operations need work * Profiling/optimisation * Various message boxes/dialogs need some refinement * Asset import factories that are dynamically loaded/unloaded will not be picked up by the import manager. Need to figure out a good way of fixing this. [CL 2419400 by Ben Marsh in Main branch]
76 lines
1.9 KiB
C++
76 lines
1.9 KiB
C++
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "AssetRegistryPCH.h"
|
|
|
|
FBackgroundAssetData::FBackgroundAssetData(const FString& InPackageName, const FString& InPackagePath, const FString& InGroupNames, const FString& InAssetName, const FString& InAssetClass, const TMultiMap<FString, FString>& InTags, const TArray<int32>& InChunkIDs)
|
|
{
|
|
PackageName = InPackageName;
|
|
PackagePath = InPackagePath;
|
|
GroupNames = InGroupNames;
|
|
AssetName = InAssetName;
|
|
AssetClass = InAssetClass;
|
|
TagsAndValues = InTags;
|
|
|
|
ObjectPath = PackageName + TEXT(".");
|
|
|
|
if ( GroupNames.Len() )
|
|
{
|
|
ObjectPath += GroupNames + TEXT(".");
|
|
}
|
|
|
|
ObjectPath += AssetName;
|
|
|
|
ChunkIDs = InChunkIDs;
|
|
}
|
|
|
|
FBackgroundAssetData::FBackgroundAssetData(const FAssetData& InAssetData)
|
|
{
|
|
PackageName = InAssetData.PackageName.ToString();
|
|
PackagePath = InAssetData.PackagePath.ToString();
|
|
GroupNames = InAssetData.GroupNames.ToString();
|
|
AssetName = InAssetData.AssetName.ToString();
|
|
AssetClass = InAssetData.AssetClass.ToString();
|
|
|
|
for ( auto TagIt = InAssetData.TagsAndValues.CreateConstIterator(); TagIt; ++TagIt )
|
|
{
|
|
TagsAndValues.Add(TagIt.Key().ToString(), TagIt.Value());
|
|
}
|
|
|
|
ObjectPath = InAssetData.ObjectPath.ToString();
|
|
|
|
ChunkIDs = InAssetData.ChunkIDs;
|
|
}
|
|
|
|
FAssetData FBackgroundAssetData::ToAssetData() const
|
|
{
|
|
TMap<FName, FString> CopiedTagsAndValues;
|
|
|
|
// Copy over tags and values, retaining unique entries in the map for duplicate names
|
|
TSet<FString> VisitedKeys;
|
|
for (const auto& Pair : TagsAndValues)
|
|
{
|
|
if (VisitedKeys.Find(Pair.Key))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
VisitedKeys.Add(Pair.Key);
|
|
|
|
int32 NameIndex = 0;
|
|
for (auto It = TagsAndValues.CreateConstKeyIterator(Pair.Key); It; ++It, ++NameIndex)
|
|
{
|
|
CopiedTagsAndValues.Add(FName(FName(*It.Key()), NameIndex), *It.Value());
|
|
}
|
|
}
|
|
|
|
return FAssetData(
|
|
FName(*PackageName),
|
|
FName(*PackagePath),
|
|
FName(*GroupNames),
|
|
FName(*AssetName),
|
|
FName(*AssetClass),
|
|
CopiedTagsAndValues,
|
|
ChunkIDs
|
|
);
|
|
}
|