# How to get reference to selected assets in content browser?

**URL:** <https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [December 13, 2016, 9:01pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533 "2016-12-13T21:01:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [December 13, 2016, 9:01pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/1 "2016-12-13T21:01:47Z")

</div>

Hi all,  
I want to get a reference to a selected asset in the Content Browser, not a selected actor in the World Outliner.  
Is there a way to do that in Blueprints, or do I need to write a custom c++ function?

I need to mass-assign a material to selected Static Mesh Actors in the Content Browser, but the Bulk Property Matrix doesn’t have a Material setting, so I want to create a blutility that lets me do that.

Thanks in advance for your help!

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [December 13, 2016, 9:05pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/2 "2016-12-13T21:05:29Z")

</div>

You should be able to simply create a custom variable for your asset in the graph for your static meshes then simply use that variable where it’s needed.  
Have you tried doing that?

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [December 13, 2016, 9:07pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/3 "2016-12-13T21:07:06Z")

</div>

Just to reiterate, this documentation should hopefully help you:

> **[Referencing Assets](https://docs.unrealengine.com/5.1/en-US/referencing-assets-in-unreal-engine/)**
>
> Control how an asset is referenced and loaded into memory.

---

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [December 13, 2016, 9:57pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/4 "2016-12-13T21:57:02Z")

</div>

Hey TrojanVirus,  
thanks for the reply and suggestions.

I need to assign a material to all selected assets in the Content Browser, so creating a custom array variable isn’t ideal, as I would have to assign each asset I want to update 1 by 1 to the array. There is a Blueprint function called GetSelectionSet, which returns an array of all selected Actors in the Editor/World Outliner, but I need to return all selected Assets from the Content Browser instead.

Any other suggestions?

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [December 13, 2016, 10:29pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/5 "2016-12-13T22:29:09Z")

</div>

I don’t know of a specific node that does this. How many assets are we talking here? Sounds like a lot.

---

<div class="post-metadata">

**Author:** ![TroJanVirusLive](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TroJanVirusLive](https://forums.unrealengine.com/u/TroJanVirusLive)\
**Post date:** [December 13, 2016, 10:32pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/6 "2016-12-13T22:32:08Z")

</div>

Here’s a thread that appears to be similar to what you’re trying to do:

> **[Create an array of assets from folder](https://forums.unrealengine.com/questions/285913/create-an-array-of-assets-from-folder.html)**
>
> Hi, i would like to create an array that lists all the static meshes in a specific folder from contect browser in exemple). I have a lot of parts that i need display in a menu, but it would be too painful to build the array element by element… I’ve...

It looks like C++ is required.

---

<div class="post-metadata">

**Author:** ![Stephane\_Roncada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Stephane\_Roncada](https://forums.unrealengine.com/u/Stephane_Roncada)\
**Post date:** [December 14, 2016, 4:46pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/7 "2016-12-14T16:46:28Z")

</div>

Thanks for your help Trojan, I’m looking into the links you posted 🙂

---

<div class="post-metadata">

**Author:** ![duke22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@duke22](https://forums.unrealengine.com/u/duke22)\
**Post date:** [August 16, 2017, 5:02am UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/8 "2017-08-16T05:02:02Z")

</div>

GEditor-\>GetSelectedObjects() I think.

---

<div class="post-metadata">

**Author:** ![Ville\_Nurmi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ville\_Nurmi](https://forums.unrealengine.com/u/Ville_Nurmi)\
**Post date:** [July 10, 2018, 11:15am UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/9 "2018-07-10T11:15:11Z")

</div>

This gives you all the selected assets:

```
    TArray&lt;FAssetData&gt; AssetDatas;
    FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked&lt;FContentBrowserModule&gt;("ContentBrowser");
    IContentBrowserSingleton& ContentBrowserSingleton = ContentBrowserModule.Get();
    ContentBrowserSingleton.GetSelectedAssets(AssetDatas);

```

The problem with GEditor-\>GetSelectedObjects() is that it doesn’t include assets that haven’t been loaded yet, even if they are selected in the GUI.

---

<div class="post-metadata">

**Author:** ![JediKnightChan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jediknightchan/32/1156960_2.png) [@JediKnightChan](https://forums.unrealengine.com/u/JediKnightChan)\
**Post date:** [September 18, 2022, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/10 "2022-09-18T19:07:22Z")

</div>

```auto
#include "ContentBrowserModule.h"
#include "IContentBrowserSingleton.h"

TArray<FAssetData> OutSelectedAssets;
	FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
	IContentBrowserSingleton& ContentBrowserSingleton = ContentBrowserModule.Get();
	ContentBrowserSingleton.GetSelectedAssets(OutSelectedAssets);

```

---

<div class="post-metadata">

**Author:** ![UPO33](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UPO33](https://forums.unrealengine.com/u/UPO33)\
**Post date:** [March 5, 2024, 3:26pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/11 "2024-03-05T15:26:47Z")

</div>

```cpp
	TArray<FAssetData> SelectedAssets;
	IContentBrowserSingleton::Get().GetSelectedAssets(SelectedAssets);

```

---

<div class="post-metadata">

**Author:** ![Jotaid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jotaid](https://forums.unrealengine.com/u/Jotaid)\
**Post date:** [August 3, 2024, 2:15pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/12 "2024-08-03T14:15:39Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/f/24f97414365d79bb94eba34f7296b0d90c13c522.png)  
My setup to delete all actors that are the same class that my selected blueprint in the Content Browser

---

<div class="post-metadata">

**Author:** ![phil123456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil123456](https://forums.unrealengine.com/u/phil123456)\
**Post date:** [September 27, 2025, 11:06pm UTC](https://forums.unrealengine.com/t/how-to-get-reference-to-selected-assets-in-content-browser/80533/13 "2025-09-27T23:06:48Z")

</div>

```auto
TArray<UObject*> UPhilBlueprintFunctionLibrary::PhilGetSelectedAssets()
{
    TArray<UObject*> SelectedAssets;

#if WITH_EDITOR
    TArray<FAssetData> OutSelectedAssets;
    FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
    IContentBrowserSingleton& ContentBrowserSingleton = ContentBrowserModule.Get();
    ContentBrowserSingleton.GetSelectedAssets(OutSelectedAssets);

    for (const FAssetData& AssetData : OutSelectedAssets)
    {
        if (UObject* Asset = AssetData.GetAsset())
        {
            SelectedAssets.Add(Asset);
        }
    }
#endif

    return SelectedAssets;
}

TArray<FSoftObjectPath> UPhilBlueprintFunctionLibrary::PhilGetSelectedAssetPaths()
{
    TArray<FSoftObjectPath> SelectedPaths;

#if WITH_EDITOR
    TArray<FAssetData> OutSelectedAssets;
    FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
    IContentBrowserSingleton& ContentBrowserSingleton = ContentBrowserModule.Get();
    ContentBrowserSingleton.GetSelectedAssets(OutSelectedAssets);

    for (const FAssetData& AssetData : OutSelectedAssets)
    {
        SelectedPaths.Add(AssetData.ToSoftObjectPath());
    }
#endif

    return SelectedPaths;
}

```
