Anyone know how to compile an actor BP from python ?
For the context, I modify my BP, changing the material from some skeletal meshes and it works well, but i noticed that sometimes the change is forgotten at next restart because i didn’t recompile the BP. So it seems that recompiling is necessary to commit the changes.
I have lots of BP and recompiling manually (open + click compile) kind of miss the point of modifying BP through python
I couldn’t find any “compile” or “recompile” function in the api doc.
I found a “recompile_VM” but not sure what it is and i couldn’t use it anyway.
Any movement on this? I would really like to compile blueprints, niagara systems, and niagara emitters. Either in python or through a BP method. Thanks
If in UE4, the “compile” function is not callable from python, but you can wrap and make it blueprint callable in your UBlueprintFunctionLibrary, just like BlueprintEditorLibrary.h did
.h
/**
* Compiles the given blueprint.
*
* @param Blueprint Blueprint to compile
*/
UFUNCTION(BlueprintCallable, Category = "Blueprint Upgrade Tools")
static void CompileBlueprint(UBlueprint* Blueprint);
.cpp
void UBlueprintEditorLibrary::CompileBlueprint(UBlueprint* Blueprint)
{
if (Blueprint)
{
// Skip saving this to avoid possible tautologies when saving and allow the user to manually save
EBlueprintCompileOptions Flags = EBlueprintCompileOptions::SkipSave;
FKismetEditorUtilities::CompileBlueprint(Blueprint, Flags);
}
}