Does it exist? I can’t see to recreate the capability from BP to C++ but it has to exist. Anyway to see the engine code behind a BP node?
UClass* MyClass = …;
MyClass->->GetDefaultObject();
or
USomeObjectClass::StaticClass()->GetDefaultObject()
AMyCharacter::StaticClass()->GetDefaultObject()
First thnak you, i will test tonight. QQ Is the use of the double pointer “-> ->” in the first example a skip over the StaticClass in the second example? Just trying to understand the syntax. Or a typo?
To finish this off in case someone else is stuck here:
In target class:
UFUNCTION(BlueprintCallable)
UTexture2D* GetIcon() const { return ResourceData.Icon; }
in calling class:
#include "class.h"
// BP GetClassDefaults = GetDefaultObject<class>>()->
UTexture2D* localIcon = Resource->GetDefaultObject<class>()->GetIcon();
ResourceIcon->SetBrushFromTexture(localIcon, true);
I know the localIcon variable is not required but for testing I wanted it broken apart for clarity.