Calling UFUNCTION in UObject-derived base class from blueprint editor

I am making a custom editor and implemented some nodes in it.

Here is the definition of such node:

class TESTTOOL_API UCustomNodeBase :
public UEdGraphNode

with a regular UFUNCTION defined inside:

UFUNCTION(BlueprintCallable, Category = "Some basic stuff") 
void BasicStuff() {};

Let’s say I have this node placed in the custom editor. Now let’s say I have an actor which have an access to this node (obtained with CustomGraph->GetNodesOfClass()) and want to access UFUNCTION or UPROPERTY of this node from regular blueprint.

The problem is I can’t see them in regular blueprint but the rest of UObject-derived classes gives visibility of UFUNCTION and UPROPERTY pretty well.

tl;dr

UEdGraphNode derived classes UFUNCTIONs are not showing in blueprints.
Other UObject derived classes (for example UBlueprintFunctionLibrary) UFUNCTIONs are showing in blueprints.
Why is that so?

A little update. A problem is still here, but I’ve picked up some more data on issue.
Turns out you CAN use UEdGraphNode’s UPROPERTY and UFUNCTION definitions in blueprints, but you can’t have an access to them in context menu.
Looks like it just doesn’t get captured by reflection system.
I’ve derived blueprint from C++ UEdGraphNode class and added the function with the same name as in C++.
System alerted me that such function exists and base function appeared in Functions tab. I was able to drag it and use in other blueprints.
This workaround, however, can’t be used with UPROPERTY in same way since you can’t provoke variable to throw an override alert.

So yeah, here’s the issue, some UObject-derived classes doesn’t get their UPROPERTYs and UFUCTIONs in reflection system. Is there way to modify UEdGraphNode to register U-stuff in reflection system?

Dumb question, but did you casted it into “CustomNodeBase” ? ( often methods return raw UObject* so you still have to cast it after getting it )

I’ve just tried to call Cast to CustomNodeBase and realized it doesn’t get to context menu as well.
Looks like UEdGraphNode class family are really not intended for blueprint use.
That’s a sad thing to know since I would need to make ugly UObject wrappers with setters and getters to use it in blueprint…

erf :-/
I would suggest to make a c++ blueprintLibrary instead of UObject wrapper, that would be cleaner ( less messy… ) :slight_smile: ( take a UObject cast it to you class, and return value )

Well, If found an ugliest workaround only mother could love…
I’ve made a snippet of reference code in text editor and pasted into a graph.

So you have a node defined like this:

class TESTTOOL_API UCustomNodeBase :
 public UEdGraphNode

with variable defined like this:

 UPROPERTY(EditAnywhere, Category = "Some basic stuff") 
 FText BasicStuff;

You can access variable from derived blueprint pasting this text to editor

Begin Object Class=K2Node_VariableGet
   VariableReference=(MemberName="BasicStuff",bSelfContext=True)
End Object

And here is how I access non-SelfContext variable

Begin Object Class=K2Node_VariableGet
   VariableReference=(MemberParent=Class'/Script/TestTool.CustomNodeBase',MemberName="BasicStuff")
End Object

The functions would work in the same fashion or by the override appearance method discussed in commentary.

These methods are pretty slow and I would love to find a REAL solution with adding properties to context menu.