Access Blueprint in C++

Hello.

I have some base Blueprint Class, named Rocks_Nature and many of another Blueprints, that are childs of the Rocks_Nature.

I need to check items, to find, is some object is child of the Rocks_Nature Blueprint.

I plan to make something like

                auto cls = StaticLoadObject(UObject::StaticClass(), nullptr, *assetDataObjectPath);

				//----------------------------------------
				//auto cls = StaticLoadObject(UObject::StaticClass(), nullptr, TEXT("Blueprint'/Game/GameObjects/Furniture/Tables/Wood_Table/forBuildMode/Wood_Table_Blueprint.Wood_Table_Blueprint'"));
				if (!cls) {
				GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Failed to LOAD " + PathToActorBluePrint));
				}

				UBlueprint * bp = Cast<UBlueprint>(cls);

				if (!bp) {
				GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, TEXT("Failed to CAST  " + PathToActorBluePrint));
				}

				TSubclassOf<class UObject> MyItemBlueprint;

				MyItemBlueprint = (UClass*)bp->GeneratedClass;

				if (MyItemBlueprint->GetClass()->IsChildOf(Rocks_Nature::StaticClass())) {}

(that I found in How to check if an actor is from a certain class? - Programming & Scripting - Epic Developer Community Forums ), but I don’t know, how to pass here Rocks_Nature Blueprint, for something like Rocks_Nature::StaticClass().

How to use blueprint in C++?

Thank you very much!

That won’t work as UBlueprint are only accessible in the editor and isn’t the UClass for your Blueprint class. What you want to do is:

UClass* MyBpClass = FindObject<UClass>(nullptr, TEXT("MyPackage.MyBpClass_C"), true);
if (MyBpClass == nullptr)
{
     ... Class hasn't been loaded yet
}

if (SomeOtherObject->IsSubclassOf(MyBpClass))