USDtoOBJ

Trying to read a USD (usdtoobj) file but getting this error message:

(TfDiagnosticType)1: in _CreateResolver at line 158 of /Volumes/Projects/Dev/USD/pxr/usd/ar/resolver_v1.cpp – Invalid resolver type
(TfDiagnosticType)1: in _RegisterFormatPlugins at line 189 of /Volumes/Projects/Dev/USD/pxr/usd/sdf/fileFormatRegistry.cpp – Failed verification: ’ !formatBaseType.IsUnknown() ’
(TfDiagnosticType)1: in _CreateNew at line 422 of /Volumes/Projects/Dev/USD/pxr/usd/sdf/layer.cpp – Failed verification: ’ fileFormat ’

Hello amir6l10x,
Thank you for the post, I will bring your inquiry to the proper channels for review.
Thank you for your patience.

Hello @amir_tamadon! Right now, usdObj is not ‘formally’ packaged as part of Omniverse Kit/Create. The developers are currently discussing how to include it in future releases.

Our current workflows for OBJ involve using the Content Browser. More information can be found here: Content Browser — Omniverse Create documentation

If you’re looking to convert your USD stage to OBJ, you can use the export function in the file menu.


No that’s not what I meant :D
We are looking for the export tool in the SDK and not the UI.

Thanks, Wendy! Can you please update this post as soon as you hear back from the dev team?

Will do. Thanks for your patience regarding this!

@amir You can access the export tool with extension omni.kit.assert_converter. Here is an example about how to use it:

import omni.kit.asset_converter as converter

def progress_callback(progress, total_steps):
    pass

async def your_async_func(input_asset, output_usd_file)
    task_manager = converter.get_instance()
    # You can customize the import/export options with context
    context = converter.AssetConverterContext()
    task = task_manager.create_converter_task(input_asset, output_file, progress_callback, context)
    success = await task.wait_until_finished()
    if not success:
        detailed_status_code = task.get_status()
        detailed_status_error_string = task.get_detailed_error()

You can convert from obj/gltf/fbx to usd or usd to obj/gftf/fbx.

@rozhang Many thanks for your help, but we are looking for a C++ example. Could you please help?

@amir_tamadon Sorry, we don’t ship c++ header/APIs yet. We’ll get back to you later if we have any decision for future release. Right now, you’d have to use python APIs. Or you’d have to load those APIs from DLL or SO directly, which you can get from extension omni.kit.asset_converter under your Create install. But that’s too tricky.

@amir_tamadon After discussion, we have other solution for you, you can call python snippet from c++ still. There is an python helper that’s shipped with Create or Kit SDK, which is included inside the include dir named “omni/kit/PythonInterOpHelper.h”. You can refer that to build your python helper in c++ to call the example provided above to convert your asset.

Thanks. Let me know if you need other helps.

1 Like

Awesome, will keep you posted.