Recommended Approach for Importing USD via Interchange API with Custom Translator settings

Hello Epic Support Team,

I am working on automating the import of USD files using the Interchange framework in Unreal Engine 5.5 from a custom plugin/module using an Editor Utility Widget where you select a usd file and imports meshes/materials etc via Interchange.

My goal is to:

  • Programmatically import USD files via

UInterchangeManager::ImportAsset()

  • Customize USD-specific translator settings, such as: bCombineMeshes, bForceAllMeshesAsSkeletalMeshes, StageOptions.
  • Customize pipeline settings, e.g., to force import as skeletal mesh and combine static meshes.

From reviewing the engine source, I see that: UInterchangeUsdTranslatorSettings is not exported for use in other modules. The standard approach of creating a UInterchangeUsdTranslatorSettings instance (via NewObject) in an external plugin does not link successfully due to missing symbols. I thought I could reuse UInterchangeUsdTranslatorSettings and UInterchangeGenericAssetsPipeline and just set custom options for import before calling UInterchangeManager::ImportAsset() but looks like that’s not possible.

Could you please advise what the recommended workflow is for this scenario? Specifically:

  • Is there an intended way to set custom USD translator settings in code (from an external module) without modifying engine source?
  • If not, is the recommended practice to rebuild the engine with INTERCHANGEUSDTRANSLATOR_API added to ? If yes how can I then properly use the custom settings when i call ImportAsset()
  • Are there any plans to expose more of these settings via pipelines instead of translator settings?
  • Is there an alternative recommended approach for configuring these options programmatically for automated imports? E.g Should I instead make my own custom UInterchangeCUSTOMUsdTranslatorSettings inheriting from UInterchangeTranslatorBase and also my own custom pipeline? Or can I use existing UInterchangeGenericAssetsPipeline and somehow pass the new UInterchangeCUSTOMUsdTranslatorSettings to be used there during import?

Any guidance or best practices you can share for this workflow would be greatly appreciated.

Steps to Reproduce

Hi Marios,

You don’t need to modify the engine to do what you want. I’ve attached a sample Python script to show you how we do it. For your purpose, this can easily be translated to C++ or even Blueprint (this could make sense since you’re making an EUW).

The main takeaways are these:

  • To customize the translator settings (not specifically to the USD translator but in general for Interchange), you get the settings’ CDO (eg. UInterchangeUsdTranslatorSettings::StaticClass()->GetDefaultObject<UInterchangeUsdTranslatorSettings>()), modify the values you want to customize and save them (->SaveSettings()). If you look at the implementation of GetSettings() of any of the translators, you’ll see it will duplicate the CDO and call LoadSettings on it.
  • To customize pipeline settings, you duplicate the pipeline stack you need, modify the values you want to customize, then set the duplicated pipelines on the OverridePipelines property of the FImportAssetParameters that you pass to UInterchangeManager::ImportAsset().

And that’s it, you should be able to accomplish what you want.

As for your remaining question, settings that are specific to a translator will stay in the translator settings but anything that could use and be of benefit to a pipeline will be in the pipeline settings.

Hope this helps,

Anousack

Ah that makes more sense, great will try it and let you know if it worked! Looks quite simple as I have already figured out the pipeline override(second part) so was stuck on first part but seems straightforward to just grab CDO and modify and save before the import.

Thanks!

Thanks confirmed this worked!

Perfect!