Skip to content

Commit

Permalink
Add Maya USD SDK 2025.2 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaScheller committed Sep 7, 2024
1 parent 127be10 commit 3c50b6a
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 23 deletions.
18 changes: 8 additions & 10 deletions .github/scripts/maya.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
import argparse
import hashlib
import glob
import contextlib
import logging
import os
import pathlib
import platform
import re
import requests
import shutil
import sidefx
import subprocess
import tarfile
import zipfile
from urllib import request
import ssl
import json


MAYA_USD_SDK_URL = "https://api.github.com/repos/Autodesk/maya-usd"
MAYA_USD_SDK_RELEASE_ASSET_ELEMENTS_REGEX = re.compile(
"MayaUSD_([0-9.]+)_Maya([0-9.]+)_(Linux|Windows).(run|exe)"
)
MAYA_PYTHON_VERSION_MAPPING = {
"2024.2": "3.10.11"
}
MAYA_PYTHON_VERSION_MAPPING = {"2024.2": "3.10.11", "2025.2": "3.11.4"}
PYTHON_SOURCE_DOWNLOAD_URL = {
"3.10.11": "https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tgz"
"3.10.11": "https://www.python.org/ftp/python/3.10.11/Python-3.10.11.tgz",
"3.11.4": "https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz",
}
PYTHON_WINDOWS_DOWNLOAD_URL = {
"3.10.11": "https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe"
"3.10.11": "https://www.python.org/ftp/python/3.10.11/python-3.10.11-amd64.exe",
"3.11.4": "https://www.python.org/ftp/python/3.11.4/Python-3.11.4.tgz",
}
SEVENZIP_WINDOWS_DOWNLOAD_URL = {
"2301": "https://www.7-zip.org/a/7z2401-x64.exe"
Expand Down Expand Up @@ -77,12 +75,12 @@ def get_autodesk_platform():


def get_autodesk_maya_usd_sdk_releases(platform_name, maya_version):
"""Get the GitHub API service
"""Get the Autodesk Maya USD SDK releases
Args:
client_id (str): The client id
client_secret_key (str): The client secret key
Returns:
sidefx.Service: The service
list[(str, str)]: A list of (version, url) pairs.
"""
# Query release data
try:
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/maya_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set MAYA_USD_SDK_DEVKIT_ROOT=%cd%\dependency\install\maya_usd_sdk_devkit
set PYTHON_ROOT=%cd%\dependency\install\python
set AR_DCC_NAME=MAYA
set AR_RESOLVER_NAME=%1
cmake . -B build -G "Visual Studio 16 2019" -A x64 -T v142
cmake . -B build -G %2 -A x64 -T %3
cmake --build build --clean-first --config Release
cmake --install build
60 changes: 52 additions & 8 deletions .github/workflows/build_maya.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
maya_product_name: ["maya"]
maya_product_version: ["2024.2"]
maya_product_version: ["2024.2", "2025.2"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
name: UsdAssetResolver-linux-${{ matrix.maya_product_name }}-${{ matrix.maya_product_version }}
path: artifacts/*.zip

build_windows:
build_windows_2019:
runs-on: windows-2019
environment: maya
strategy:
Expand All @@ -88,16 +88,60 @@ jobs:
python3 .github\scripts\maya.py --install --install_maya_product_name ${{ matrix.maya_product_name }} --install_maya_product_version ${{ matrix.maya_product_version }} --install_directory $pwd\dependency
- name: Build USD File Resolver
run: |
.\.github\scripts\maya_build.bat fileResolver
.\.github\scripts\maya_build.bat fileResolver "Visual Studio 16 2019" "v142"
- name: Build USD Python Resolver
run: |
.\.github\scripts\maya_build.bat pythonResolver
.\.github\scripts\maya_build.bat pythonResolver "Visual Studio 16 2019" "v142"
- name: Build USD Cached Resolver
run: |
.\.github\scripts\maya_build.bat cachedResolver
.\.github\scripts\maya_build.bat cachedResolver "Visual Studio 16 2019" "v142"
- name: Build USD Http Resolver
run: |
.\.github\scripts\maya_build.bat httpResolver
.\.github\scripts\maya_build.bat httpResolver "Visual Studio 16 2019" "v142"
- name: Create single .zip archive
run: |
& python $pwd\.github\scripts\maya.py --artifact --artifact_src=$pwd\dist --artifact_dst=$pwd\artifacts --artifact_prefix=UsdAssetResolver --artifact_product_name ${{ matrix.maya_product_name }} --install_directory $pwd\dependency
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: UsdAssetResolver-windows-${{ matrix.maya_product_name }}-${{ matrix.maya_product_version }}
path: artifacts/*.zip

build_windows_2022:
runs-on: windows-2022
environment: maya
strategy:
matrix:
maya_product_name: ["maya"]
maya_product_version: ["2025.2"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Switch to latest release tag
run: |
git fetch --all --tags --force
$latest_release_tag=git tag -l --sort=-version:refname v* | select -first 1
git checkout tags/$latest_release_tag
- name: Install system packages
run: |
pip3 install requests
- name: Install Maya
run: |
python3 .github\scripts\maya.py --install --install_maya_product_name ${{ matrix.maya_product_name }} --install_maya_product_version ${{ matrix.maya_product_version }} --install_directory $pwd\dependency
- name: Build USD File Resolver
run: |
.\.github\scripts\maya_build.bat fileResolver "Visual Studio 17 2022" "v143"
- name: Build USD Python Resolver
run: |
.\.github\scripts\maya_build.bat pythonResolver "Visual Studio 17 2022" "v143"
- name: Build USD Cached Resolver
run: |
.\.github\scripts\maya_build.bat cachedResolver "Visual Studio 17 2022" "v143"
- name: Build USD Http Resolver
run: |
.\.github\scripts\maya_build.bat httpResolver "Visual Studio 17 2022" "v143"
- name: Create single .zip archive
run: |
& python $pwd\.github\scripts\maya.py --artifact --artifact_src=$pwd\dist --artifact_dst=$pwd\artifacts --artifact_prefix=UsdAssetResolver --artifact_product_name ${{ matrix.maya_product_name }} --install_directory $pwd\dependency
Expand All @@ -111,12 +155,12 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build_linux, build_windows]
needs: [build_linux, build_windows_2019, build_windows_2022]
strategy:
matrix:
os: ["linux", "windows"]
maya_product_name: ["maya"]
maya_product_version: ["2024.2"]
maya_product_version: ["2024.2", "2025.2"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,20 @@ elseif("$ENV{AR_DCC_NAME}" STREQUAL "MAYA")
# Python
set(AR_PYTHON_ROOT $ENV{PYTHON_ROOT} CACHE PATH "Python install directory")
if (WIN32)
if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/boost_python310-vc142-mt-x64-1_76.dll")
if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/boost_python311-vc143-mt-x64-1_81.dll")
set(AR_PYTHON_LIB python3.11)
set(AR_PYTHON_LIB_NUMBER python311)
elseif(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/boost_python310-vc142-mt-x64-1_76.dll")
set(AR_PYTHON_LIB python3.10)
set(AR_PYTHON_LIB_NUMBER python310)
else()
message(FATAL_ERROR "Failed to find a compatible Python version.")
endif()
else()
if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/libboost_python310.so")
if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/libboost_python311.so")
set(AR_PYTHON_LIB python3.11)
set(AR_PYTHON_LIB_NUMBER python311)
elseif(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/libboost_python310.so")
set(AR_PYTHON_LIB python3.10)
set(AR_PYTHON_LIB_NUMBER python310)
else()
Expand All @@ -183,8 +189,15 @@ elseif("$ENV{AR_DCC_NAME}" STREQUAL "MAYA")
# Boost
set(AR_BOOST_NAMESPACE boost)
if (WIN32)
set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}-vc142-mt-x64-1_76)
set(AR_BOOST_INCLUDE_DIR ${AR_MAYA_INCLUDE_DIR}/${AR_BOOST_NAMESPACE}-1_76)
if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/boost_python311-vc143-mt-x64-1_81.dll")
set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}-vc143-mt-x64-1_81)
set(AR_BOOST_INCLUDE_DIR ${AR_MAYA_INCLUDE_DIR}/${AR_BOOST_NAMESPACE}-1_81)
elseif(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/boost_python310-vc142-mt-x64-1_76.dll")
set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER}-vc142-mt-x64-1_76)
set(AR_BOOST_INCLUDE_DIR ${AR_MAYA_INCLUDE_DIR}/${AR_BOOST_NAMESPACE}-1_76)
else()
message(FATAL_ERROR "Failed to find compatible Python Boost libs.")
endif()
else()
set(AR_BOOST_PYTHON_LIB ${AR_BOOST_NAMESPACE}_${AR_PYTHON_LIB_NUMBER})
set(AR_BOOST_INCLUDE_DIR ${AR_MAYA_INCLUDE_DIR}/${AR_BOOST_NAMESPACE})
Expand Down

0 comments on commit 3c50b6a

Please sign in to comment.