How to compile an actor BP in python?


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 :slight_smile:

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 help welcomed :slight_smile:

1 Like

I’d also love to know how to do this.

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

It’s easy if you are using UE5, there is a new editor bp lib: BlueprintEditorLibrary

    def compile_blueprint(cls, blueprint):
        X.compile_blueprint(blueprint) -> None
        Compiles the given blueprint.
            blueprint (Blueprint): Blueprint to compile
        return None

just call it:


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


	* Compiles the given blueprint. 
	* @param Blueprint	Blueprint to compile
	UFUNCTION(BlueprintCallable, Category = "Blueprint Upgrade Tools")
	static void CompileBlueprint(UBlueprint* Blueprint);


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);

1 Like