Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/23 feature request pin file loading #24

Merged
merged 64 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
76cba60
save
lyon040502003 Jul 22, 2024
ab5f452
save
lyon040502003 Jul 22, 2024
640d0d0
removed submodule to add again
lyon040502003 Jul 22, 2024
1ace5b8
add ayon-cpp-dev-tools
lyon040502003 Jul 22, 2024
384fbea
implemented pinning file loading for the resolver
lyon040502003 Jul 23, 2024
25e15dd
cleand up build.sh
lyon040502003 Jul 24, 2024
6e5fadf
implemented build.py to replace build.bat and build.sh
lyon040502003 Jul 29, 2024
9f4c52b
upaded build.py
lyon040502003 Jul 30, 2024
ba56c96
moved old build scripts and changed CMakeLists.txt to include CppDevT…
lyon040502003 Aug 6, 2024
2e9d60e
updated all documentation and added new documentation for devs and Ad…
lyon040502003 Aug 8, 2024
6d3f2d0
re organised and refactored small part of _Resolve() func to only use…
lyon040502003 Aug 8, 2024
ce5dcd6
add documentation generation via pages
lyon040502003 Aug 13, 2024
8eaf634
removed adding pages setup so i can have a seperate pr
lyon040502003 Aug 13, 2024
317d8f0
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
cbd3eda
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
06d252f
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
f42250c
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
c5f2fc7
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
4100cd5
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
1fae12c
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
e707fca
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
cf1a10c
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
16930d8
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
5fa4c38
Update scripts/build.py
Lypsolon Aug 20, 2024
7c043d3
changed names and text for PR
lyon040502003 Aug 20, 2024
91486b8
added extra info to the Dev docs on how to use pinning suport with ex…
lyon040502003 Aug 20, 2024
b03f680
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
7b93a64
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
ed83630
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
6057dd1
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
daa54a0
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Aug 20, 2024
36fecb1
fixed a typo in a class
lyon040502003 Aug 20, 2024
ad2815e
updated the information about TF_DEBUG inside admin docs
lyon040502003 Aug 20, 2024
ebfedbd
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
c17a962
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Aug 20, 2024
6b70d4a
pinning file loading now allows for key and value root replace
Sep 9, 2024
b0b3773
upade for compile
Sep 10, 2024
f5b44ef
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
fb4f45b
Update Docs/Ayon_Docs/Admin_Docs.md
Lypsolon Sep 11, 2024
8bfd334
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
8064dbe
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
38b73c2
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
e8f3235
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
63fca70
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
b3a759e
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
4244066
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
57fcdda
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
7bd21f3
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
aba03b9
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
208d14d
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
3e198c1
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
339078e
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
07446c8
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
a4c6bde
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
0ecce29
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
51d393a
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
cd85701
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
7dd7572
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
d449ee7
Update Docs/Ayon_Docs/Dev_Docs.md
Lypsolon Sep 11, 2024
6a9417b
removed docs to handle them in seperate pr
Sep 11, 2024
17af27b
added back the docs generation as it was in develop branch
Sep 11, 2024
6836dff
fixes for git modules file
Sep 11, 2024
218bce3
Merge branch 'develop' into feature/23-feature-request_pinn_file_loading
Lypsolon Sep 11, 2024
d1ef3ca
Merge branch 'develop' into feature/23-feature-request_pinn_file_loading
Lypsolon Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[submodule "ext/ayon-cpp-api"]
path = ext/ayon-cpp-api
url = https://github.com/ynput/ayon-cpp-api.git


[submodule "ext/ayon-cpp-dev-tools"]
path = ext/ayon-cpp-dev-tools
url = https://github.com/ynput/ayon-cpp-dev-tools.git
3 changes: 2 additions & 1 deletion BuildPlugins/AyonUsdLinux/AyonUsd23_5_Py39_Linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ execute_process(
OUTPUT_VARIABLE Python_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)


if (NOT ${Python_VERSION} STREQUAL 3.9) # Check if System Installed Python version is 3.9
message(FATAL_ERROR "Python version: ${Python_VERSION}")
endif()
Expand All @@ -41,7 +43,6 @@ get_filename_component(Python_Base_Dir ${Python_INCLUDE_DIRS} DIRECTORY)
set(AR_PYTHON_LIB_NUMBER python39)
set(AR_PYTHON_LIB_DIR ${Python_Base_Dir})
set(AR_PYTHON_INCLUDE_DIR ${Python_Base_Dir}/python3.9)

# setting up boost
add_compile_definitions(BOOST_ALL_NO_LIB)
set(AR_BOOST_NAMESPACE boost)
Expand Down
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ else()
endif()

add_compile_definitions(DEV=${DEV})
add_compile_definitions(MACRO_REMOVE_SDF_FORMAT_ARGS=1)
add_compile_definitions(CPPHTTPLIB_OPENSSL_SUPPORT) #we need to define this var here because ayon cpp api needs it to enable open sll support for https


Expand All @@ -38,6 +37,7 @@ set(AR_AYONUSDRESOLVER_TARGET_LIB ayonUsdResolver)
set(AR_AYONUSDRESOLVER_TARGET_PYTHON _${AR_AYONUSDRESOLVER_TARGET_LIB})
set(AR_AYONUSDRESOLVER_INSTALL_PREFIX ${AR_PROJECT_NAME}/${AR_AYONUSDRESOLVER_USD_PLUGIN_NAME})

set(MACRO_REMOVE_SDF_FORMAT_ARGS 1)

# shared library setup commands
if (WIN32)
Expand Down Expand Up @@ -104,8 +104,21 @@ if(NOT DEFINED BOOST_LIB_DIR)
message(FATAL_ERROR "BOOST_LIB_DIR is not defined. Please set it before continuing.")
endif()

message(STATUS "AR_PXR_INCLUDE_DIR path: ${AR_PXR_INCLUDE_DIR}")
message(STATUS "AR_PXR_LIB_DIR path: ${AR_PXR_LIB_DIR}")
message(STATUS "AR_PXR_LIB_PREFIX path: ${AR_PXR_LIB_PREFIX}")
message(STATUS "AR_PYTHON_LIB_NUMBER path: ${AR_PYTHON_LIB_NUMBER}")
message(STATUS "AR_PYTHON_LIB_DIR path: ${AR_PYTHON_LIB_DIR}")
message(STATUS "AR_PYTHON_INCLUDE_DIR path: ${AR_PYTHON_INCLUDE_DIR}")
message(STATUS "AR_BOOST_INCLUDE_DIR path: ${AR_BOOST_INCLUDE_DIR}")
message(STATUS "BOOST_LIB_DIR path: ${BOOST_LIB_DIR}")

message(STATUS "SDF_FORMAT_ARGS = ${MACRO_REMOVE_SDF_FORMAT_ARGS}")
add_compile_definitions(MACRO_REMOVE_SDF_FORMAT_ARGS=${MACRO_REMOVE_SDF_FORMAT_ARGS})

# Include AyonDevTools
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-dev-tools")

message(STATUS "Enable SDF_FORMAT_ARGS Remove Macro = ${MACRO_REMOVE_SDF_FORMAT_ARGS}")
# Include AyonCppApi
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/ayon-cpp-api")
Expand Down
178 changes: 140 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@

## Introduction

The [AYON](https://ynput.io/ayon/) USD Resolver is
[an asset resolver plugin](https://openusd.org/release/api/ar_page_front.html#ar_uri_resolvers)
for [Pixar's USD](https://openusd.org). It's designed to turn URIs with the
`ayon://` or `ayon+entity://` formats into local file paths.
The [AYON](https://ynput.io/ayon/) USD Resolver is an
[AR2.0 AssetResolver Plugin](https://openusd.org/release/api/ar_page_front.html#ar_uri_resolvers)
for [Open USD](https://openusd.org) it has been designed to make Cross team,
Platfrom and software interoperability easy and accessable for all AYON users.
it is best used with our new Contribution workflow.

This resolver uses local caching and connects with the AYON Server to handle
AYON compatible entity URIs through the
[AyonCppApi](<(https://github.com/ynput/ayon-cpp-api/)>).

> [!IMPORTANT]\
> This repository uses Git Submodules. Make
> sure to use the correct `git clone` commands accordingly.
> This repository uses Git Submodules. Make sure to use the correct `git clone`
> commands accordingly.\
> `git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git`\
> `git submodule update --init --recursive`

> [!IMPORTANT]\
> The [AYON](https://ynput.io/ayon/) USD Resolver is a
> The [AYON](https://ynput.io/ayon/) USD Resolver is an
> [AR2.0](https://openusd.org/release/wp_ar2.html) resolver and will not support
> packages that only support AR1.0
> AR1.0 resolution. Make sure that your software package is compatible with the
> AR2.0 standard or use the **defaults** we provide in the
> [AYON Usd Addon](https://github.com/ynput/ayon-usd)

> **NOTE**\
> **Admin** and **Dev** docs can be found under `/Docs/Ayon_Docs/`

# Repository Docs

### Requirements:

- C++ Compiler
- Cmake
- GitHub public key setup (this is because the sub-modules are linked via git@)
- Target DCC / SDK installed
- python3 development files (Optional when building Against AYON Usd)

### Tested Platforms:

Expand All @@ -34,47 +44,139 @@ AYON compatible entity URIs through the
- Hou 19.5.900
- Hou 20.0.590
- Hou 20.0.630
- Maya 2024.2(UsdAddon_0.25.0)
- Unreal5.4
- AyonUsd23_5_py39 (System Python install)
- Maya2024_2
- Maya2025_2
- Unreal5_4

- Windows 10
- Hou 19.5.805
- Hou 19.5.900
- Hou 20.0.590
- Hou 20.0.630
- Maya 2024.2(UsdAddon_0.25.0)
- Maya 2025
- Unreal5.4
- AyonUsd23_5_py39 (Pyenv-Win)
- Maya2024_2
- Maya2025_2
- Unreal5_4

## Download the repo and its submodules:

```
git clone --recurse-submodules https://github.com/ynput/ayon-usd-resolver.git

git submodule update --init --recursive
```

## DoxyGen Docs

Can be found on the connected GH Page
[Docs GH Page](https://ynput.github.io/ayon-usd-resolver/)

## Pre-build / Self Compiled

- AYON will provide some pre-built versions of the resolver in the future.

- Those versions will be the pre-built binaries that our tests created, so you
might not find your software/platform combination.
- It's also to be expected that resolver builds are behind new software
releases.
There are multiple Options to get your hands on the AyonUsdAsset resolver.

## Prebuild
**[AyonUsdAddon](https://github.com/ynput/ayon-usd)**\
the AyonUsd addon will automatically download and setup a list of compiled
Resolvers.\
it is generally recommended to go with the AyonUsd addon if you don't want to
develop with the resolver as recompiling and setting up your own LakeFs setup
can be involved.

- Prebuilts aren't available as of right now.
**Self Compiled**\
if you want to compile your own resolver because you want to implement a new
feature, fix a bug or add a new software to compile against.

## Self Compiled

- See [Doxygen Docs](https://ynput.github.io/ayon-usd-resolver/md_md_Getting_Started.html) Getting Started Page
> **Note**\
> Currently, we only support specific set of DCCs and their versions, and
> AyonUsd for building revolvers (other software packages and stand-alone setups
> will follow).

> **Note**\
> we updated the build startup script to be run via python to make cross
> platfrom development easyer.\
> in the future we intend to use AyonAutomator to provide build, test, developer
> and document stages with different build options.

## `build.py` variables

`--DEV`\
if you set this variable to one the CMake build script will be instructed to
compile in debug mode. It will also enable all Developer Macros.\
it is not advised to use this for production as it will impact the performance.

`--JTRACE`\
the resolver project includes an option to output a tracing file.\
this tracing file can be used with PerfettoUi in order to get detailed
information's about what functions where called while the resolver was running.\
this system works exclusively at runtime and will only show the functions that
where called no static testing is done.\
you should not use this in production as it will drastically impact the
performance.

`--Clean`\
CMake uses an internal cache wile its compiling. this helps speed up the compile
process but it can create issues if a variable changed that cmake did not
monitor.\
using Clean build will remove the compiled resolver files and the build
directory and call CMake clean first. this way we can ensure that the new
complie has a clean environment\
we advice to run a Clean compile when you want to release a new resolver or if
you run a CiCd process.

`--CompilePlugin`\
there are 2 options to select a compile plugin.

1. use this build script option.
2. use a Env variable.

In the end of the day this option will just set the Env variable for you.

`--extra_env_vars`\
this flag allows you to set key value pairs that will be setup as environment
variables. eg if your build plugin needs some Env variables you can set this via
this system its not mandatory tho.

## Compile Plugin's

we use compile plugins to allow compilation against different platforms and
software packages.\
using compile plugins allows us to have a small and efficient CMake setup while
also allowing build setups to be simple per Package instead of one big setup.

### How dose it work ?

**Folder Layout**\
in the root of this Reposetory you will find a folder called `BuildPlugins/`\
in this foulder you find a few subfoulders They are named via
`{AppName}{Platfrom_Name}`\
all those foulders hold BuildPlugins. every build plugin is for one specific
application varient. (if different variants of a software share the same
resolver one BuildPlugin for all of them is enough)

**What Dose a Build Plugin Doo ?**\
Every application implemented OpenUsd in a different way.\
Houdini for example has all the include files in one dir and all the bin files
in a separate one. But Maya has a zip file for some of the files. so in the end
a BuilPlugin will just need to setup a few Folder paths that we need in order to
allow the Build Process to find the right files and library's.

**How to select a build Plugin**\
Build plugins are selected by there path starting at `BuildPlugins/`\
so the path for `AyonUsd23_5_Py39_Linux` would be
`AyonUsdLinux/AyonUsd23_5_Py39_Linux` you should not include the .cmake
extension as the main CMake file will append it to the path.

**Build Plugin Requirements**\
Every build Plugin usually has some Env variables you need to set.\
For Houdini build Plugins you will need to set the root path to your Houdini
install.\
in the end of the day you will need to look into the BuildPlugin file to know
what the needed variables are in case they are not documented in Dev_Docs.

**The Build Command**\
a few things about the build script first.

1. you can start the build script from anny location and it will find its paths
relative to its own loacaton so dont move the build script.
2. the build script compiles a single resolver, and generates a zip. you dont
need the zip to work with the resolver locally but the Ynput LakeFs setup
needs the zip to work correctly.

The command is usage as follows\
`python scripts/build.py [Flags]`\
most of the time you will use the `--CompilePlugin` and `--extra_env_vars` the
first allows you to select the Build Plugin to build with and the second one can
be useful to set the BuildPlugin related env vars\
Excample:\
`python scripts/build.py --CompilePlugin=AyonUsdLinux/AyonUsd23_5_Py39_Linux --extra_env_vars AyonUsdRoot={Path To UsdLib}`\
also remember that you need to use `--Clean` when you want to do a clean
compile. and when you change the build plugin you will need to run **Clean** so
that CMake delets the cached data for the BudilPlugin
1 change: 1 addition & 0 deletions ext/ayon-cpp-dev-tools
Submodule ayon-cpp-dev-tools added at a9ccb3
Loading