Nvidia USD asset cannot be added to stage via python scripting

Hello all.
I’m having a problem adding an Nvidia USD asset to a stage via scripting. I can add the asset to the stage by dragging it on the GUI, or by clicking “file” → “add reference”, but it doesn’t work via the scripting window.
I’m using the following code:

from omni.isaac.core.utils.nucleus import get_assets_root_path
from omni.isaac.core.utils.stage import add_reference_to_stage
from omni.isaac.core.world import World
from omni.isaac.core.objects.ground_plane import GroundPlane
world = World()
GroundPlane(prim_path=“/World/groundPlane”, size=10, color=np.array([0.5, 0.5, 0.5]))
assets_root_path = get_assets_root_path()
leaf_asset_path = assets_root_path + “/Vegetation/Debris/oakfall1.usd”
add_reference_to_stage(usd_path=leaf_asset_path, prim_path=“/World/leaf”)

I tested the above code with one of my own 3D models and it worked just fine. But when trying to the the Nvidia one: “omniverse://localhost/NVIDIA/Assets/Vegetation/Debris/oakfall1.usd”, it doesn’t work. A reference is added called “leaf” but the object or any of the visuals are not present. I get the error:

[Warning] [omni.usd] Warning: in _ReportErrors at line 2830 of C:\b\w\ca6c508eae419cf8\USD\pxr\usd\usd\stage.cpp – Could not open asset @omniverse://localhost/NVIDIA/Assets/Isaac/2022.2.1/Vegetation/Debris/oakfall1.usd@ for reference on prim @anon:0000027FE534C500:World3.usd@,@anon:0000027FE534C230:World3-session.usda@</World/leaf>. (recomposing stage on stage @anon:0000027FE534C500:World3.usd@ <0000027FDE461390>)

Any help would be appreciated as I’d like to be able to use Nvidia’s defaults assets when testing things out.

Hi @seyi.ooj - The error message suggests that the USD stage cannot open the asset at the given path for reference. It could be due to several reasons, such as access permissions, the asset path being incorrect, or the asset not being available on the server. Here are some steps to debug and resolve the issue:

  1. Verify the Asset Path: Make sure that the asset path is correct. The path you are using in the script seems to differ from the one mentioned in the error message. The correct path should be:

You need to ensure that this path is exactly correct and corresponds to the actual location of the asset on your Nucleus server (Omniverse content server).

  1. Nucleus Server Connection: Verify that your Nucleus server (Omniverse content server) is running and that you are connected to it. Sometimes the connection might drop or not be established, which would result in an error when trying to access assets on it.
  2. Asset Availability: Ensure that the asset is available on the Nucleus server and that you have the required permissions to access it.
  3. Update Your Script: Adjust the leaf_asset_path to use the appropriate Omniverse URL. For example:
leaf_asset_path = "omniverse://localhost/NVIDIA/Assets/Vegetation/Debris/oakfall1.usd"
add_reference_to_stage(usd_path=leaf_asset_path, prim_path="/World/leaf")
1 Like

Thanks very much for your help. It was path issue in the end where I needed to use full adress “omniverse://localhost/NVIDIA/Assets/Vegetation/Debris/oakfall1.usd” instead of using get_assets_root_path.

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