You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
UETOOL-332 - Collections 2.0 UETOOL-369 - Want nested collections with collapsing We now have version 2 collections which maintain a persistent GUID for each collection. Existing collections will be lazily updated to this version when they need to be re-saved. This GUID is used by child collections to keep track their parents, and the collections view (as well as the quick asset management) now show a tree of collections. Collections in the main collection view tree can be re-parented via drag and drop. Performing Content Browser searches against a given collection will also test to see if an object exists in child collections, and the asset view will now show you folder entries for child collections when viewing a parent (if folders are enabled in your Content Browser view settings). [CL 2593321 by Jamie Dale in Main branch]
44 lines
1.4 KiB
C
44 lines
1.4 KiB
C
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
struct FSourcesData
|
|
{
|
|
TArray<FName> PackagePaths;
|
|
TArray<FCollectionNameType> Collections;
|
|
|
|
bool IsEmpty() const
|
|
{
|
|
return PackagePaths.Num() == 0 && Collections.Num() == 0;
|
|
}
|
|
|
|
FARFilter MakeFilter(bool bRecurse, bool bUsingFolders) const
|
|
{
|
|
FARFilter Filter;
|
|
|
|
// Package Paths
|
|
Filter.PackagePaths = PackagePaths;
|
|
Filter.bRecursivePaths = bRecurse || !bUsingFolders;
|
|
|
|
// Collections
|
|
TArray<FName> ObjectPathsFromCollections;
|
|
if ( Collections.Num() && FCollectionManagerModule::IsModuleAvailable() )
|
|
{
|
|
// Collection manager module should already be loaded since it may cause a hitch on the first search
|
|
FCollectionManagerModule& CollectionManagerModule = FCollectionManagerModule::GetModule();
|
|
|
|
// Include objects from child collections if we're recursing
|
|
const ECollectionRecursionFlags::Flags CollectionRecursionMode = (Filter.bRecursivePaths) ? ECollectionRecursionFlags::SelfAndChildren : ECollectionRecursionFlags::Self;
|
|
|
|
for ( int32 CollectionIdx = 0; CollectionIdx < Collections.Num(); ++CollectionIdx )
|
|
{
|
|
// Find the collection
|
|
const FCollectionNameType& CollectionNameType = Collections[CollectionIdx];
|
|
CollectionManagerModule.Get().GetObjectsInCollection(CollectionNameType.Name, CollectionNameType.Type, ObjectPathsFromCollections, CollectionRecursionMode);
|
|
}
|
|
}
|
|
Filter.ObjectPaths = ObjectPathsFromCollections;
|
|
|
|
return Filter;
|
|
}
|
|
}; |