LucaScheller / VFX-UsdAssetResolver

Usd Asset Resolver Reference Implementations
https://lucascheller.github.io/VFX-UsdAssetResolver/
Apache License 2.0
107 stars 22 forks source link

Building for Maya 2025.2 Musd 0.29.0 for Windows #17

Closed dovanbel closed 2 months ago

dovanbel commented 2 months ago

Hi @LucaScheller I'm trying to build the cachedresolver for Maya 2025.2 (MUSD 0.29.0) for Windows.

I manually changed some lines of the CMakeLists.txt file to adapt it to Maya 2025 :

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -157,16 +157,16 @@ 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")
-            set(AR_PYTHON_LIB python3.10)
-            set(AR_PYTHON_LIB_NUMBER python310)
+        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)
         else()
             message(FATAL_ERROR "Failed to find a compatible Python version.")
         endif()
     else()
-        if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/libboost_python310.so")
-            set(AR_PYTHON_LIB python3.10)
-            set(AR_PYTHON_LIB_NUMBER python310)
+        if(EXISTS "${AR_MAYA_USD_SDK_LIB_DIR}/libboost_python311.so")
+            set(AR_PYTHON_LIB python3.11)
+            set(AR_PYTHON_LIB_NUMBER python311)
         else()
             message(FATAL_ERROR "Failed to find a compatible Python version.")
         endif()
@@ -179,12 +179,13 @@ elseif("$ENV{AR_DCC_NAME}" STREQUAL "MAYA")
         set(AR_PYTHON_LIB_DIR ${AR_PYTHON_ROOT}/lib)
         set(AR_PYTHON_INCLUDE_DIR ${AR_PYTHON_ROOT}/include/${AR_PYTHON_LIB})
     endif()
-    set(AR_PYTHON_EXECUTABLE ${AR_PYTHON_ROOT}/bin/python3)
+#     set(AR_PYTHON_EXECUTABLE ${AR_PYTHON_ROOT}/bin/python3)
+    set(AR_PYTHON_EXECUTABLE ${AR_PYTHON_ROOT}/python.exe)
     # 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)
+        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)
     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})

I then adapted the build.bat :

set AR_RESOLVER_NAME=cachedResolver
set AR_DCC_NAME=MAYA
set MAYA_USD_SDK_ROOT=C:/Program Files/Autodesk/MayaUSD/Maya2025/0.29.0/mayausd/USD
set MAYA_USD_SDK_DEVKIT_ROOT=C:/Program Files/Autodesk/MayaUSD/Maya2025/0.29.0/mayausd/USD/devkit
set PYTHON_ROOT=????
REM Clear existing build data and invoke cmake
rmdir /S /Q build
rmdir /S /Q dist
REM Make sure to match the correct VS version the DCC was built with
cmake . -B build -G "Visual Studio 17 2022" -A x64 -T v143
cmake --build build  --clean-first --config Release
cmake --install build

I'm pretty confided my MAYA_USD_SDK_ROOT and MAYA_USD_SDK_DEVKIT_ROOT are set correctly, however I don't know what path to use for PYTHON_ROOT. I tried various options, trying to guess what it should be but none worked (i.e. some includes are not found when building)

Could you tell me where the PYTHON_ROOT should point to ?

dovanbel commented 2 months ago

I managed to build CachedResolver 0.7.2 for Maya 2025.2 (MUSD 0.29.0) for Windows

I used the following commands in the build.bat :

set AR_RESOLVER_NAME=cachedResolver
set AR_DCC_NAME=MAYA
set MAYA_USD_SDK_ROOT=C:/Program Files/Autodesk/MayaUSD/Maya2025/0.29.0/mayausd/USD
set MAYA_USD_SDK_DEVKIT_ROOT=C:/Program Files/Autodesk/MayaUSD/Maya2025/0.29.0/mayausd/USD/devkit
set PYTHON_ROOT=C:\Program Files\Side Effects Software\Houdini 20.5.278\python311

REM Clear existing build data and invoke cmake
rmdir /S /Q build
rmdir /S /Q dist
REM Make sure to match the correct VS version the DCC was built with
cmake . -B build -G "Visual Studio 17 2022" -A x64 -T v143
cmake --build build  --clean-first --config Release
cmake --install build

So I used the python included in the Houdini 20.5.278 installation. Quite unorthodox... but I can confirm the cached resolver works in Maya :-)

LucaScheller commented 2 months ago

Hey, thanks for the code snippets, I adjusted the build pipeline to support Maya 2025.2.

Here is the release: https://github.com/LucaScheller/VFX-UsdAssetResolver/releases/tag/v0.7.3

Can you verify that the build works (as I don't have access to Maya)?

dovanbel commented 2 months ago

Hi, Thanks for v0.7.3. I downloaded and tested it. I can confirm CachedResolver works for Maya 2025.2 (musd 0.29.0) under Windows

LucaScheller commented 2 months ago

Great, thanks! I'll close this issue then :)

On Sat, Sep 7, 2024, 12:36 Donat Van Bellinghen @.***> wrote:

Hi, Thanks for v0.7.3. I downloaded and tested it. I can confirm CachedResolver works for Maya 2025.2 (musd 0.29.0) under Windows

— Reply to this email directly, view it on GitHub https://github.com/LucaScheller/VFX-UsdAssetResolver/issues/17#issuecomment-2336415753, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJHH3PJKBSQJIG7HIHN5LKLZVNITDAVCNFSM6AAAAABNZ63GL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWGQYTKNZVGM . You are receiving this because you were mentioned.Message ID: @.***>