How do I compile and save blueprints using the command line

Hey, guys!

Our team recently encountered a problem where someone submitted a change to a blueprint that still displayed an error on another machine: Unknown Struct.

But having them recompile and save is fine, and if it’s annoying to do this frequently, can I stop the monotony with the command line or some scripting to focus on the real problem?

How do I compile and save a blueprint file directly from the command line or script?

The compile and save process for the blueprint looks like this:

Well, I find the compileAllBlueprints method and modified some of the contents to refresh, compile, and save the blueprints.

While it’s not clear why Epic doesn’t give a script interface for compiling individual blueprint。

Fortunately, the problem has been solved.

Reference documentation:

https://docs.unrealengine.com/4.26/en-US/API/Editor/UnrealEd/Commandlets/UCompileAllBlueprintsCommandlet/