Starting with Pixyz Python API
Prerequisites
- Python 3.1 minimum. 3.10 or newer recommended
- or Visual Studio Code (website)
- Pixyz On-Prem SDK local package (public release in July 2024). For more information meanwhile, please contact your Unity Partner or Pixyz team.
- A valid Pixyz SDK license or entitlement on your Pixyz license portal.
Important
Pixyz SDK can be found here : https://unity3ddist.jfrog.io/ui/repos/tree/General/pixyz-generic-prod-local
Packages and other langages/OS will progressively be made available starting July 24, 2024.
Tip
For Unity internal staff, check our internal artifactory space here (Unity VPN needed).
Configuring your IDE
PyCharm
- Create a new project
- Locate your Pixyz SDK binaries folder on your machine or local dev environement
- Add Pixyz binaries folder to your interpreter path (check PyCharm documentation)
Visual Studio Code
- Create a new project
- Create a Python environment
- Set PYTHONPATH to the Pixyz binaries folder path (by adding an .env file to the project for example)
Activating the license and initializing the SDK
You must initialize the Pixyz SDK and bind it to a valid license.
import pxz
from pxz import core
# init Pixyz
# set log level to INFO so you can see the logs in the console
core.configureInterfaceLogger(True, True, True)
core.addConsoleVerbose(core.Verbose.INFO)
# if no license is found, try to configure a license server
if not core.checkLicense():
# add all tokens
for token in pxz.core.listTokens():
try:
core.needToken(token)
except:
pass