Python: How can I point load_asset to an asset library not in root?

I’m currently working on python scripts for UE4 to import my GIS data into unreal. A problem I am running into is with the ‘unreal.EditorAssetLibrary.load_asset’ class.

I can write out:

cube = unreal.EditorAssetLibrary.load_asset(“StaticMesh’/Engine/BasicShapes/Cube.Cube’”)

and it will work fine, spawning a cube.

The problem is if I write out:

can = unreal.EditorAssetLibrary.load_asset(“StaticMesh’D:/Folder1/Unreal/PythonTesting/Content/UrbanCity/Models/props/prp_garbageCan.prp_garbageCan’”)

I get the error:

LogEditorScripting: Error: LoadAsset. Failed to load asset: Can’t convert path ‘StaticMesh’D:/Folder1/Unreal/PythonTesting/Content/UrbanCity/Models/props/prp_garbageCan.prp_garbageCan’’ because the PackagePath ‘D’ doesn’t start with a ‘/’.

I’ve tried a couple other variations trying to figure out starting with a ‘/’ but I cannot get it to correctly look in any location other than the root Unreal folder. I was hoping someone here could tell me what I am doing wrong.

Thank you!

Probably you are passing to load_asset an object StaticMesh(String starts with StaticMesh).
Try to get the name from StaticMesh.get_path_name().