Does asset converter take nucleus file paths

Hello, I’m trying to convert from usd to obj using Asset Converter. Template code is pasted below.

The thing is for the parameter input_asset_path, it seems it only takes file path from my local machine(e.g. /home/Desktop/something.usd), and can’t recognize a nucleus file (e.g. omniverse://localhost/something.usd). I’m wondering if it doesn’t support it at all or if there is any workaround to make it possible. Thank you!

It also takes stage_id as input_asset_path, I tried and it works, but in this way I have to manually open the usd stage every time (I have hundreds of usds to convert).

import async
import omni.kit.asset_converter

def progress_callback(current_step: int, total: int):
    # Show progress
    ...

async def convert(input_asset_path, output_asset_path):
    task_manager = converter.get_instance()
    task = task_manager.create_converter_task(input_asset_path, output_asset_path, progress_callback)
    success = await task.wait_until_finished()
    if not success:
        detailed_status_code = task.get_status()
        detailed_status_error_string = task.get_error_message()

Hi @Sirikk. Taking a look at this now.

I think this is working, but I have a related question out to the devs. I will get back to you as soon as I hear back.

@Sirikk I tried various cases:

  1. Local to Local
  2. Nucleus to Local
  3. Nucleus to Nucleus

and it all worked for me. This is the code snippet that tried in the Script Editor:

import asyncio
import omni.kit.asset_converter

def progress_callback(current_step: int, total: int):
    print("{} of {}".format(current_step, total))

async def convert(input_asset_path, output_asset_path):
    task_manager = omni.kit.asset_converter.get_instance()
    task = task_manager.create_converter_task(input_asset_path, output_asset_path, progress_callback)
    success = await task.wait_until_finished()
    if not success:
        detailed_status_code = task.get_status()
        detailed_status_error_string = task.get_error_message()
        print(detailed_status_error_string)

asyncio.ensure_future(convert(r"omniverse://localhost/Library/test.usd", r"omniverse://localhost/Library/test.obj"))

Let me know if that code snippet helps sort it out. If not, please provide more info that how/where you’re running the code as well as any addtional info listed here: How to Report an issue with Omniverse

Hi, @mati-nvidia thank you so much for the reply. I tried it out but unfortunately it still doesn’t work for me. I’m working on Ubuntu 20.04 and tried your code snippet in the script editor of both Isaac Sim 2.1 and Create 2022.1.1.

Here is the log I got. I set "omniverse://localhost/Projects/test.usd" as input_asset_path, but it seems the asset converter automatically attaches my home location in front of it when parsing, so the actual path it is looking for becomes "/home/myhomelocation/omniverse:/localhost/Projects/test.usd". I think that’s why it couldn’t find it.

2022-05-17 18:14:58  [Info] [omni.kit.asset_converter.impl.task_manager] Asset convert failed as /home/my_home_location/omniverse:/localhost/Projects/test.usd cannot be found.
2022-05-17 18:14:59  [Error] [omni.kit.asset_converter.impl.task_manager] Couldn't Import Asset: omniverse://localhost/Projects/test.usd, code: OmniConverterStatus.FILE_NOT_EXISTED, error:

Did I mess up something or should I report it as an issue? Thank you!

Thanks! That’s very helpful. The current state looks like Windows is working correctly and this is a new Linux bug. I’ve logged OM-51185 for this issue.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.