readme.txt 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Copyright (c) Contributors to the Open 3D Engine Project.
  2. For complete copyright and license terms please see the LICENSE at the root of this distribution.
  3. SPDX-License-Identifier: Apache-2.0 OR MIT
  4. -------------------------------------------------------------------------------
  5. "DccScriptingInterface" aka DCCsi is a Gem for O3DE to extend and interface with dcc tools
  6. in the python ecosystem. Each dcc tool may have it's own specific version of python.
  7. Most are some version of py3+. O3DE provides an install of py3+ and manages package
  8. dependancies with requirements.txt files and the cmake build system.
  9. However Autodesk Maya still uses a version of py2.7 and so we need an alternate way
  10. to deal with package management for this DCC tool.
  11. Maya ships with it's own python interpreter called mayapy.exe
  12. Generally it is located here:
  13. C:\Program Files\Autodesk\Maya2020\bin\mayapy.exe
  14. The python install and site-packages are here:
  15. C:\Program Files\Autodesk\Maya2020\Python\Lib\site-packages
  16. A general goal of the DCCsi is be self-maintained, and to not taint the users installed applications of environment.
  17. So we boostrap additional access to site-packages in our userSetup.py:
  18. "C:\Depot\Lumberyard\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\SDK\Maya\Scripts\userSetup.py"
  19. We don't want users to have to install or use Python2.7 although with maya and possibly other dcc tools we don't have that control. Maya 2020 and earlier versions are still on Python2.7, so instead of forcing another install of python we can just use mayapy to manage extensions.
  20. Pip may already be installed, you can check like so (your maya install path may be different):
  21. C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip --version
  22. If pip is not available yet for your mayapy.
  23. First find out where th site-packages is located
  24. C:\Program Files\Autodesk\Maya2020\bin>mayapy -m site
  25. sys.path = [
  26. 'C:\\Program Files\\Autodesk\\Maya2020\\bin',
  27. 'C:\\Program Files\\Autodesk\\Maya2020\\bin\\python27.zip',
  28. 'C:\\Program Files\\Autodesk\\Maya2020\\Python\\DLLs',
  29. 'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib',
  30. 'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\plat-win',
  31. 'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\lib-tk',
  32. 'C:\\Program Files\\Autodesk\\Maya2020\\Python',
  33. 'C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages',
  34. ]
  35. USER_BASE: 'C:\\Users\\gallowj\\AppData\\Roaming\\Python' (exists)
  36. USER_SITE: 'C:\\Users\\gallowj\\AppData\\Roaming\\Python\\Python27\\site-packages' (doesn't exist)
  37. ENABLE_USER_SITE: True
  38. This is the location we are looking for:
  39. C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages
  40. download get-pip.py and put into the above ^ directory:
  41. https://bootstrap.pypa.io/pip/2.7/get-pip.py
  42. Put that in the root of site-packages:
  43. C:\\Program Files\\Autodesk\\Maya2020\\Python\\lib\\site-packages\\get-pip.py
  44. With get-pip module ready, we run it to install pip:
  45. C:\Program Files\Autodesk\Maya2020\bin>mayapy -m get-pip
  46. Now you should be able to run the following command and verify pip:
  47. C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip --version
  48. pip 20.3.4 from C:\Users\< you >\AppData\Roaming\Python\Python27\site-packages\pip (python 2.7)
  49. Now your local maya install is all set up with pip so you can install additional python packages to use in maya. (note: not all packages are compatible with maya)
  50. Now you will want to run the following file to finish setup...
  51. We have a requirements.txt file with the extension packages we use in the DCCsi.
  52. You'll need the repo/branch path of your O3DE (aka Lumberyard) install.
  53. And you'll need to know where the DCCsi is located, we will install package dependancies there.
  54. Note: you may need to update the paths below to match your local o3de engine install!
  55. C:\Program Files\Autodesk\Maya2020\bin>mayapy -m pip install -r C:\Depot\o3de\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\SDK\Maya\requirements.txt -t C:\Depot\o3de\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\3rdParty\Python\Lib\2.x\2.7.x\site-packages