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.
Thanks!