This Sample Omniverse Extension demonstrates how connect to an API.
In this sample, we create a palette of colors using the HueMint.com. API.
See the README for this extension to learn more about it including how to use it.
Follow a step-by-step tutorial that walks you through how to build this extension using asyncio and aiohttp.
To add this extension to your app:
-
Download or Clone the extension, unzip the file if downloaded
-
Create a New Extension
Linux:
./repo.sh template new
Windows:
.\repo.bat template new
- Follow the prompt instructions:
- ? Select with arrow keys what you want to create: Extension
- ? Select with arrow keys your desired template:: Python UI Extension
- ? Enter name of extension [name-spaced, lowercase, alphanumeric]:: omni.example.apiconnect
- ? Enter extension_display_name:: API Connect
- ? Enter version:: 0.1.0
- Add the Extension to an Application
In the newly created extension, copy and paste the omni.example.apiconnect
folder that was cloned into kit-app-template/sources/extensions/omni.example.apiconnect
.
You will be prompted if you want to replace files, select Replace All
.
To add your extension to an application, declare it in the dependencies section of the application's .kit
file:
[dependencies]
"omni.example.apiconnect" = {}
- Build with New Extensions
After a new extension has been added to the
.kit
file, the application should be rebuilt to ensure extensions are populated to the build directory.
Linux:
./repo.sh build
Windows:
.\repo.bat build
This extension uses the Huemint.com API. Huemint uses machine learning to create unique color schemes.
Special thanks to Jack Qiao for allowing us to use the Huemint API for this demonstration.
Check out Huemint.com
The source code for this repository is provided as-is and we are not accepting outside contributions.