Hi,
I built a KIT service from KIT-APP-TEMPLATE and wrote an API endpoint to open a USD file from a nucleus server.
However, after containerizing and deploying it to the server, I was unable to open the USD file located at the path 'omniverse://40.71.177.24/Projects/Bouygues/
Does anyone have any idea how to solve it?
Here are the logs:
sh: 1: xdg-open: not found
2024-12-18 08:16:53 [17,693ms] [Warning] [carb.omniclient.plugin] Tick: provider_nucleus: Failed to launch browser (err=32512)!
2024-12-18 08:16:53 [17,694ms] [Error] [omni.usd] Failed to open : omniverse://40.71.177.24/Projects/Bouygues/Bouygues.usd
2024-12-18 08:16:53 [17,694ms] [Error] [omni.usd] Open USD error: Failed to open:omniverse://40.71.177.24/Projects/Bouygues/Bouygues.usd
My code script:
async def open_usd(request: OpenUSDRequest):
file_path = request.file_path
try:
def process_url(url):
# Using a single leading `.` to signify that the path is
# relative to the ${app} token's parent directory.
if url.startswith(("./", ".\\")):
return carb.tokens.acquire_tokens_interface().resolve(
"${app}/.." + url[1:]
)
return url
stage = omni.usd.get_context().get_stage()
current_stage = stage.GetRootLayer().identifier if stage else ''
# If we are, we don't need to reload the file, instead we'll just send the success message.
if omni.client.utils.equal_urls(file_path, current_stage):
return {
"status": "success",
"message": f"Client requested to open a stage that is already open: {file_path}"
}
# Open the USD stage
success = omni.usd.get_context().open_stage(process_url(file_path))
if not success:
return {
"status": "error",
"message": f"Failed to open USD file at {file_path}"
}
return {
"status": "success",
"message": f"USD file at {file_path} has been successfully opened."
}
except Exception as e:
return {
"status": "success",
"message": f"Error while opening USD file: {str(e)}"
}