Closed arafat0007 closed 4 years ago
Had the same problem, that's what I'm doing, not pretty but it works:
try: mesh = ue.load_object(StaticMesh, assetpath) except: mesh = None if mesh: comp.StaticMesh = mesh
Kind regards, sorry for the non-pythonesk formatting.
Mirko
Thank you @kogen00 i will try it out. Though i had done it other way around. I had to cross check if an image has it's texture available in content or not. If not create one. I manually took file names and compared and checked that.
Hi @arafat0007 I think your method is valid. The only difference is, that my (hacky) solution uses the Unreal-Python method asking to load the asset and if not possible (cause the plugin threw an error) assumes that it's not there at this path. I use this way extensively to load a couple of thousand meshes into a blueprint and it has not let me down so far ;)
In the official unreal, there are functions like "does_asset_exist". My purpose is to check if a certain asset exists in the particular content browser path or not.