Description

I was noticing that functions you define in a Blueprint Function Library created in the content browser are only usable from blueprint classes that derive from Actor, but not from blueprint classes that derive from Object.

Investigating further, it looks like this is being filtered by UEdGraphSchema_K2::CanFunctionBeUsedInGraph() where it returns false because the in function has the MD_WorldContext meta data, meaning the function requires a world context, even though the function is empty.

So it seems like any BP Function Library you create in the content browser just defaults to requiring world context, which means they can never be used in an Object-derived blueprint.

Steps to Reproduce
  1. Create a new Blueprint Function Library via the content browser
  2. Create a function in the library called "MyCoolFunc"
  3. Create a new Actor-derived blueprint class, and add the MyCoolFunc function node to its Event Graph
  4. Create a new Object-derived blueprint class, and try to add the MyCoolFunc function node to its Event Graph
    • Notice that the right click "add node" menu does not display the MyCoolFunc funtion
Callstack

This function is filtered out of the list via the following callstack:

>	UE4Editor-BlueprintGraph-Win64-Debug.dll!UEdGraphSchema_K2::CanFunctionBeUsedInGraph(const UClass * InClass, const UFunction * InFunction, const UEdGraph * InDestGraph, unsigned int InAllowedFunctionTypes, bool bInCalledForEach, FText * OutReason) Line 757	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UK2Node_CallFunction::CanPasteHere(const UEdGraph * TargetGraph) Line 1130	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!UK2Node_CallFunction::IsActionFilteredOut(const FBlueprintActionFilter & Filter) Line 1141	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!BlueprintActionFilterImpl::IsNodeTemplateSelfFiltered(const FBlueprintActionFilter & Filter, FBlueprintActionInfo & BlueprintAction) Line 1467	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!TBaseStaticDelegateInstance<bool __cdecl(FBlueprintActionFilter const & __ptr64,FBlueprintActionInfo & __ptr64)>::Execute(const FBlueprintActionFilter & <Params_0>, FBlueprintActionInfo & <Params_1>) Line 854	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!TBaseDelegate<bool,FBlueprintActionFilter const & __ptr64,FBlueprintActionInfo & __ptr64>::Execute(const FBlueprintActionFilter & <Params_0>, FBlueprintActionInfo & <Params_1>) Line 492	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!FBlueprintActionFilter::IsFilteredByThis(FBlueprintActionInfo & BlueprintAction) Line 1914	C++
 	UE4Editor-BlueprintGraph-Win64-Debug.dll!FBlueprintActionFilter::IsFiltered(FBlueprintActionInfo & BlueprintAction) Line 1855	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintActionMenuBuilderImpl::FMenuSectionDefinition::MakeMenuItems(TWeakPtr<FBlueprintEditor,0> EditorContext, FBlueprintActionInfo & DatabaseAction) Line 412	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintActionMenuBuilder::RebuildActionList() Line 533	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintActionMenuUtils::MakeContextMenu(const FBlueprintActionContext & Context, bool bIsContextSensitive, unsigned int ClassTargetMask, FBlueprintActionMenuBuilder & MenuOut) Line 678	C++
 	UE4Editor-Kismet-Win64-Debug.dll!SBlueprintActionMenu::CollectAllActions(FGraphActionListBuilderBase & OutAllActions) Line 447	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SBlueprintActionMenu,0,TTypeWrapper<void> __cdecl(FGraphActionListBuilderBase & __ptr64)>::Execute(FGraphActionListBuilderBase & <Params_0>) Line 282	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SBlueprintActionMenu,0,void __cdecl(FGraphActionListBuilderBase & __ptr64)>::ExecuteIfSafe(FGraphActionListBuilderBase & <Params_0>) Line 390	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TBaseDelegate<void,FGraphActionListBuilderBase & __ptr64>::ExecuteIfBound(FGraphActionListBuilderBase & <Params_0>) Line 578	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphActionMenu::RefreshAllActions(bool bPreserveExpansion, bool bHandleOnSelectionEvent) Line 343	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphActionMenu::Construct(const SGraphActionMenu::FArguments & InArgs, bool bIsReadOnly) Line 333	C++
 	UE4Editor-Kismet-Win64-Debug.dll!RequiredArgs::T0RequiredArgs::CallConstruct<SGraphActionMenu>(const TSharedRef<SGraphActionMenu,0> & OnWidget, const SGraphActionMenu::FArguments & WithNamedArgs) Line 825	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TDecl<SGraphActionMenu,RequiredArgs::T0RequiredArgs>::operator<<=(const SGraphActionMenu::FArguments & InArgs) Line 1082	C++
 	UE4Editor-Kismet-Win64-Debug.dll!SBlueprintActionMenu::Construct(const SBlueprintActionMenu::FArguments & InArgs, TSharedPtr<FBlueprintEditor,0> InEditor) Line 342	C++
 	UE4Editor-Kismet-Win64-Debug.dll!RequiredArgs::T1RequiredArgs<TSharedRef<FBlueprintEditor,0> && __ptr64>::CallConstruct<SBlueprintActionMenu>(const TSharedRef<SBlueprintActionMenu,0> & OnWidget, const SBlueprintActionMenu::FArguments & WithNamedArgs) Line 842	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TDecl<SBlueprintActionMenu,RequiredArgs::T1RequiredArgs<TSharedRef<FBlueprintEditor,0> && __ptr64> >::operator<<=(const SBlueprintActionMenu::FArguments & InArgs) Line 1082	C++
 	UE4Editor-Kismet-Win64-Debug.dll!FBlueprintEditor::OnCreateGraphActionMenu(UEdGraph * InGraph, const FVector2D & InNodePosition, const TArray<UEdGraphPin *,FDefaultAllocator> & InDraggedPins, bool bAutoExpand, TBaseDelegate<void> InOnMenuClosed) Line 3027	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TMemberFunctionCaller<FBlueprintEditor,FActionMenuContent (__cdecl FBlueprintEditor::*)(UEdGraph * __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool,TBaseDelegate<void>) __ptr64>::operator()<UEdGraph * __ptr64 & __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool & __ptr64,TBaseDelegate<void> & __ptr64>(UEdGraph * & <Args_0>, const FVector2D & <Args_1>, const TArray<UEdGraphPin *,FDefaultAllocator> & <Args_2>, bool & <Args_3>, TBaseDelegate<void> & <Args_4>) Line 161	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TTupleImpl<TIntegerSequence<unsigned int> >::ApplyAfter_ExplicitReturnType<FActionMenuContent,TMemberFunctionCaller<FBlueprintEditor,FActionMenuContent (__cdecl FBlueprintEditor::*)(UEdGraph * __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool,TBaseDelegate<void>) __ptr64>,UEdGraph * __ptr64 & __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool & __ptr64,TBaseDelegate<void> & __ptr64>(TMemberFunctionCaller<FBlueprintEditor,FActionMenuContent (__cdecl FBlueprintEditor::*)(UEdGraph *,FVector2D const &,TArray<UEdGraphPin *,FDefaultAllocator> const &,bool,TBaseDelegate<void>)> && Func, UEdGraph * & <Args_0>, const FVector2D & <Args_1>, const TArray<UEdGraphPin *,FDefaultAllocator> & <Args_2>, bool & <Args_3>, TBaseDelegate<void> & <Args_4>) Line 128	C++
 	UE4Editor-Kismet-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,FBlueprintEditor,0,FActionMenuContent __cdecl(UEdGraph * __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool,TBaseDelegate<void>)>::Execute(UEdGraph * <Params_0>, const FVector2D & <Params_1>, const TArray<UEdGraphPin *,FDefaultAllocator> & <Params_2>, bool <Params_3>, TBaseDelegate<void> <Params_4>) Line 282	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TBaseDelegate<FActionMenuContent,UEdGraph * __ptr64,FVector2D const & __ptr64,TArray<UEdGraphPin * __ptr64,FDefaultAllocator> const & __ptr64,bool,TBaseDelegate<void> >::Execute(UEdGraph * <Params_0>, const FVector2D & <Params_1>, const TArray<UEdGraphPin *,FDefaultAllocator> & <Params_2>, bool <Params_3>, TBaseDelegate<void> <Params_4>) Line 491	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphEditorImpl::GraphEd_OnGetContextMenuFor(const FGraphContextMenuArguments & SpawnInfo) Line 503	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TMemberFunctionCaller<SGraphEditorImpl,FActionMenuContent (__cdecl SGraphEditorImpl::*)(FGraphContextMenuArguments const & __ptr64) __ptr64>::operator()<FGraphContextMenuArguments const & __ptr64>(const FGraphContextMenuArguments & <Args_0>) Line 161	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TTupleImpl<TIntegerSequence<unsigned int> >::ApplyAfter_ExplicitReturnType<FActionMenuContent,TMemberFunctionCaller<SGraphEditorImpl,FActionMenuContent (__cdecl SGraphEditorImpl::*)(FGraphContextMenuArguments const & __ptr64) __ptr64>,FGraphContextMenuArguments const & __ptr64>(TMemberFunctionCaller<SGraphEditorImpl,FActionMenuContent (__cdecl SGraphEditorImpl::*)(FGraphContextMenuArguments const &)> && Func, const FGraphContextMenuArguments & <Args_0>) Line 128	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TBaseSPMethodDelegateInstance<0,SGraphEditorImpl,0,FActionMenuContent __cdecl(FGraphContextMenuArguments const & __ptr64)>::Execute(const FGraphContextMenuArguments & <Params_0>) Line 282	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!TBaseDelegate<FActionMenuContent,FGraphContextMenuArguments const & __ptr64>::Execute(const FGraphContextMenuArguments & <Params_0>) Line 491	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphPanel::SummonContextMenu(const FVector2D & WhereToSummon, const FVector2D & WhereToAddNode, UEdGraphNode * ForNode, UEdGraphPin * ForPin, const TArray<UEdGraphPin *,FDefaultAllocator> & DragFromPins, bool bShiftOperation) Line 1062	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphPanel::OnSummonContextMenu(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 792	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SNodePanel::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 829	C++
 	UE4Editor-GraphEditor-Win64-Debug.dll!SGraphPanel::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent) Line 682	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent::__l17::<lambda>(const FArrangedWidget & TargetWidget, const FPointerEvent & Event) Line 4423	C++
 	UE4Editor-Slate-Win64-Debug.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) >(FSlateApplication * ThisApplication, FEventRouter::FToLeafmostPolicy RoutingPolicy, FPointerEvent EventCopy, const FSlateApplication::RoutePointerUpEvent::__l17::FReply <lambda>(const FArrangedWidget &, const FPointerEvent &) & Lambda) Line 214	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::RoutePointerUpEvent(FWidgetPath & WidgetsUnderPointer, FPointerEvent & PointerEvent) Line 4426	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::ProcessMouseButtonUpEvent(FPointerEvent & MouseEvent) Line 4820	C++
 	UE4Editor-Slate-Win64-Debug.dll!FSlateApplication::OnMouseUp(const EMouseButtons::Type Button) Line 4796	C++
 	UE4Editor-Core-Win64-Debug.dll!FWindowsApplication::ProcessDeferredMessage(const FDeferredWindowsMessage & DeferredMessage) Line 1415	C++
 	UE4Editor-Core-Win64-Debug.dll!FWindowsApplication::DeferMessage(TSharedPtr<FWindowsWindow,0> & NativeWindow, HWND__ * InHWnd, unsigned int InMessage, unsigned __int64 InWParam, __int64 InLParam, int MouseX, int MouseY, unsigned int RawInputFlags) Line 1708	C++
 	UE4Editor-Core-Win64-Debug.dll!FWindowsApplication::ProcessMessage(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 764	C++
 	UE4Editor-Core-Win64-Debug.dll!FWindowsApplication::AppWndProc(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Line 627	C++
 	[External Code]	
 	UE4Editor-Core-Win64-Debug.dll!WinPumpMessages() Line 862	C++
 	UE4Editor-Core-Win64-Debug.dll!FWindowsPlatformMisc::PumpMessages(bool bFromMainLoop) Line 889	C++
 	UE4Editor-Win64-Debug.exe!FEngineLoop::Tick() Line 2597	C++
 	UE4Editor-Win64-Debug.exe!EngineTick() Line 52	C++
 	UE4Editor-Win64-Debug.exe!GuardedMain(const wchar_t * CmdLine, HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, int nCmdShow) Line 145	C++
 	UE4Editor-Win64-Debug.exe!WinMain(HINSTANCE__ * hInInstance, HINSTANCE__ * hPrevInstance, char * __formal, int nCmdShow) Line 189	C++
 	[External Code]	

Have Comments or More Details?

There's no existing public thread on this issue, so head over to AnswerHub just mention UE-23309 in the post.

4
Login to Vote

Won't Fix
ComponentGameplay - Blueprint
Affects Versions4.9.24.104.11
CreatedNov 13, 2015
ResolvedJul 13, 2016
UpdatedJul 14, 2021