Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
757 stars 202 forks source link

MayaUSD plugin load debugging #3846

Open boberfly opened 1 month ago

boberfly commented 1 month ago

Describe the bug When loading in maya-usd into Maya (2022.4) from a custom-build, there are issues trying to load these:

// Error: file: C:/Program Files/Autodesk/Maya2022/scripts/others/pluginWin.mel line 316: Unable to dynamically load : c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/adsk/plugin/mayaUsdPlugin.mll
The specified procedure could not be found.
 // 
// Error: file: C:/Program Files/Autodesk/Maya2022/scripts/others/pluginWin.mel line 316: The specified procedure could not be found.
 (mayaUsdPlugin) // 

From Python I can load stuff out of the pxr module to verify it is loading:

from pxr import Usd
print(Usd.GetVersion())
(0, 24, 5)

Also I have DependenciesGui.exe installed that I launch from the Maya python script editor:

import os, subprocess
subprocess.Popen("C:/Users/alex.fuller/dependencies/dependenciesgui.exe", env=os.environ)

And can verify the .mll libraries are locating the correct .dlls that I am expecting and nothing from anywhere else.

getenv "PATH";
// Result: C:/Program Files/Autodesk/Maya2022/Python37/lib/site-packages/PySide2;C:/Program Files/Autodesk/Maya2022/plug-ins/ATF/ATF;C:/Program Files/Autodesk/Maya2022/plug-ins/ATF/ATF/alias;C:/Program Files/Autodesk/Maya2022/bin/Cg;C:/Program Files/Autodesk/Maya2022/bin;C:/Program Files/Autodesk/Maya2022/bin3;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/bin;C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/libnvvp;C:/Windows/system32;C:/Windows;C:/Windows/System32/Wbem;C:/Windows/System32/WindowsPowerShell/v1.0/;C:/Windows/System32/OpenSSH/;C:/ProgramData/chocolatey/bin;c:/salt;C:/Program Files/Microsoft VS Code/bin;C:/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/;C:/Program Files/NVIDIA Corporation/Nsight Compute 2024.1.1/;C:/Users/alex.fuller/scoop/apps/perl/current/perl/site/bin;C:/Users/alex.fuller/scoop/apps/perl/current/perl/bin;C:/Users/alex.fuller/scoop/shims;C:/Users/alex.fuller/AppData/Local/Microsoft/WindowsApps;c:/rez-2.107.0.2/Scripts/rez;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/al/lib;C:/Program Files/Autodesk/Bifrost/Maya2022/2.3.1.0/bifrost/bin;C:/Program Files/Autodesk/Maya2022/plug-ins/MASH/bin;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/lib;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/lib/gtest;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/pxr/maya/lib;c:/users/alex.fuller/local_packages/usd/24.05/platform-windows/arch-AMD64/python-3.7/ext/bin;c:/users/alex.fuller/local_packages/usd/24.05/platform-windows/arch-AMD64/python-3.7/ext/lib;c:/users/alex.fuller/local_packages/usd/24.05/platform-windows/arch-AMD64/python-3.7/ext/plugin/usd;C:/Program Files/Side Effects Software/Houdini 20.0.590/engine/maya/maya2022/../../../bin;C:/Program Files/Autodesk/Arnold/maya2022/bin;C:/Program Files/Allegorithmic/Adobe Substance 3D for Maya/2022/lib;C:/Program Files/Autodesk/Bifrost/Maya2022/2.3.1.0/vnn/bin;C:/Program Files/Autodesk/Maya2022/plug-ins/xgen/bin //

getenv "PYTHONPATH";
// Result: C:/Program Files/Autodesk/Maya2022/Python37/DLLs;C:/Program Files/Autodesk/Maya2022/Python37/lib/site-packages;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/al/scripts;C:/Program Files/Autodesk/Maya2022/plug-ins/ATF/scripts;C:/Program Files/Autodesk/Bifrost/Maya2022/2.3.1.0/bifrost/scripts;C:/Program Files/Autodesk/Maya2022/plug-ins/MASH/scripts;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/adsk/scripts;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/lib/scripts;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/pxr/maya/lib/usd/usdMaya/resources;C:/Program Files/Rokoko Motion Library/Maya/2022/scripts;c:/users/alex.fuller/local_packages/usd/24.05/platform-windows/arch-AMD64/python-3.7/ext/lib/python;C:/Program Files/Autodesk/Maya2022/plug-ins/fbx/scripts;C:/Program Files/Side Effects Software/Houdini 20.0.590/engine/maya/maya2022/scripts;C:/Program Files/Autodesk/Maya2022/plug-ins/camd/scripts;C:/Program Files/Autodesk/Arnold/maya2022/scripts;C:/Program Files/Allegorithmic/Adobe Substance 3D for Maya/2022/scripts;C:/Program Files/Autodesk/Maya2022/plug-ins/sweep/scripts;C:/Program Files/Autodesk/Bifrost/Maya2022/2.3.1.0/vnn/scripts;C:/Program Files/Autodesk/Maya2022/plug-ins/xgen/scripts;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/al/lib/python;C:/Program Files/Autodesk/Bifrost/Maya2022/2.3.1.0/bifrost/python/site-packages;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/lib/python;c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext/plugin/pxr/lib/python; // 

getenv "MAYA_MODULE_PATH";
// Result: c:/users/alex.fuller/local_packages/mayaUSD/0.29.0/platform-windows/maya-2022/ext;C:/Program Files/Autodesk/Maya2022/modules;C:/Users/alex.fuller/Documents/maya/2022/modules;C:/Users/alex.fuller/Documents/maya/modules;C:/Program Files/Common Files/Autodesk Shared/Modules/maya/2022 // 

Steps to reproduce Steps to reproduce the behavior:

  1. Get all the dependencies and requirements stated in https://github.com/Autodesk/maya-usd/blob/dev/doc/build.md but with slight differences (using openusd 24.05)
  2. Build openusd 24.05 + maya-usd 0.29.0 using Visual Studio 17 2022 and the -Tv142 toolset so it matches 2019 which Maya 2022.4 was built from (this builds successfully with minor tweaking)
  3. Make sure the .mod files point exactly to openusd/maya-usd (rez build)
  4. Set MAYA_MODULE_PATH to where the generated mod files are located
  5. Load any of the newly created plugins

Expected behavior More thorough error logging to why a plugin won't load (if possible).

Attachments Screenshot from 2024-07-11 16-14-23

Specs (if applicable):

Additional context I understand that the latest isn't supported with an older Maya, but I am inclined to think it is something else going on here that I'd like to get to the bottom of. I will try an older version of openusd next.

The documentation doesn't really discuss this as an issue to look out for, but when building openusd it builds a few dependencies like TBB which would overlap Maya's built-ins, is this not an issue in-practice?

seando-adsk commented 1 month ago

You have done all the detective work that we normally suggest to users when the plugin doesn't load. The usual suspect is a conflicting USD or MayaUsd in either PYTHONPATH or PATH. I don't see any conflicts in yours.

Did you look at the dependencies for MayaUsd.dll and MayaUsdUI.dll as well, to verify they are getting things from the right place.

At Autodesk when we build USD (for shipping with MayaUsd) we copy the TBB and OpenSubDiv libraries from Maya into the USD build (rather than letting the USD build download and build them). You could try that.

Sean

boberfly commented 1 month ago

Hi @seando-adsk thank you for the reply!

At Autodesk when we build USD (for shipping with MayaUsd) we copy the TBB and OpenSubDiv libraries from Maya into the USD build (rather than letting the USD build download and build them). You could try that.

Ok so I only noticed DependenciesGui.exe won't flag in red/orange any conflicts or missing DLLs until you dive down into some of them, and in this case UsdImagingGL had issues with ptex of all things. Looks like 2022.4's shipped v2.3 was in-preference over the v2.4 that OpenUSD likes to target. So, my 3 options here is to disable ptex, use Maya's or v2.3 of ptex or just modify the OpenUSD build to make a static lib over a dynamic one.

I guess with Ptex it never went through what Boost or Imath solved with just attaching the version number to the suffix to get around these issues. All good, live and learn - maybe this can help others trying to build MayaUSD.

Cheers

seando-adsk commented 1 month ago

We don't enable PTEX in our USD builds. So unless you specifically need it I would suggest just disabling it (it is off by default).

Sean