Skip to content

Commit

Permalink
Make update manager maya compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Mar 22, 2024
1 parent 9146818 commit 5719541
Show file tree
Hide file tree
Showing 8 changed files with 328 additions and 193 deletions.
22 changes: 12 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,18 @@ add_compile_definitions(HBOOST_ALL_NO_LIB BOOST_ALL_NO_LIB)
if (WIN32)
add_compile_definitions(NOMINMAX)
else()
# Notes:
# Houdini 20 - Switched to the new C++11 ABI for Linux https://www.sidefx.com/docs/houdini/news/20/platforms.html
# For Houdini versions that use gcc 9.3, please set this to _GLIBCXX_USE_CXX11_ABI=0
file(REAL_PATH ${AR_HOUDINI_ROOT} AR_HOUDINI_ROOT_RESOLVED)
string(FIND ${AR_HOUDINI_ROOT_RESOLVED} "19.5" AR_HOUDINI_ROOT_IS_H195)
if (${AR_HOUDINI_ROOT_IS_H195} STREQUAL "-1")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)
else()
message("Houdini 19.5 detected, switching to _GLIBCXX_USE_CXX11_ABI=0")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
if("$ENV{AR_DCC_NAME}" STREQUAL "HOUDINI")
# Notes:
# Houdini 20 - Switched to the new C++11 ABI for Linux https://www.sidefx.com/docs/houdini/news/20/platforms.html
# For Houdini versions that use gcc 9.3, please set this to _GLIBCXX_USE_CXX11_ABI=0
file(REAL_PATH ${AR_HOUDINI_ROOT} AR_HOUDINI_ROOT_RESOLVED)
string(FIND ${AR_HOUDINI_ROOT_RESOLVED} "19.5" AR_HOUDINI_ROOT_IS_H195)
if (${AR_HOUDINI_ROOT_IS_H195} STREQUAL "-1")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=1)
else()
message("Houdini 19.5 detected, switching to _GLIBCXX_USE_CXX11_ABI=0")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0)
endif()
endif()
endif()
# Compiler Options
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ This repository holds reference implementations for [Usd](https://openusd.org/re
To build the various resolvers, follow the instructions in the [install guide](https://lucascheller.github.io/VFX-UsdAssetResolver/installation/requirements.html).

> [!NOTE]
> This guide currently covers compiling against Houdini on Linux and Windows. Alternatively you can also download a pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [environment variables](https://lucascheller.github.io/VFX-UsdAssetResolver/resolvers/overview.html#environment-variables) section for more details.
> This guide currently covers compiling against Houdini/Maya on Linux and Windows. Alternatively you can also download a pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [environment variables](https://lucascheller.github.io/VFX-UsdAssetResolver/resolvers/overview.html#environment-variables) section for more details.
> [!IMPORTANT]
> We also offer a quick install method for Houdini that does the download of the compiled resolvers and environment variable setup for you. This is ideal if you want to get your hands dirty right away and you don't have any C++ knowledge or extensive USD developer knowledge. If you are a small studio, you can jump right in and play around with our resolvers and prototype them further to make it fit your production needs.
> We also offer a quick install method for Houdini/Maya that does the download of the compiled resolvers and environment variable setup for you. This is ideal if you want to get your hands dirty right away and you don't have any C++ knowledge or extensive USD developer knowledge. If you are a small studio, you can jump right in and play around with our resolvers and prototype them further to make it fit your production needs.
To run the "Update Manager" simply run this snippet in the "Houdini Python Source Editor" panel:
To run the "Update Manager" simply run this snippet in the Houdini "Python Source Editor" or Maya "Script Editor" panel:

import urllib,ssl
update_manager_url = 'https://raw.githubusercontent.com/LucaScheller/VFX-UsdAssetResolver/main/tools/update_manager.py?token=$(date%20+%s)'
exec(urllib.request.urlopen(update_manager_url,context=ssl._create_unverified_context()).read(), globals(), locals())
run_houdini()
run_dcc()

See our [Automatic Installation](https://lucascheller.github.io/VFX-UsdAssetResolver/installation/automatic_install.html) section for more information.

Expand Down
Empty file modified docs.sh
100644 → 100755
Empty file.
16 changes: 14 additions & 2 deletions docs/src/installation/automatic_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@ In Houdini we simply need to open the "Python Source Editor" from the "Windows"
import urllib,ssl
update_manager_url = 'https://raw.githubusercontent.com/LucaScheller/VFX-UsdAssetResolver/main/tools/update_manager.py?token=$(date%20+%s)'
exec(urllib.request.urlopen(update_manager_url,context=ssl._create_unverified_context()).read(), globals(), locals())
run_houdini()
run_dcc()
```
~~~

![Houdini Python Source editor](./media/HoudiniPythonSourceEditor.jpg)
![Houdini Python Source editor](./media/HoudiniPythonSourceEditor.jpg)

## Maya
In Maya we simply need to open the "Script Editor" and run the following code to get access to the update manager. You should preferably do this in a clean Maya session as a safety measure.

~~~admonish info title=""
```python
import urllib,ssl
update_manager_url = 'https://raw.githubusercontent.com/LucaScheller/VFX-UsdAssetResolver/main/tools/update_manager.py?token=$(date%20+%s)'
exec(urllib.request.urlopen(update_manager_url,context=ssl._create_unverified_context()).read(), globals(), locals())
run_dcc()
```
~~~
31 changes: 24 additions & 7 deletions docs/src/installation/building.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Building
Currently we support building against Houdini on Linux and Windows. If you don't want to self-compile, you can also download pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [Resolvers > Environment Variables](../resolvers/overview.md#environment-variables) section for more details.
Currently we support building against Houdini and Maya on Linux and Windows. If you don't want to self-compile, you can also download pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [Resolvers > Environment Variables](../resolvers/overview.md#environment-variables) section for more details.

## Setting up our build environment
After installing the [requirements](./requirements.md), we first need to set a couple of environment variables that our cmake file depends on.

### Using our convenience setup script
On Linux we provide a bash script that you can source that sets up our development environment. This sets a few environment variables needed to build the resolver as well as for Houdini to load it.
On Linux we provide a bash script that you can source that sets up our development environment. This sets a few environment variables needed to build the resolver as well as for Houdini/Maya to load it.
This can be done by running the following from the source directory:
~~~admonish info title=""
```bash
source setup.sh
```
~~~

In the [setup.sh](https://github.com/LucaScheller/VFX-UsdAssetResolver/blob/main/setup.sh) file you can define what resolver to compile by setting the `RESOLVER_NAME` variable to one of the resolvers listed in [resolvers](../resolvers/overview.md) in camelCase syntax (for example `fileResolver` or `pythonResolver`). Here you'll also have to define what Houdini version to compile against.
In the [setup.sh](https://github.com/LucaScheller/VFX-UsdAssetResolver/blob/main/setup.sh) file you can define what resolver to compile by setting the `RESOLVER_NAME` variable to one of the resolvers listed in [resolvers](../resolvers/overview.md) in camelCase syntax (for example `fileResolver` or `pythonResolver`). Here you'll also have to define what Houdini/Maya version to compile against.

It will then automatically set the `PATH`, `PYTHONPATH`, `PXR_PLUGINPATH_NAME` and `LD_LIBRARY_PATH` environment variables to the correct paths so that after your run the compile, the resolver will be loaded correctly (e.g. if you launch Houdini via `houdinifx`, it will load everything correctly). The build process also logs this information again.

Expand All @@ -25,11 +25,28 @@ If you don't want to use our convenience script, you can also setup the environm
~~~admonish info title=""
```bash
# Linux
## Houdini
export AR_DCC_NAME=houdini
export HFS=<PathToHoudiniRoot> # For example "/opt/hfs<HoudiniVersion>"
export RESOLVER_NAME=fileResolver
## Maya
export AR_DCC_NAME=maya
export MAYA_USD_SDK_ROOT="/path/to/maya/usd/sdk/root/.../mayausd/USD"
export MAYA_USD_SDK_DEVKIT_ROOT="/path/to/maya/usd/sdk/root/.../content/of/devkit.zip"
export PYTHON_ROOT="/path/to/python/root"
## Resolver
export AR_RESOLVER_NAME=fileResolver
# Windows
## Houdini
set AR_DCC_NAME=houdini
set HFS=<PathToHoudiniRoot> # For example "C:\Program Files\Side Effects Software\<HoudiniVersion>"
set RESOLVER_NAME=fileResolver
## Maya
set AR_DCC_NAME=maya
set MAYA_USD_SDK_ROOT="/path/to/maya/usd/sdk/root/.../mayausd/USD"
set MAYA_USD_SDK_DEVKIT_ROOT="/path/to/maya/usd/sdk/root/.../content/of/devkit.zip"
set PYTHON_ROOT="/path/to/python/root"
## Resolver
set AR_RESOLVER_NAME=fileResolver
```
~~~

Expand Down Expand Up @@ -65,9 +82,9 @@ build.bat
The `build.sh/.bat` files also contain (commented out) the environment definition part above, so alternatively just comment out the lines and you are good to go.

## Testing the build
Unit tests are automatically run post-build on Linux using the Houdini version you are using. You can find each resolvers tests in its respective src/<ResolverName>/testenv folder.
Unit tests are automatically run post-build on Linux using the Houdini/Maya version you are using. You can find each resolvers tests in its respective src/<ResolverName>/testenv folder.

Alternatively you can run Houdini and check if the resolver executes correctly. If you didn't use our convenience script as noted above, you'll have to specify a few environment variables, so that our plugin is correctly detected by USD.
Alternatively you can run Houdini/Maya and check if the resolver executes correctly. If you didn't use our convenience script as noted above, you'll have to specify a few environment variables, so that our plugin is correctly detected by USD.

Head over to our [Resolvers > Environment Variables](../resolvers/overview.md#environment-variables) section on how to do this.

Expand Down
30 changes: 17 additions & 13 deletions docs/src/installation/requirements.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
# Requirements

## System dependencies
Currently building on Linux and Windows is documented. We use CMake as our build system and link against Houdini to avoid having to compile our own version of Usd.
Currently building on Linux and Windows is documented. We use CMake as our build system and link against Houdini/Maya to avoid having to compile our own version of Usd.

It is also possible to compile against a self-compiled Usd build, this is not covered by this guide though.

VFX DCC vendors try to keep in sync with the versions specified in the [VFX Reference Platform](https://vfxplatform.com), so if something doesn't work, first make sure that your software versions are supported.

```admonish warning
Since the Usd Asset Resolver API changed with the AR 2.0 standard proposed in the [Asset Resolver 2.0 Specification](https://openusd.org/release/wp_ar2.html), you can only compile against Houdini versions 19.5 and higher.
Since the Usd Asset Resolver API changed with the AR 2.0 standard proposed in the [Asset Resolver 2.0 Specification](https://openusd.org/release/wp_ar2.html), you can only compile against Houdini versions 19.5 and higher/Maya versions 2024 and higher.
```

## Linux
```admonish success title=""
| Software | Website | Min (Not Tested) | Max (Tested) |
|-----------------|--------------------------------------------------|----------------------|---------------|
| gcc | [https://gcc.gnu.org](https://gcc.gnu.org/) | 11.2.1 | 13.1.1 |
| cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 |
| SideFX Houdini | [https://www.sidefx.com](https://www.sidefx.com) | 19.5 | 19.5 |
| Software | Website | Min (Not Tested) | Max (Tested) |
|------------------------|------------------------------------------------------------------------|----------------------|---------------|
| gcc | [https://gcc.gnu.org](https://gcc.gnu.org/) | 11.2.1 | 13.1.1 |
| cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 |
| SideFX Houdini | [SideFX Houdini](https://www.sidefx.com) | 19.5 | 19.5 |
| Autodesk Maya | [Autodesk Maya](https://www.autodesk.com/ca-en/products/maya/overview) | 2024 | 2024 |
| Autodesk Maya USD SDK | [Autodesk Maya USD SDK](https://github.com/Autodesk/maya-usd) | 0.27.0 | 0.27.0 |
```

## Windows
```admonish success title=""
| Software | Website | Min (Not Tested) | Max (Tested) |
|----------------------|------------------------------------------------------------------------------------|----------------------|---------------|
|Visual Studio 16 2019 | [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) | 11.2.1 | 13.1.1 |
| cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 |
| SideFX Houdini | [https://www.sidefx.com](https://www.sidefx.com) | 19.5 | 19.5 |
| Software | Website | Min (Not Tested) | Max (Tested) |
|------------------------|------------------------------------------------------------------------------------|----------------------|---------------|
|Visual Studio 16 2019 | [https://visualstudio.microsoft.com/vs/](https://visualstudio.microsoft.com/vs/) | 11.2.1 | 13.1.1 |
| cmake | [https://cmake.org](https://cmake.org/) | 3.26.4 | 3.26.4 |
| SideFX Houdini | [SideFX Houdini](https://www.sidefx.com) | 19.5 | 19.5 |
| Autodesk Maya | [Autodesk Maya](https://www.autodesk.com/ca-en/products/maya/overview) | 2024 | 2024 |
| Autodesk Maya USD SDK | [Autodesk Maya USD SDK](https://github.com/Autodesk/maya-usd) | 0.27.0 | 0.27.0 |
```

When compiling against Houdini on Windows, make sure you use the Visual Studio version that Houdini was compiled with as noted in the [HDK](https://www.sidefx.com/docs/hdk/_h_d_k__intro__getting_started.html#HDK_Intro_Compiling_Intro_Windows). You'll also need to install the [Visual Studio build tools](https://visualstudio.microsoft.com/downloads/?q=build+tools) that match the Visual Studio release if you want to run everything from the terminal.
When compiling against Houdini/Maya on Windows, make sure you use the Visual Studio version that Houdini/Maya was compiled with as noted in the [HDK](https://www.sidefx.com/docs/hdk/_h_d_k__intro__getting_started.html#HDK_Intro_Compiling_Intro_Windows)/[SDK](https://github.com/Autodesk/maya-usd). You'll also need to install the [Visual Studio build tools](https://visualstudio.microsoft.com/downloads/?q=build+tools) that match the Visual Studio release if you want to run everything from the terminal.
4 changes: 2 additions & 2 deletions docs/src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ This repository holds reference implementations for [Usd](https://openusd.org/re
To build the various resolvers, follow the instructions in the [install guide](./installation/overview.md).

```admonish info
This guide currently covers compiling against Houdini on Linux and Windows. Alternatively you can also download a pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [environment variables](./resolvers/overview.md#environment-variables) section for more details.
This guide currently covers compiling against Houdini/Maya on Linux and Windows. Alternatively you can also download a pre-compiled builds on our [release page](https://github.com/LucaScheller/VFX-UsdAssetResolver/releases). To load the resolver, you must specify a few environment variables, see our [environment variables](./resolvers/overview.md#environment-variables) section for more details.
```

```admonish tip
We also offer a quick install method for Houdini that does the download of the compiled resolvers and environment variable setup for you. This is ideal if you want to get your hands dirty right away and you don't have any C++ knowledge or extensive USD developer knowledge. If you are a small studio, you can jump right in and play around with our resolvers and prototype them further to make it fit your production needs. See our [Automatic Installation](./installation/automatic_install.md) section for more information.
We also offer a quick install method for Houdini/Maya that does the download of the compiled resolvers and environment variable setup for you. This is ideal if you want to get your hands dirty right away and you don't have any C++ knowledge or extensive USD developer knowledge. If you are a small studio, you can jump right in and play around with our resolvers and prototype them further to make it fit your production needs. See our [Automatic Installation](./installation/automatic_install.md) section for more information.
```

## Feature Overview
Expand Down
Loading

0 comments on commit 5719541

Please sign in to comment.