UContentBrowserAssetContextMenuContext::GetSingleSelectedAssetOfType

Sometimes you want to write actions that will only operate on a singular selected asset, in those cases you can use the following function which will only return a live ptr if it's an instance of that asset type, and only one thing is selected.

Unreal Engine C++ API Reference > Editor > ContentBrowser > UContentBrowserAssetContextMenuContext

References

   
Module ContentBrowser
Header /Engine/Source/Editor/ContentBrowser/Public/ContentBrowserMenuContexts.h
Include #include "ContentBrowserMenuContexts.h"
Source /Engine/Source/Editor/ContentBrowser/Private/ContentBrowserMenuContexts.cpp
const [FAssetData](API\Runtime\CoreUObject\AssetRegistry\FAssetData) * GetSingleSelectedAssetOfType
(
    const [UClass](API\Runtime\CoreUObject\UObject\UClass) * AssetClass,
    EIncludeSubclasses IncludeSubclasses
) const

Remarks

Sometimes you want to write actions that will only operate on a singular selected asset, in those cases you can use the following function which will only return a live ptr if it's an instance of that asset type, and only one thing is selected.


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library