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!