How can we load a Blueprint using C++ and display its properties ?

I want to load a Blueprint file of an object using C++ code and read it. I am not sure how to do it. Any help will be deeply appreciated. Thanks

1 Like

If I understand the question, you want to examine the properties of a blueprint to pull information from it?

This would be the GetDefaultObject().

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Inventory)
UClass* OtherBlueprint=nullptr; //must be populated with an Actor Blueprint

 UObject* DefaultSpawnableClass = OtherBlueprint->GetDefaultObject();
 AFlightPawn* DefaultSpawnShip = Cast<AFlightPawn>(DefaultSpawnableClass);
 DroneRecord.HealthData.Health=DefaultSpawnShip->Health;
 DroneRecord.HealthData.Armor=DefaultSpawnShip->Armor;
 DroneRecord.HealthData.StaticShield=DefaultSpawnShip->StaticShield;

In this case, my OtherBlueprint is a UClass* that is the default blueprint for a similar drone that the flying vehicle needs to spawn eventually. This pulls it’s health, armor and shield information out of the supplied (in the UClass) blueprint to apply later to the drone it’s building to spawn.

This doesn’t spawn OtherBlueprint but just lets me examine it.