Resolve#

Functions#

void omniClientAddDefaultSearchPath(char const *searchPath)

Add a default search path to the list of search paths used by resolve.

void omniClientFreeDefaultSearchPaths(char **dsp)

Free the default search paths list returned by omniClientGetDefaultSearchPaths2 .

char const * omniClientGetBaseUrl()

Returns the top of the base URL stack.

uint32_t omniClientGetDefaultSearchPaths(char const **searchPaths, uint32_t maxSearchPaths)

Deprecated: Use omniClientGetDefaultSearchPaths2 .

char ** omniClientGetDefaultSearchPaths2()

Retrieve the current list of default search paths.

bool omniClientPopBaseUrl(char const *baseUrl)

Pop a base URL from the context stack.

void omniClientPushBaseUrl(char const *baseUrl)

Push a base URL for relative URLs to resolve against.

void omniClientRemoveDefaultSearchPath(char const *searchPath)

Remove a default search path from the list of search paths used by resolve.

OmniClientRequestId omniClientResolve(char const *relativePath, char const *const *searchPaths, uint32_t numSearchPaths, void *userData, OmniClientResolveCallback callback)

Resolve operates similarly to stat with one major difference.

OmniClientRequestId omniClientResolveSubscribe(char const *relativePath, char const *const *searchPaths, uint32_t numSearchPaths, void *userData, OmniClientResolveCallback callback, OmniClientResolveSubscribeCallback subscribeCallback)

Resolve an item, and subscribe to future changes.

Typedefs#

OmniClientResolveCallback

This is called with the result of omniClientResolve or omniClientResolveSubscribe .

OmniClientResolveSubscribeCallback

This is called any time an item you've subscribed to with omniClientResolveSubscribe changes.

Functions#

void omniClientAddDefaultSearchPath(char const *searchPath)#

Add a default search path to the list of search paths used by resolve.

New default search paths are added to the top of the stack (meaning they will match before older default search paths), but all default search paths are underneath the searchPaths explicitly provided to resolve.

If this searchPath is already in the list, it is moved to the top

Parameters:

searchPath – The search path to add

void omniClientFreeDefaultSearchPaths(char **dsp)#

Free the default search paths list returned by omniClientGetDefaultSearchPaths2.

Parameters:

dsp – The list of default search paths to free

char const *omniClientGetBaseUrl()#

Returns the top of the base URL stack.

Returns nullptr if the stack is empty

Returns:

The base URL at the top of the stack, or nullptr if the stack is empty

uint32_t omniClientGetDefaultSearchPaths(
char const **searchPaths,
uint32_t maxSearchPaths,
)#

Deprecated: Use omniClientGetDefaultSearchPaths2.

Parameters:
  • searchPaths – Array to receive the search paths

  • maxSearchPaths – Maximum number of search paths to return

Returns:

The number of search paths returned

char **omniClientGetDefaultSearchPaths2()#

Retrieve the current list of default search paths.

The list is null terminated. Each string is also null terminated.

Use omniClientFreeDefaultSearchPaths to free the returned list

Returns:

A null-terminated array of search path strings

bool omniClientPopBaseUrl(char const *baseUrl)#

Pop a base URL from the context stack.

If the provided base URL is not on the top of the stack, a warning will be printed to the log and this will return false

Parameters:

baseUrl – The base URL to pop from the stack

Returns:

true if the URL was successfully popped, false otherwise

void omniClientPushBaseUrl(char const *baseUrl)#

Push a base URL for relative URLs to resolve against.

For example if you push “omniverse://sandbox.ov.nvidia.com/path/” then calling omniList(“subpath”) will return the results of “omniverse://sandbox.ov.nvidia.com/path/subpath”. The rules for combining a relative URL with a base URLs is defined by https://tools.ietf.org/html/rfc3986 and is the same as a web browser would resolve links inside an HTML document. ** Note that the context is per-thread! ** This is so you can load resources on different threads with different base URLs

Parameters:

baseUrl – The base URL to push onto the stack

void omniClientRemoveDefaultSearchPath(char const *searchPath)#

Remove a default search path from the list of search paths used by resolve.

Parameters:

searchPath – The search path to remove

OmniClientRequestId omniClientResolve(
char const *relativePath,
char const *const *searchPaths,
uint32_t numSearchPaths,
void *userData,
OmniClientResolveCallback callback,
)#

Resolve operates similarly to stat with one major difference.

You may pass an (ordered) list of paths that are searched if the item is not found. The search paths may be a full URL, or a partial URL. If it’s a partial URL, it will be combined with the base URL (set with omniClientPushBaseUrl)

For example, given a base URL of omniverse://sandbox.ov.nvidia.com/project/stage.usd and a relative path of wood/oak.mdl with the following search paths:

  1. materials/

  2. /materials/

  3. omniverse://ov-materials/

  4. file:/c:/materials/

This function will search in the following places:

  1. omniverse://sandbox.ov.nvidia.com/project/wood/oak.mdl

  2. omniverse://sandbox.ov.nvidia.com/project/materials/wood/oak.mdl

  3. omniverse://sandbox.ov.nvidia.com/materials/wood/oak.mdl

  4. omniverse://ov-materials/wood/oak.mdl

  5. file:/c:/materials/wood/oak.mdl

And given the same search paths and relative path, but with a base URL of file:/c:/projects/a/stage.usd

This function will search in the following places:

  1. file:/c:/projects/a/wood/oak.mdl

  2. file:/c:/projects/a/materials/wood/oak.mdl

  3. file:/c:/materials/wood/oak.mdl

  4. omniverse://ov-materials/wood/oak.mdl

  5. file:/c:/materials/wood/oak.mdl

If found, the “url” passed to the callback will be the FULL URL of the item that was found.

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • relativePath – The relative path to resolve

  • searchPaths – Array of search paths to try

  • numSearchPaths – Number of search paths in the array

  • userData – User data passed to the callback

  • callback – The callback function to register

Returns:

A request ID that can be used with omniClientStop

OmniClientRequestId omniClientResolveSubscribe(
char const *relativePath,
char const *const *searchPaths,
uint32_t numSearchPaths,
void *userData,
OmniClientResolveCallback callback,
OmniClientResolveSubscribeCallback subscribeCallback,
)#

Resolve an item, and subscribe to future changes.

Note

If this function is called after omniClientShutdown, kInvalidRequestId will be returned, and the callback will not be called.

Parameters:
  • relativePath – The relative path to resolve

  • searchPaths – Array of search paths to try

  • numSearchPaths – Number of search paths in the array

  • userData – User data passed to the callbacks

  • callback – The callback function for the initial resolve result

  • subscribeCallback – The callback function for subscription updates

Returns:

A request ID that can be used with omniClientStop

Typedefs#

typedef void (*OmniClientResolveCallback)(void *userData, OmniClientResult result, struct OmniClientListEntry const *entry, char const *url)#

This is called with the result of omniClientResolve or omniClientResolveSubscribe.

typedef void (*OmniClientResolveSubscribeCallback)(void *userData, OmniClientResult result, OmniClientListEvent listEvent, struct OmniClientListEntry const *entry, char const *url)#

This is called any time an item you’ve subscribed to with omniClientResolveSubscribe changes.