Hello,
I can create a blueprint derivated from my C++ class but I would like now to tune the properties values to make the BP ready to use for the user. I have this for now:
FName BluePrintName = FName(ObjectTools::SanitizeObjectName("A_MyBPActor");
FString AssetPath = InParent->GetName() + "/" + BluePrintName.ToString();
UPackage* BluePrintPackage = MyUtilsClass::PreparePackage(BluePrintName.ToString(), AssetPath);
// Create and init a new blank Blueprint
UBlueprint* Blueprint = FKismetEditorUtilities::CreateBlueprint(AMyActor::StaticClass(), BluePrintPackage, BluePrintName, BPTYPE_Normal, UBlueprint::StaticClass(), UBlueprintGeneratedClass::StaticClass());
if (Blueprint) {
// HERE I WOULD LIKE TO EDIT ACTOR PROPERTIES
// Save the Asset init
FCompilerResultsLog LogResults; // We don't really care of the logs here.
FKismetEditorUtilities::CompileBlueprint(Blueprint, EBlueprintCompileOptions::None, &LogResults);
// Notify the asset registry
FAssetRegistryModule::AssetCreated(Blueprint);
// Mark the package dirty...
BluePrintPackage->MarkPackageDirty();
}
I found this who seems to be interesting but it fails trying to get the value because it is a blueprint instance and not AMyActor instance : Edit Blueprint Variable in C++