Populate Level Blueprint Using Python?

I am trying to write some python code that will generate the following three node event trigger inside the Level Blueprint. This setup auto plays a MediaPlayer.
Does anyone have any python code to demonstrate this type of Unreal Editor Scripting?

Here is a partial solution suggested on the discord. Instead of constructing the blue using python, create the blueprint as an asset and load a copy for modification.



import unreal

ell = unreal.EditorLevelLibrary
eal = unreal.EditorAssetLibrary

# Load my pre-created blueprint.
bp_temp = eal.load_asset("Blueprint'/Game/AutoPlayFootage/BP_AutoPlayFootage.BP_AutoPlayFootage'")
bp_gc = eal.load_blueprint_class(bp_temp.get_path_name())

bp_actor = ell.spawn_actor_from_class(bp_gc, unreal.Vector(0,0,0), unreal.Rotator(0,0,0))

# Load my pre-created media player.
MP_asset = eal.load_asset("MediaPlayer'/Game/NewMediaPlayer.NewMediaPlayer'")

# Try to assign to existing variable inside of pre-created blueprint.
bp_actor.set_actor_label('FootageAutoPlay')

# Make sure this property is set to public inside the blueprint.
bp_actor.set_editor_property("varMediaPlayer1", MP_asset)


I was getting warnings like “Warning: TryConvertFilenameToLongPackageName was passed an ObjectPath rather than a PackageName or FilePath. Accepting ObjectPaths is deprecated behavior and will be removed in a future release; TryConvertFilenameToLongPackageName will fail on ObjectPaths”.

So I used eal.load_asset(“/Game/Items/BP_Item”).get_outer().get_full_name() to get rid of them.

Now I am wondering if it’s possible to move item to a specific folder to organize them within a level. Can’t find API about that.