Unreal crashes when showing UI’s built with complex uproperties via IDetailsView::SetObject when plugin is loaded in the command line with -Plugin and does not crash when plugin is placed in the “Plugins” directory.
Roughly, when options are created using IDetailsView::SetObject:
FPropertyEditorModule& PropertyEditor = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
FDetailsViewArgs DetailsViewArgs;
{
DetailsViewArgs.bAllowSearch = false;
DetailsViewArgs.bUpdatesFromSelection = false;
DetailsViewArgs.bSearchInitialKeyFocus = false;
DetailsViewArgs.bLockable = false;
DetailsViewArgs.NameAreaSettings = FDetailsViewArgs::HideNameArea;
DetailsViewArgs.ViewIdentifier = "Options";
}
TSharedPtr<IDetailsView> mOptionsView = PropertyEditor.CreateDetailView(DetailsViewArgs);
mOptionsView->SetObject(mOptions);
… where the mOptions uobject has complex uproperties, like AActor or FFrame (as opposed to int or FString).
UPROPERTY(BlueprintReadWrite, EditAnywhere)
ACineCameraActor* TestCamera;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FFrameNumber TestFrame;
Unreal then crashes when trying to convert these properties to text. And this only happens when the plugin running this code is specified through ueditor.exe -Plugin=“path/to/my/plugin” and not in the plugins directory.
Assertion failed: Count >= 0 [File:d:\build\++ue4\sync\engine\source\runtime\core\public\Containers/UnrealString.h] [Line: 355]
UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4\sync\engine\source\runtime\core\private\misc\assertionmacros.cpp:425] UE4Editor_CoreUObject!UStrProperty::ExportTextItem() [d:\build\++ue4\sync\engine\source\runtime\coreuobject\private\uobject\propertystr.cpp:88] UE4Editor_CoreUObject!UProperty::ExportText_Direct() [d:\build\++ue4\sync\engine\source\runtime\coreuobject\private\uobject\property.cpp:708] UE4Editor_PropertyEditor!FPropertyValueImpl::GetPropertyValueText() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:167] UE4Editor_PropertyEditor!FPropertyValueImpl::GetValueAsText() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:757] UE4Editor_PropertyEditor!FPropertyEditor::GetValueAsText() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\presentation\propertyeditor\propertyeditor.cpp:142] UE4Editor_PropertyEditor!TBaseSPMethodDelegateInstance<1,FPropertyEditor,0,FText
__cdecl(void)>::Execute() [d:\build\++ue4\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:269] UE4Editor_Slate!TAttribute<FText>::Get() [d:\build\++ue4\sync\engine\source\runtime\core\public\misc\attribute.h:137] UE4Editor_Slate!FSlateEditableTextLayout::FSlateEditableTextLayout() [d:\build\++ue4\sync\engine\source\runtime\slate\private\widgets\text\slateeditabletextlayout.cpp:105] UE4Editor_Slate!SEditableText::Construct() [d:\build\++ue4\sync\engine\source\runtime\slate\private\widgets\input\seditabletext.cpp:59] UE4Editor_Slate!TDecl<SEditableText,RequiredArgs::T0RequiredArgs>::operator<<=() [d:\build\++ue4\sync\engine\source\runtime\slatecore\public\widgets\declarativesyntaxsupport.h:1094] UE4Editor_Slate!SEditableTextBox::Construct() [d:\build\++ue4\sync\engine\source\runtime\slate\private\widgets\input\seditabletextbox.cpp:24] UE4Editor_PropertyEditor!TDecl<SEditableTextBox,RequiredArgs::T0RequiredArgs>::operator<<=() [d:\build\++ue4\sync\engine\source\runtime\slatecore\public\widgets\declarativesyntaxsupport.h:1094] UE4Editor_PropertyEditor!SPropertyEditorText::Construct() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\userinterface\propertyeditor\spropertyeditortext.cpp:47] UE4Editor_PropertyEditor!SPropertyValueWidget::ConstructPropertyEditorWidget() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\propertyeditorhelpers.cpp:292] UE4Editor_PropertyEditor!SPropertyValueWidget::Construct() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\propertyeditorhelpers.cpp:80] UE4Editor_PropertyEditor!FPropertyHandleBase::CreatePropertyValueWidget() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\propertyhandleimpl.cpp:2265] UE4Editor_DetailCustomizations!FDirectoryPathStructCustomization::CustomizeHeader() [d:\build\++ue4\sync\engine\source\editor\detailcustomizations\private\directorypathstructcustomization.cpp:73] UE4Editor_PropertyEditor!FDetailPropertyRow::OnItemNodeInitialized() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailpropertyrow.cpp:216] UE4Editor_PropertyEditor!FDetailItemNode::InitPropertyEditor() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailitemnode.cpp:142] UE4Editor_PropertyEditor!FDetailItemNode::Initialize() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailitemnode.cpp:43] UE4Editor_PropertyEditor!FDetailCategoryImpl::GenerateNodesFromCustomizations() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailcategorybuilderimpl.cpp:674] UE4Editor_PropertyEditor!FDetailCategoryImpl::GenerateChildrenForSingleLayout() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailcategorybuilderimpl.cpp:696] UE4Editor_PropertyEditor!FDetailCategoryImpl::GenerateChildrenForLayouts() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detailcategorybuilderimpl.cpp:760] UE4Editor_PropertyEditor!FDetailLayoutBuilderImpl::BuildCategories() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detaillayoutbuilderimpl.cpp:182] UE4Editor_PropertyEditor!FDetailLayoutBuilderImpl::GenerateDetailLayout() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\detaillayoutbuilderimpl.cpp:226] UE4Editor_PropertyEditor!SDetailsViewBase::UpdateSinglePropertyMap() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsviewbase.cpp:379] UE4Editor_PropertyEditor!SDetailsViewBase::UpdatePropertyMaps() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsviewbase.cpp:341] UE4Editor_PropertyEditor!SDetailsView::PostSetObject() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsview.cpp:888] UE4Editor_PropertyEditor!SDetailsView::SetObjectArrayPrivate() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsview.cpp:641] UE4Editor_PropertyEditor!SDetailsView::SetObjects() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsview.cpp:404] UE4Editor_PropertyEditor!SDetailsView::SetObject() [d:\build\++ue4\sync\engine\source\editor\propertyeditor\private\sdetailsview.cpp:411] UE4Editor_Befrender!UBefrenderUI::Init() [c:\users\jordanhu\work\befrender\build\unreal-4.20\python-2.7\platform-windows\befrender\plugins\befrender\source\befrender\private\befrenderui.cpp:40] UE4Editor_Befrender!UBefrenderUI::Get() [c:\users\jordanhu\work\befrender\build\unreal-4.20\python-2.7\platform-windows\befrender\plugins\befrender\source\befrender\public\befrenderui.h:36] UE4Editor_Befrender!FBefrenderModule::OpenUI() [c:\users\jordanhu\work\befrender\build\unreal-4.20\python-2.7\platform-windows\befrender\plugins\befrender\source\befrender\private\befrendermodule.cpp:262] UE4Editor_Befrender!TBaseRawMethodDelegateInstance<0,FBefrenderModule,void
__cdecl(void)>::ExecuteIfSafe() [c:\program files\epic games\ue_4.20\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:503] UE4Editor_Slate!FUICommandList::ExecuteAction() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\commands\uicommandlist.cpp:97] UE4Editor_Slate!SToolBarButtonBlock::OnClicked() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\multibox\stoolbarbuttonblock.cpp:300] UE4Editor_Slate!TBaseSPMethodDelegateInstance<0,SToolBarButtonBlock,0,FReply
__cdecl(void)>::Execute() [d:\build\++ue4\sync\engine\source\runtime\core\public\delegates\delegateinstancesimpl.h:269] UE4Editor_Slate!SButton::OnMouseButtonUp() [d:\build\++ue4\sync\engine\source\runtime\slate\private\widgets\input\sbutton.cpp:290] UE4Editor_Slate!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_1002768c627006711ef2f351a87ec0e7>
>() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:268] UE4Editor_Slate!FSlateApplication::RoutePointerUpEvent() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5472] UE4Editor_Slate!FSlateApplication::ProcessMouseButtonUpEvent() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5979] UE4Editor_Slate!FSlateApplication::OnMouseUp() [d:\build\++ue4\sync\engine\source\runtime\slate\private\framework\application\slateapplication.cpp:5959] UE4Editor_ApplicationCore!FWindowsApplication::ProcessDeferredMessage() [d:\build\++ue4\sync\engine\source\runtime\applicationcore\private\windows\windowsapplication.cpp:1736] UE4Editor_ApplicationCore!FWindowsApplication::DeferMessage() [d:\build\++ue4\sync\engine\source\runtime\applicationcore\private\windows\windowsapplication.cpp:2182] UE4Editor_ApplicationCore!FWindowsApplication::ProcessMessage() [d:\build\++ue4\sync\engine\source\runtime\applicationcore\private\windows\windowsapplication.cpp:895] UE4Editor_ApplicationCore!FWindowsApplication::AppWndProc() [d:\build\++ue4\sync\engine\source\runtime\applicationcore\private\windows\windowsapplication.cpp:732] user32 user32 UE4Editor_ApplicationCore!FWindowsPlatformApplicationMisc::PumpMessages() [d:\build\++ue4\sync\engine\source\runtime\applicationcore\private\windows\windowsplatformapplicationmisc.cpp:129] UE4Editor!FEngineLoop::Tick() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launchengineloop.cpp:3417] UE4Editor!GuardedMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\launch.cpp:166] UE4Editor!GuardedMainWrapper() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:144] UE4Editor!WinMain() [d:\build\++ue4\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:223] UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283] kernel32 ntdll