Resolve
Functions
- void omniClientAddDefaultSearchPath(char const *searchPath)
Add a default search path to the list of search paths used by resolve.
- char const * omniClientGetBaseUrl()
Returns the top of the base URL stack.
- uint32_t omniClientGetDefaultSearchPaths(char const **searchPaths, uint32_t maxSearchPaths)
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
-
char const *omniClientGetBaseUrl()
Returns the top of the base URL stack.
Returns nullptr if the stack is empty
-
uint32_t omniClientGetDefaultSearchPaths(char const **searchPaths, uint32_t maxSearchPaths)
Retrieve the current list of default search paths.
The ‘searchPaths’ buffer will be filled with pointers to the default search path strings up to ‘maxSearchPaths’ and this will return the number of default search paths. If the return value is > maxSearchPaths then you should call it again with a larger buffer. The returned pointers are stable unless/until you add or remove a default search path
-
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
-
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
-
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.
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.usdand a relative path ofwood/oak.mdlwith the following search paths:materials//materials/omniverse://ov-materials/file:/c:/materials/
This function will search in the following places:
omniverse://sandbox.ov.nvidia.com/project/wood/oak.mdlomniverse://sandbox.ov.nvidia.com/project/materials/wood/oak.mdlomniverse://sandbox.ov.nvidia.com/materials/wood/oak.mdlomniverse://ov-materials/wood/oak.mdlfile:/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.usdThis function will search in the following places:
file:/c:/projects/a/wood/oak.mdlfile:/c:/projects/a/materials/wood/oak.mdlfile:/c:/materials/wood/oak.mdlomniverse://ov-materials/wood/oak.mdlfile:/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.
-
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.
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.