Hi all.
I’m creating a plugin using Slate. To represent a Content Browser in my plugin tab I used SAssetPicker created by Content Browser Singleton:
ContentBrowserModule->Get().CreateAssetPicker(Config)
I also have a separate context menu widget to interact with it.
It covered all my needs, but then I realized that I need to add an asset rename request functionality. I want to get the same behavior as in Content Browser’s Asset View (when you can click Rename on any Asset’s context or press F2) and for this purpose I’ve tried next code:
TSharedPtr<SWidget> AssetPickerRaw = ContentBrowserModule->Get().CreateAssetPicker(Config);
TSharedPtr<SAssetPicker> AssetPicker = StaticCastSharedPtr<SAssetPicker>(AssetPickerRaw);
TSharedPtr<SAssetView> AssetView = AssetPicker->GetAssetView();
const auto& AssetViewSelectedItems = AssetView->GetSelectedItems();
AssetView->RenameItem(AssetViewSelectedItems[0]);
But when I’m trying to call something from SAssetView I receive linker errors:
1>Module.AssetManagerPlugin.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl SAssetView::RenameItem(struct FContentBrowserItem const &)" (?RenameItem@SAssetView@@QEAAXAEBUFContentBrowserItem@@@Z) referenced in function "public: void __cdecl SAssetPickerWidget::Construct(struct SAssetPickerWidget::FArguments const &)" (?Construct@SAssetPickerWidget@@QEAAXAEBUFArguments@1@@Z)
1>Module.AssetManagerPlugin.cpp.obj : error LNK2019: unresolved external symbol "public: class TArray<struct FContentBrowserItem,class TSizedDefaultAllocator<32> > __cdecl SAssetView::GetSelectedItems(void)const " (?GetSelectedItems@SAssetView@@QEBA?AV?$TArray@UFContentBrowserItem@@V?$TSizedDefaultAllocator@$0CA@@@@@XZ) referenced in function "public: void __cdecl SAssetPickerWidget::Construct(struct SAssetPickerWidget::FArguments const &)" (?Construct@SAssetPickerWidget@@QEAAXAEBUFArguments@1@@Z)
My deps:
PrivateDependencyModuleNames.AddRange(
new string[]
{
"Projects",
"InputCore",
"UnrealEd",
"ToolMenus",
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
"AssetManagerEditor",
"EditorStyle",
"ContentBrowser",
"ContentBrowserData",
"PropertyEditor",
"EditorScriptingUtilities",
}
);
Can someone tell me what I am doing wrong? Also if this widget is restricted for external use then why I can easily use SAssetPicker and where I can see build rules for these restricted files? Maybe you will suggest me more convenient way to request renaming files from Slate?
Any advice appreciated