Bi-Directional USD Import/Export via Python

Hi,

I saw this feature was mentioned during the 4.21 previews but I can’t find any documentation about it. Was the feature scrapped, or is it just hidden somewhere in the engine?

Thanks!

Hi,
If you look in your 4.21 install under Engine\Plugins\Editor\USDImporter\Content\Python\usd_unreal, you’ll find a few files.

  • test.py shows a standalone example of how to use the Python API to do various import and export tasks.
  • You can also look at the init_unreal.py file (and the other modules it relies on) to see how level import and export are hooked in to the Editor UI when the plugin is loaded and at editor startup, and how those functions are implemented.

I think that’s what the feature description is referring to, and I’m reaching out internally to check if there’s anything else.

Awesome, I’ll check that out! Thanks for the reply.

Hi Ro-Su-

I was able to enable the plugin and I tried exporting a cube by using the editor’s export ui. File->Export Selected

I then selected the .USD file type and clicked export, however it gave me this error in the console.

Try enabling the Editor Scripting Utilities plugin in your Project.
It adds a lot of useful Python modules that simplify working with Assets and Level Actors, including the unreal.EditorLevelLibrary that I see mentioned in your error message.
It looks like that script relies on it.

Hi Ro-Su-

I’ve enabled the plugin and now it is actually creating a file but it appears that the file is empty. To test it out I tried exporting Mike from the digital human project as a .usd file. It saved a file to my desktop though it was only 1 Kilobyte. Should I post a bug report regarding this? or is there something else I’m missing?

Thanks!

Hi! We would like to import USD scenes at runtime. Has anyone had success with this? We are aware of the Omniverse project at Nvidia. Would be curious if anyone else has taken a crack at this. Thanks, Apurva

For me the usd import plugin fails to import my scene properly and half of the geometry is missing.

Which version of UE are you using?
Is you USD file something you could share with our team to try reproduce and see what is failing?