Skip to main content

AYON C++ API

About AYON C++ API

The AYON CPP API is a static lib. It allows communication with the AYON server. Implementation is mainly focused on AYON USD Resolver to communicate with the server resolve endpoint.

Development Environment

We assume you already have setup your C++ dev environment as well as cmake. You need to use at least C++17 in CMake

C++ Example Project

Once built, you can then start including it in your cpp projects.

.
├─ ext/ayon-cpp-api
├─ CMakelists.txt
└─ main.cpp

This example is brought from: test_cpp_api.

Build And Run Commands

  • Fetch AYON CPP Repo
    cd ext
    git clone https://github.com/ynput/ayon-cpp-api.git --recurse-submodules
  • Build CPP
    ayon-cpp-api repo provides python script to do the hard lifting for you.
    cd ext\ayon-cpp-api
    python AyonBuild.py --setup
    python AyonBuild.py --runStageGRP CleanBuild
  • Build CPP Example
    rmdir /s /q build
    cmake -S . -B build -DJTRACE=0
    cmake --build ./build --config Debug -j12
  • Run CPP Example
    build\Debug\main.exe
  • Example Output
    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
  • Example contents of log.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"}"}

Learn More

For More info and a full list of available commands Please refer to our AYON CPP API.