### Get Started with AYON Python API Source: https://docs.ayon.dev/docs/dev_api_python This snippet shows how to install the AYON Python API, set up environment variables for server connection, and make a basic API call to get a list of projects. ```APIDOC ## Get Started Install the library: ``` pip install ayon-python-api ``` Example usage: ```python import os import ayon_api # Set necessary environment variables os.environ["AYON_SERVER_URL"] = "" os.environ["AYON_API_KEY"] = "" # Make the connection con = ayon_api.get_server_api_connection() # Get a list of available projects projects = con.get_projects() print(projects) ``` ``` -------------------------------- ### Upload Installer to Server (Windows) Source: https://docs.ayon.dev/docs/dev_launcher Use this command to upload installer information and the installer file to the AYON server on Windows. Ensure you are in the AYON launcher repository clone. ```powershell cd ./tools/manage.ps1 upload --server --api-key ``` -------------------------------- ### Run C++ Example Source: https://docs.ayon.dev/docs/dev_api_cpp Command to execute the compiled C++ example application. ```bash build\Debug\main.exe ``` -------------------------------- ### Build C++ Example Project Source: https://docs.ayon.dev/docs/dev_api_cpp Commands to configure and build the C++ example project using CMake. ```bash rmdir /s /q build cmake -S . -B build -DJTRACE=0 cmake --build ./build --config Debug -j12 ``` -------------------------------- ### Example Output of C++ Application Source: https://docs.ayon.dev/docs/dev_api_cpp Sample output from running the C++ example, showing project and URI resolution. ```text Enter a project: Animal_Logic_ALab Enter a uri to resolve: ayon+entity://Animal_Logic_ALab/assets/book_encyclopedia01?product=usdAsset&version=v002&representation=usd The resolved path: H:\AYON\projects\Animal_Logic_ALab\assets\book_encyclopedia01\publish\usd\usdAsset\v002\ALA_book_encyclopedia01_usdAsset_v002.usd ``` -------------------------------- ### Custom Tray Widget Example Source: https://docs.ayon.dev/docs/dev_addon_creation Demonstrates the initial setup for creating a custom tray widget by inheriting from `AYONAddon` and `ITrayAddon`. This allows you to add custom UI elements to the AYON tray menu. ```python from qtpy import QtWidgets from ayon_core.addon import AYONAddon, ITrayAddon ``` -------------------------------- ### Upload Installer to Server (Linux/MacOS) Source: https://docs.ayon.dev/docs/dev_launcher Use this command to upload installer information and the installer file to the AYON server on Linux and MacOS. Ensure you are in the AYON launcher repository clone. ```bash cd ./tools/make.sh upload --server --api-key ``` -------------------------------- ### Install Playwright Source: https://docs.ayon.dev/docs/server_testing Run this command to install Playwright and set up the testing environment. Defaults are generally safe choices. ```bash yarn create playwright ``` -------------------------------- ### Start Ayon Instances Source: https://docs.ayon.dev/docs/addon_aquarium_developer Start the Ayon instances using Docker Compose from the Ayon Docker repository. Refer to the repository's README for detailed instructions. ```bash docker compose up --build ``` -------------------------------- ### AYON C++ API Main Function Example Source: https://docs.ayon.dev/docs/dev_api_cpp Demonstrates how to initialize the AyonApi, resolve a path, and handle user input in C++. ```cpp // AYON CPP API Test #include #include "AyonCppApi.h" int main (){ std::string project_name = "" ; std::cout << "Enter a project: "; std::cin >> project_name; AyonApi con = AyonApi( "log/log.json", // extension will be always changed to json "your_access_token", // This is a Bearer access token not AYON_API_KEY "https://your.server", // with No trailing or forward slash at the end. project_name, "your-site-id" // Your site id e.g. military-mouse-of-jest ); std::string uri = "" ; std::cout << "Enter a uri to resolve: "; std::cin >> uri; std::pair resolvedAsset = con.resolvePath(uri); std::cout << "The resolved path: " << resolvedAsset.second << std::endl; return 0; } ``` -------------------------------- ### Install MayaHost Integration Source: https://docs.ayon.dev/docs/dev_host_implementation Initialize and install the MayaHost class within the Maya startup script. This registers the host with the AYON pipeline, making it accessible globally. ```python from ayon.pipeline import install_host from ayon.hosts.maya.api import MayaHost host = MayaHost() install_host(host) ``` -------------------------------- ### Install ayon-python-api Source: https://docs.ayon.dev/docs/dev_api_python Install the AYON Python API using pip. ```bash pip install ayon-python-api ``` -------------------------------- ### Create AYON Installer Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Generates an installer package for AYON, which includes a .dmg file and a .json metadata file. The installer is created in the './build/installer/' directory. ```bash ./tools/make.sh make-installer ``` -------------------------------- ### Create AYON Installer Source: https://docs.ayon.dev/docs/dev_launcher_build_windows This command generates a distributable installer for AYON. The output files, including an .exe and a .json metadata file, will be in the `./build/installer/` directory. ```powershell ./tools/manage.ps1 make-installer ``` -------------------------------- ### Example Event Summary for entity.folder.created Source: https://docs.ayon.dev/docs/dev_event_system This example shows a typical JSON summary for an event where a folder has been created. The structure is consistent for a given topic. ```json { "id": "ID_OF_THE_NEW_CREATED_FOLDER" } ``` -------------------------------- ### Install Development Tools on Ubuntu Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Installs essential build tools like git, cmake, and curl on Ubuntu systems. Includes optional Qt5 development libraries if needed for XCB compatibility. ```bash sudo apt install build-essential checkinstall ``` ```bash sudo apt install git cmake curl ``` ```bash sudo apt install qt5-default ``` ```bash sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools ``` -------------------------------- ### C++ Example Project Structure Source: https://docs.ayon.dev/docs/dev_api_cpp Illustrates the typical directory structure for a C++ project using the AYON C++ API. ```text . ├─ ext/ayon-cpp-api ├─ CMakelists.txt └─ main.cpp ``` -------------------------------- ### Add Endpoint Example Source: https://docs.ayon.dev/docs/dev_addon_creation This example demonstrates how to add a custom GET endpoint named 'studio-data' to an AYON addon. The endpoint returns a JSON response containing a secret and the current user's name. ```APIDOC ## GET /api/addons/{addon_name}/{addon_version}/studio-data ### Description Returns a predefined secret and the name of the currently authenticated user. ### Method GET ### Endpoint /api/addons/{addon_name}/{addon_version}/studio-data ### Parameters #### Path Parameters - **addon_name** (string) - Required - The name of the addon. - **addon_version** (string) - Required - The version of the addon. #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **secret-of-the-studio** (string) - A hardcoded secret string. - **Current User** (string) - The username of the authenticated user. #### Response Example { "secret-of-the-studio": "There is no secret", "Current User": "example_user" } ``` -------------------------------- ### Install Frontend Dependencies Source: https://docs.ayon.dev/docs/dev_addon_creation Install necessary npm packages for an Ayon frontend, including the React addon provider, components, styled-components, and axios. ```bash npm i @ynput/ayon-react-addon-provider npm i @ynput/ayon-react-components npm i styled-components npm i axios ``` -------------------------------- ### Prepare AYON Environment Source: https://docs.ayon.dev/docs/dev_launcher_build_windows These commands set up a virtual environment and install necessary Python runtime dependencies for AYON. ```powershell ./tools/manage.ps1 create-env ``` ```powershell ./tools/manage.ps1 install-runtime-dependencies ``` -------------------------------- ### Create AYON Installer Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Generates a distributable installer package for AYON. The output includes a .dmg file and a .json metadata file for server integration. ```bash ./tools/make.sh make-installer ``` -------------------------------- ### Create and Install Runtime Dependencies Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Creates a virtual environment in the './.venv' directory and installs Python runtime dependencies such as PySide and Pillow using the provided 'make.sh' script. ```bash ./tools/make.sh create-env ./tools/make.sh install-runtime-dependencies ``` -------------------------------- ### Install Homebrew Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Installs Homebrew, a package manager for macOS, which is used to install other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install Python Build Dependencies and Version Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Installs necessary build dependencies for Python and then installs a specific Python 3.9.x version using pyenv. Replace '3.9.6' with the desired up-to-date version. ```bash # install Python build dependences brew install openssl readline sqlite3 xz zlib # replace with up-to-date 3.9.x version pyenv install 3.9.6 ``` -------------------------------- ### Connect to AYON Server and Get Projects Source: https://docs.ayon.dev/docs/dev_api_python Connect to the AYON server using environment variables and retrieve a list of available projects. Ensure AYON_SERVER_URL and AYON_API_KEY are set. ```python import os import ayon_api # Set necessary environment variables os.environ["AYON_SERVER_URL"] = "" os.environ["AYON_API_KEY"] = "" # Make the connection con = ayon_api.get_server_api_connection() # Get a list of available projects projects = con.get_projects() print(projects) ``` -------------------------------- ### Install CMake with Homebrew Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Installs CMake, a cross-platform build system generator, using Homebrew. ```bash brew install cmake ``` -------------------------------- ### Addon Server Settings Model Example Source: https://docs.ayon.dev/docs/dev_addon_creation Demonstrates how to define settings for an AYON addon server using Pydantic models and `SettingsField` for scope. ```python from typing import Type from ayon_server.addons import BaseServerAddon from ayon_server.settings import ( BaseSettingsModel, SettingsField ) ``` -------------------------------- ### Run AYON Launcher with Specific Bundle Source: https://docs.ayon.dev/docs/dev_dev_mode Alternatively, start the AYON launcher using a specific developer bundle by name with the --bundle argument. ```bash AYON launcher --bundle ``` -------------------------------- ### Install and Configure pyenv Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Installs pyenv using a curl script and configures the shell environment to manage Python versions. Includes installing a specific Python version and setting it locally for a project. ```bash curl https://pyenv.run | bash ``` ```bash # you can add those to ~/.bashrc ``` ```bash export PATH="$HOME/.pyenv/bin:$PATH" ``` ```bash eval "$(pyenv init -)" ``` ```bash eval "$(pyenv virtualenv-init -)" ``` ```bash # reload shell ``` ```bash exec $SHELL ``` ```bash # install Python 3.9.x ``` ```bash pyenv install -v 3.9.6 ``` ```bash # change path to repository ``` ```bash cd /path/to/OpenPype ``` ```bash # set local python version ``` ```bash pyenv local 3.9.6 ``` -------------------------------- ### Install Development Tools on CentOS Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Installs essential build tools like git and cmake on CentOS systems. Includes optional Qt5 development libraries if needed for XCB compatibility. ```bash sudo yum install qit cmake ``` ```bash sudo yum install qt5-qtbase-devel ``` -------------------------------- ### Prepare AYON Environment Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Creates a virtual environment in the './.venv' directory and installs Python runtime dependencies required for AYON, such as PySide and Pillow. ```bash ./tools/make.sh create-env ``` ```bash ./tools/make.sh install-runtime-dependencies ``` -------------------------------- ### Run AYON Launcher with Dev Mode Source: https://docs.ayon.dev/docs/dev_dev_mode Start the AYON launcher with the --use-dev argument to utilize the assigned developer bundle and local addon code. ```bash "C:/Users/MyUser/AppData/Local/Ynput/AYON/app/AYON 1.0.0-beta.6/ayon.exe" --use-dev ``` -------------------------------- ### Example Publish Plugin with Attribute Definitions Source: https://docs.ayon.dev/docs/dev_publishing An example of a Python publish plugin that inherits from OpenPypePyblishPluginMixin to define custom attributes. This allows attributes to be shown in 'CreatedInstance' and can be used to control plugin behavior, such as enabling/disabling optional plugins. ```python import pyblish.api from ayon.lib import attribute_definitions from ayon.pipeline import OpenPypePyblishPluginMixin ``` -------------------------------- ### CLI Commands for Addon (Windows) Source: https://docs.ayon.dev/docs/dev_addon_creation Examples of how to execute custom CLI commands for your AYON addon on Windows using `ayon_console.bat` in development mode. ```bash ayon-launcher/tools/ayon_console.bat --use-dev addon my_addon some_command ayon-launcher/tools/ayon_console.bat --use-dev addon my_addon command-with-arg --arg1 some_argument ``` -------------------------------- ### Install Python Build Dependencies on Ubuntu Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Installs necessary libraries for building Python with pyenv on Ubuntu, including SSL, zlib, bz2, readline, and others. ```bash sudo apt-get update; sudo apt-get install --no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ``` -------------------------------- ### Run AYON (Linux/MacOS Executable) Source: https://docs.ayon.dev/docs/dev_launcher Launch the AYON application on Linux or MacOS. Ensure you are in the AYON launcher installation directory. ```bash cd ayon ``` -------------------------------- ### Example log.json Content Source: https://docs.ayon.dev/docs/dev_api_cpp Illustrates the structure and content of the log file generated by the AYON C++ API. ```json {"timestamp":"2025-04-07 13:24:48.368","level":"info","Thread Id":"5832","Process Id":"13732","message":"Connected to the Ayon server : 200"} {"timestamp":"2025-07-18 18:14:56.645","level":"warning","Thread Id":"34840","Process Id":"40096","message":"asset identification cant be generated {"entities":[],"error":"Invalid scheme: h","uri":"H:\\AYON\\projects\\Animal_Logic_ALab\\assets\\book_encyclopedia01\\publish\\usd\\usdAsset\\v002\\ALA_book_encyclopedia01_usdAsset_v002.usd"}"} {"timestamp":"2025-07-18 18:16:17.522","level":"warning","Thread Id":"564","Process Id":"37400","message":"asset identification cant be generated {"entities":[{}],"uri":"ayon+entity://Animal_Logic_ALab/assets/book_encyclopedia01?product=usdAsset"}"} {"timestamp":"2025-07-18 18:16:48.017","level":"warning","Thread Id":"33948","Process Id":"38436","message":"asset identification cant be generated {"entities":[],"error":"Invalid scheme: ","uri":"{root[work]}/Animal_Logic_ALab/assets/book_encyclopedia01/work/lookdev/ALA_book_encyclopedia01_lookdev_v001.hip"}"} ``` -------------------------------- ### Install pyenv with Homebrew Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Installs pyenv, a tool for managing multiple Python versions, and configures the shell to use it. This is recommended for managing Python versions for AYON development. ```bash brew install pyenv echo 'eval "$(pyenv init -)""' >> ~/.zshrc pyenv init exec "$SHELL" PATH=$(pyenv root)/shims:$PATH ``` -------------------------------- ### CLI Commands for Addon (Linux & MacOS) Source: https://docs.ayon.dev/docs/dev_addon_creation Examples of how to execute custom CLI commands for your AYON addon on Linux and MacOS using `make.sh` in development mode. ```bash ayon-launcher/tools/make.sh --use-dev addon my_addon some_command ayon-launcher/tools/make.sh --use-dev addon my_addon command-with-arg --arg1 some_argument ``` -------------------------------- ### Get list of projects Source: https://docs.ayon.dev/docs/dev_api_rest Retrieve a list of available projects in AYON. Requires authentication. ```APIDOC ## GET /api/projects ### Description Retrieves a list of all available projects. ### Method GET ### Endpoint `/api/projects` ### Parameters #### Query Parameters None explicitly documented. ### Response #### Success Response (200) - **projects** (array) - A list of project objects. ``` -------------------------------- ### Implement Custom Render Creator Plugin Source: https://docs.ayon.dev/docs/dev_publishing Example of a custom `Creator` plugin for rendering. It defines families, labels, icons, and descriptions, and customizes instance attribute definitions based on project settings like farm rendering availability. ```python from ayon.lib import attribute_definitions from ayon.pipeline.create import Creator class CreateRender(Creator): family = "render" label = "Render" icon = "fa.eye" description = "Render scene viewport" def __init__( self, context, system_settings, project_settings, *args, **kwargs ): super(CreateRender, self).__init__( context, system_settings, project_settings, *args, **kwargs ) plugin_settings = ( project_settings["my_host"]["create"][self.__class__.__name__] ) # Get information if studio has enabled farm publishing self._allow_farm_render = plugin_settings["allow_farm_render"] # Get default variants from settings self.default_variants = plugin_settings["variants"] def get_instance_attr_defs(self): # Return empty list if '_allow_farm_render' is not enabled (can be set during initialization) if not self._allow_farm_render: return [] # Give artist option to change if should be rendered on farm or locally return [ attribute_definitions.BoolDef( "render_farm", default=False, label="Render on Farm" ) ] def get_pre_create_attr_defs(self): # Give user option to use selection or not attrs = [ attribute_definitions.BoolDef( "use_selection", default=False, label="Use selection" ) ] if self._allow_farm_render: # Set to render on farm in creator dialog # - this value is not automatically passed to instance attributes # creator must do that during creation attrs.append( attribute_definitions.BoolDef( "render_farm", default=False, label="Render on Farm" ) ) return attrs def create(self, product_name, instance_data, pre_create_data): # ARGS: # - 'product_name' - precalculated product name # - 'instance_data' - context data # - 'asset' - asset name # - 'task' - task name # - 'variant' - variant # - 'family' - instance family # Check if should use selection or not if pre_create_data.get("use_selection"): items = pipeline.get_selection() else: items = [pipeline.create_write()] # Validations related to selection if len(items) > 1: raise CreatorError("Please select only single item at time.") ``` -------------------------------- ### Configure Addon Server with Frontend Scopes Source: https://docs.ayon.dev/docs/dev_addon_creation Define frontend access scopes by adding the `frontend_scopes` attribute to your addon's server initialization. This example sets up a scope for 'settings'. ```python from typing import Any from ayon_server.addons import BaseServerAddon class MyAddonSettings(BaseServerAddon): # Set settings frontend_scopes: dict[str, Any] = {"settings": {}} ``` -------------------------------- ### Run AYON Launcher with Executable Arguments Source: https://docs.ayon.dev/docs/dev_launcher Execute AYON launcher from the terminal using its executable and various arguments. Ensure you are in the AYON launcher installation directory. These commands are applicable to Windows, Linux, and macOS. ```bash cd ./ayon.exe ``` ```bash cd ./ayon_console.exe ``` ```bash cd ayon ``` -------------------------------- ### Pyblish Context Plugin Example Source: https://docs.ayon.dev/docs/dev_publishing Defines a Pyblish context plugin with optional processing and attribute definitions. Use this as a base for custom publishing logic. ```python class MyExtendedPlugin( pyblish.api.ContextPlugin, OpenPypePyblishPluginMixin ): optional = True active = True @classmethod def get_attribute_defs(cls): return [ attribute_definitions.BoolDef( # Key under which it will be stored "process", # Use 'active' as default value default=cls.active, # Use plugin label as label for attribute label=cls.label ) ] def process_plugin(self, context): # First check if plugin is optional if not self.optional: return True # Attribute values are stored by class names # - for those purposes was implemented 'get_attr_values_from_data' # to help with accessing it attribute_values = self.get_attr_values_from_data(context.data) # Get 'process' key process_value = attribute_values.get("process") if process_value is None or process_value: return True return False def process(self, context): if not self.process_plugin(context): return # Do plugin logic ... ``` -------------------------------- ### Minimalist AYONAddon Client Definition Source: https://docs.ayon.dev/docs/dev_addon_creation Implement the `AYONAddon` abstract class to define your addon's core structure. This includes setting basic properties like label, name, and version. The `initialize` method is optional for addon setup. ```python from ayon_core.addon import AYONAddon # `version.py` should be created by `create_package.py` by default. # if it's not created, please, create an empty file # next to __init__.py named `version.py` # and `create_package.py` will update its content. from .version import __version__ class MyAddonCode(AYONAddon): """My addon class.""" label = "My Addon" name = "my_addon" version = __version__ def initialize(self, settings): """Initialization of addon attributes. It is not recommended to override __init__ that's why specific method was implemented. Note: This method is optional. Args: settings (dict[str, Any]): Settings. These settings that were defined in `MyAddonSettings.settings_model` in the server dir. """ pass ``` -------------------------------- ### Configure Local Environment Variables for Testing Source: https://docs.ayon.dev/docs/server_testing Update your local ENV file with these variables to configure test server URLs and authentication. URLS and ports may vary per setup. ```bash LOCAL_SERVER_URL=http://localhost:3000 TEST_SERVER_URL=https://localhost:5000 NAME=admin #authentication user PASSWORD=pass #authentication password ``` -------------------------------- ### Implement Loader with Colorspace Data Handling Source: https://docs.ayon.dev/docs/dev_colorspace Loader plugins should process 'colorspaceData' from representations to load files in the correct color space. This example shows how to retrieve and use file rules to determine the colorspace. ```python from ayon.pipeline.colorspace import ( get_imageio_colorspace_from_filepath, get_imageio_config, get_imageio_file_rules ) class YourLoader(api.Loader): def load(self, context, name=None, namespace=None, options=None): path = self.fname colorspace_data = context["representation"]["data"].get("colorspaceData", {}) colorspace = ( colorspace_data.get("colorspace") # try to match colorspace from file rules or self.get_colorspace_from_file_rules(path, context) ) # pseudocode load_file(path, colorspace=colorspace) def get_colorspace_from_file_rules(self, path, context) project_name = context.data["projectName"] host_name = context.data["hostName"] anatomy_data = context.data["anatomyData"] project_settings_ = context.data["project_settings"] config_data = get_imageio_config( project_name, host_name, project_settings=project_settings_, anatomy_data=anatomy_data ) file_rules = get_imageio_file_rules( project_name, host_name, project_settings=project_settings_ ) # get matching colorspace from rules colorspace = get_imageio_colorspace_from_filepath( path, host_name, project_name, config_data=config_data, file_rules=file_rules, project_settings=project_settings ) ``` -------------------------------- ### Add REST Endpoint to Addon Source: https://docs.ayon.dev/docs/dev_addon_creation Extend the AYON API by adding endpoints using the 'add_endpoint' method. This example shows how to add a GET endpoint named 'studio-data'. ```python from typing import Type from ayon_server.api.dependencies import CurrentUser from ayon_server.addons import BaseServerAddon from ayon_server.settings import BaseSettingsModel # Settings class MySettings(BaseSettingsModel): """My Settings. """ pass # Default settings values DEFAULT_VALUES = {} class MyAddonSettings(BaseServerAddon): # Set settings settings_model: Type[MySettings] = MySettings # Set default settings values async def get_default_settings(self): settings_model_cls = self.get_settings_model() return settings_model_cls(**DEFAULT_VALUES) def initialize(self): self.add_endpoint( "studio-data", self.get_studio_data, method="GET", ) # Example REST endpoint async def get_studio_data( self, user: CurrentUser ): """Return some value and user name.""" return { "secret-of-the-studio": "There is no secret", "Current User": f"{user.name}" } ``` -------------------------------- ### Create Base Server Addon Source: https://docs.ayon.dev/docs/dev_addon_creation Create your addon by inheriting from BaseServerAddon and setting the 'settings_model' and 'site_settings_model' attributes. Implement 'get_default_settings' to return default values. ```python class MyAddonSettings(BaseServerAddon): # Set settings settings_model: Type[MySettings] = MySettings site_settings_model: Type[MyStudioSiteSettings] = MyStudioSiteSettings # Set default settings values async def get_default_settings(self): settings_model_cls = self.get_settings_model() return settings_model_cls(**DEFAULT_VALUES) ``` -------------------------------- ### Create Vite Project for Addon Frontend Source: https://docs.ayon.dev/docs/dev_addon_creation Initialize a new frontend project using Vite. This command sets up a basic project structure for a React application. ```bash npm create vite@latest ``` -------------------------------- ### Build AYON Desktop Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Compiles the AYON desktop application in the './build/' directory. The output is expected to be an AYON application bundle. ```bash ./tools/make.sh build ``` -------------------------------- ### Install Python Build Dependencies on CentOS Source: https://docs.ayon.dev/docs/dev_launcher_build_linux Installs necessary libraries for building Python with pyenv on CentOS, including GCC, zlib, bzip2, readline, and others. ```bash yum install gcc zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel ``` -------------------------------- ### Create User with Standard and Raw PUT Methods Source: https://docs.ayon.dev/docs/dev_api_python Demonstrates creating a user using both the standard `put` method (where kwargs become JSON) and the `raw_put` method (which allows explicit requests arguments like `json`). The `raw_` variants are preferred for custom headers or timeouts. ```python import ayon_api # Prepare your data user_data = { "name": "demouser00", "attrib": { "fullName": "Tanise de Souza", "email": "tanise.desouza@example.com" }, "password": "ayon", "data": { "defaultAccessGroups": ["artist"] } } # OPTION A: Using the standard PUT (Kwargs become JSON) # Note how we unpack the dictionary into the method ayon_api.put( f"users/{user_data['name']}", **user_data ) # OPTION B: Using raw_put (Explicit requests arguments) # This is preferred if you need to pass specific headers or timeouts ayon_api.raw_put( f"users/{user_data['name']}", json=user_data ) ``` -------------------------------- ### Install Local Python Dependencies Source: https://docs.ayon.dev/docs/addon_aquarium_developer Install local Python dependencies for the Aquarium addon and Ayon backend using pip in editable mode. Ensure you have activated the correct pyenv. ```bash python -m pip install -e /path/to/aquarium-python-api ``` ```bash python -m pip install -e /path/to/ayon-backend ``` -------------------------------- ### Build AYON Desktop Source: https://docs.ayon.dev/docs/dev_launcher_build_macos Builds the AYON Desktop application. The output will be placed in the './build/' directory, typically as an '.app' file. ```bash ./tools/make.sh build ``` -------------------------------- ### Build AYON Desktop Executables Source: https://docs.ayon.dev/docs/dev_launcher_build_windows Execute this command to build the AYON executables. Output files will be located in the `./build/output/` directory. ```powershell ./tools/manage.ps1 build ``` -------------------------------- ### Recommended Host Folder Structure Source: https://docs.ayon.dev/docs/dev_host_implementation Illustrates the standard directory layout for a host integration, separating DCC integration code, plugins, launch hooks, startup scripts, and the public interface. ```tree ayon/hosts/{host name} │ │ # Content of DCC integration - with in-DCC imports ├─ api │ ├─ __init__.py │ └─ [DCC integration files] │ │ # Plugins related to host - dynamically imported (can contain in-DCC imports) ├─ plugins │ ├─ create │ │ └─ [create plugin files] │ ├─ load │ │ └─ [load plugin files] │ └─ publish │ └─ [publish plugin files] │ │ # Launch hooks - used to modify how application is launched ├─ hooks │ └─ [some pre/post launch hooks] | │ # Code initializing host integration in-DCC (DCC specific - example from Maya) ├─ startup │ └─ userSetup.py │ │ # Public interface ├─ __init__.py └─ [other public code] ``` -------------------------------- ### Run AYON with Script Execution Source: https://docs.ayon.dev/docs/dev_launcher Execute AYON and specify a Python script to run as the main logic. This allows for custom startup behavior by providing a script path and its arguments. ```bash cd ayon /foo/bar/baz.py arg1 arg2 ``` -------------------------------- ### Build AYON C++ Library Source: https://docs.ayon.dev/docs/dev_api_cpp Commands to set up and build the AYON C++ API using its provided Python script. ```bash cd ext\ayon-cpp-api python AyonBuild.py --setup python AyonBuild.py --runStageGRP CleanBuild ``` -------------------------------- ### Check mongorestore availability Source: https://docs.ayon.dev/docs/dev_testing Verify that the mongorestore command-line tool is installed and accessible in your system's PATH. This is a prerequisite for running integration tests. ```bash mongorestore --version ``` -------------------------------- ### Create Aquarium Addon Package Source: https://docs.ayon.dev/docs/addon_aquarium_developer Execute the 'create_package.py' script from your 'ayon-aquarium' folder to generate a .zip package for the addon. ```python python create_package.py ``` -------------------------------- ### Add ImageIO Schema to Host Settings Source: https://docs.ayon.dev/docs/dev_colorspace Configure host settings by adding the 'imagio' schema to define color management options. This should ideally be placed near the top of relevant schema categories. ```json { "key": "imageio", "type": "dict", "label": "Color Management (ImageIO)", "is_group": true, "children": [ { "type": "schema", "name": "schema_imageio_config" }, { "type": "schema", "name": "schema_imageio_file_rules" } ] } ``` -------------------------------- ### Create Addon Package Source: https://docs.ayon.dev/docs/dev_dev_mode Generate a package for the addon. This step is necessary if the addon is not already available on the server. ```python python ./create_package.py ``` -------------------------------- ### Run Existing Playwright Tests Source: https://docs.ayon.dev/docs/server_testing Execute the existing E2E tests using either the console command or the test UI. Ensure Playwright is installed and configured. ```bash yarn test ``` ```bash yarn test-ui ``` -------------------------------- ### Run AYON from Sources Source: https://docs.ayon.dev/docs/dev_launcher Execute AYON directly from its source code by activating the virtual environment. This is useful for development and testing. ```bash cd poetry run python start.py &args ``` -------------------------------- ### Define Studio Site Settings Model Source: https://docs.ayon.dev/docs/dev_addon_creation Define a separate settings model for site-specific configurations by inheriting from BaseSettingsModel. ```python class MyStudioSiteSettings(BaseSettingsModel): """My Studio Site Settings. """ username: str = SettingsField("", title="Username") ``` -------------------------------- ### Navigate to Addon Directory Source: https://docs.ayon.dev/docs/dev_dev_mode Change the current directory to the location where you will manage your addon code. ```bash cd C:/code/addons ``` -------------------------------- ### Define MayaHost Class Source: https://docs.ayon.dev/docs/dev_host_implementation Implement a custom host class by inheriting from HostBase and relevant interfaces like IWorkfileHost and ILoadHost. This example shows the basic structure for a Maya host. ```python from ayon.host import HostBase, IWorkfileHost, ILoadHost class MayaHost(HostBase, IWorkfileHost, ILoadHost): def open_workfile(self, filepath): ... def save_current_workfile(self, filepath=None): ... def get_current_workfile(self): ... ... ``` -------------------------------- ### Colorspace Data Structure Example Source: https://docs.ayon.dev/docs/dev_colorspace This JSON structure represents the colorspace data that is stored in published representations. It includes the active colorspace name and configuration paths for both the current platform and a template. ```json { "colorspace": "linear", "config": { "path": "/abs/path/to/config.ocio", "template": "{project[root]}/path/to/config.ocio" } } ```