### Installing plugInfo.json Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usd/CMakeLists.txt Installs the generated plugInfo.json file from the build directory to the configured installation destination. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/usd/plugInfo.json DESTINATION ${INSTALL_DESTINATION} ) ``` -------------------------------- ### Install Library Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsdAPI/CMakeLists.txt Installs the main library, archive, and runtime components. ```cmake set(LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib ) install( TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${LIBRARY_INSTALL_PATH} ARCHIVE DESTINATION ${LIBRARY_INSTALL_PATH} RUNTIME DESTINATION ${LIBRARY_INSTALL_PATH} ) ``` -------------------------------- ### Install Help Table File Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsd/resources/helpTable/CMakeLists.txt Installs the helpTableMayaUSD file to the specified destination directory within the installation prefix. ```cmake install(FILES "helpTableMayaUSD" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/helpTable" ) ``` -------------------------------- ### Install Python Module Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/usdtransaction/CMakeLists.txt Installs the Python __init__.py files to the target installation directory. ```cmake # install python module foreach(INPUT_FILE ${PY_INIT_FILES}) string(REPLACE ${CMAKE_CURRENT_SOURCE_DIR} ${AL_INSTALL_PREFIX}/lib/python OUTPUT_FILE ${INPUT_FILE}) get_filename_component(OUTPUT_PATH ${OUTPUT_FILE} DIRECTORY) install(FILES ${INPUT_FILE} # .py files DESTINATION ${OUTPUT_PATH} ) endforeach() ``` -------------------------------- ### Install Library and PDB Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/utils/AL/CMakeLists.txt Installs the AL_EventSystem library to the specified destination and optionally installs the PDB file on Windows. ```cmake install(TARGETS ${EVENTS_LIBRARY_NAME} LIBRARY DESTINATION ${EVENTS_LIBRARY_LOCATION} RUNTIME DESTINATION ${EVENTS_LIBRARY_LOCATION} ) if(IS_WINDOWS) install(FILES $ DESTINATION ${EVENTS_LIBRARY_LOCATION} OPTIONAL) endif() ``` -------------------------------- ### Install plugInfo.json Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/usdtransaction/CMakeLists.txt Installs the main plugInfo.json file to the USD resources directory and creates a secondary plugInfo.json for includes. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json DESTINATION ${AL_INSTALL_PREFIX}/lib/usd/${LIBRARY_NAME}/resources ) install(CODE "file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/lib/usd/plugInfo.json\" \"{\\n \\\"Includes\\\": [ \\\"*/resources/\\\" ]\\n}\")" ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/usd/plugInfo.json DESTINATION ${AL_INSTALL_PREFIX}/lib/usd ) ``` -------------------------------- ### Configure and Install plugInfo.json Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/schemas/AL/usd/schemas/mayatest/CMakeLists.txt Configures the plugInfo.json file using CMake's configure_file command and then installs it to the specified resource destination path. ```cmake # Bake relative path configure_file( ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json ${CMAKE_CURRENT_BINARY_DIR} ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json DESTINATION ${resources_install_path} ) ``` -------------------------------- ### Install Maya USD Python Libraries Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsd/python/CMakeLists.txt Configures the installation path for Python libraries and installs the main Python target. Includes conditional installation of PDB files on Windows. ```cmake set(PYLIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib/python/${PROJECT_NAME}/lib) install(TARGETS ${PYTHON_TARGET_NAME} LIBRARY DESTINATION ${PYLIB_INSTALL_PREFIX} ARCHIVE DESTINATION ${PYLIB_INSTALL_PREFIX} RUNTIME DESTINATION ${PYLIB_INSTALL_PREFIX} ) if(IS_WINDOWS) install(FILES $ DESTINATION ${PYLIB_INSTALL_PREFIX} OPTIONAL) endif() install(FILES __init__.py DESTINATION ${PYLIB_INSTALL_PREFIX}) ``` -------------------------------- ### Configure and Build AL_USDMaya with CMake Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/build.md Configure the build using CMake with specified paths for installation, modules, Maya, USD, and Google Test. Then, compile and install the project using make. ```bash cmake \ -DCMAKE_INSTALL_PREFIX='/path/to/install' \ -DCMAKE_MODULE_PATH='/paths/to/folders/which/have/cmake/files' \ -DMAYA_LOCATION='/path/to/maya' \ -DUSD_CONFIG_FILE='/path/to/pxrConfig.cmake'\ -DGTEST_ROOT='/path/to/googletest'\ -DCMAKE_PREFIX_PATH='/path/to/maya/lib/cmake' .. make -j install ``` -------------------------------- ### Install Maya USD Plugin Libraries and Binaries Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/adsk/plugin/CMakeLists.txt Installs the plugin target, including libraries to the plugin directory and runtime executables to the plugin directory. The PDB file is installed optionally on Windows. ```cmake install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${INSTALL_DIR_SUFFIX}/plugin RUNTIME DESTINATION ${INSTALL_DIR_SUFFIX}/plugin ) if(IS_WINDOWS) install(FILES $ DESTINATION ${INSTALL_DIR_SUFFIX}/plugin OPTIONAL) endif() ``` -------------------------------- ### Install Headers Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsdAPI/CMakeLists.txt Installs header files to the include directory. ```cmake install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME} ) ``` -------------------------------- ### Install Library Targets Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/CMakeLists.txt Configures installation paths for library, archive, and runtime components of the project. Ensures these are placed in the appropriate lib directory. ```cmake install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) ``` -------------------------------- ### Install Library Icons Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsd/resources/icons/CMakeLists.txt Installs various library icons, similar to Outliner icons, by renaming _100.png files and installing higher resolution versions. ```cmake set(LIB_ICONS saveOption1 saveOption2 saveOption3 discard_edits edit_as_Maya merge_to_USD cache_to_USD orphaned_node_badge ) foreach(ICON_BASE ${LIB_ICONS}) # The _100.png files need to be installed without the _100. This is the # base icon name that is used. Maya will automatically choose the _150/_200 # image if neeeded. install(FILES "${ICON_BASE}_100.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" RENAME "${ICON_BASE}.png" ) install(FILES "${ICON_BASE}_150.png" "${ICON_BASE}_200.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" ) endforeach() ``` -------------------------------- ### Install Maya USD API Header Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsdAPI/CMakeLists.txt Installs the main Maya USD API header file. ```cmake install(FILES ${CMAKE_BINARY_DIR}/include/${PROJECT_NAME}/mayaUsdAPI.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) ``` -------------------------------- ### Install Plugin Target Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/plugin/AL_USDMayaPlugin/CMakeLists.txt Installs the AL_USDMayaPlugin target as a library and runtime artifact to the specified plugin destination. ```cmake install(TARGETS ${PXR_PACKAGE} LIBRARY DESTINATION ${AL_INSTALL_PREFIX}/plugin RUNTIME DESTINATION ${AL_INSTALL_PREFIX}/plugin ) ``` -------------------------------- ### Install USD Plugin Resources Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/schemas/AL/usd/schemas/maya/CMakeLists.txt Installs generated USD plugin resources, including plugInfo.json and schema definition files, to the specified resource path. ```cmake file(RELATIVE_PATH SCHEMAS_LIBRARY_DIR ${resources_install_path}/.. ${library_install_path} ) # Bake relative path configure_file( ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json ${CMAKE_CURRENT_BINARY_DIR} ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json DESTINATION ${resources_install_path} ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/generatedSchema.usda DESTINATION ${resources_install_path} ) ``` -------------------------------- ### Get Help for a Maya Command Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/basicUsage.md Displays help information for a specific Maya command registered by the AL_USDMaya plugin. This example shows how to get help for the AL_usdmaya_ProxyShapeImport command. ```mel AL_usdmaya_ProxyShapeImport -help ``` -------------------------------- ### Install Maya USD Library Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/schemas/AL/usd/schemas/maya/CMakeLists.txt Installs the compiled Maya USD library to the specified installation prefix. This makes the library available for use by other components or applications. ```cmake install( DIRECTORY ${CMAKE_BINARY_DIR}/AL DESTINATION ${AL_INSTALL_PREFIX}/lib/python ) ``` -------------------------------- ### Install Python Module Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsdAPI/CMakeLists.txt Installs an empty __init__.py file to ensure the directory is recognized as a Python module. ```cmake install(FILES __init__.py DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python/${PROJECT_NAME}) ``` -------------------------------- ### Install Public Headers Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/lib/AL_USDMaya/CMakeLists.txt Installs various sets of public header files into their respective include directories within the installation prefix. This makes the AL_USDMaya API available for external projects. ```cmake install(FILES ${AL_maya_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/maya ) install(FILES ${AL_usdmaya_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya ) install(FILES ${AL_usdmaya_cmds_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/cmds ) install(FILES ${AL_usdmaya_fileio_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/fileio ) install(FILES ${AL_usdmaya_nodes_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/nodes ) install(FILES ${AL_usdmaya_nodes_proxy_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/nodes/proxy ) install(FILES ${AL_usdmaya_tests_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/tests ) install(FILES ${AL_usdmaya_fileio_translators_headers} DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usdmaya/fileio/translators ) ``` -------------------------------- ### Install Devtoolset-6 on CentOS Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Instructions for installing Devtoolset-6 on CentOS, including enabling the vault repository, importing the GPG key, and installing the package. ```bash # download the packages, install may fail with "no public key found" sudo yum-config-manager --add-repo=http://vault.centos.org/7.6.1810/sclo/x86_64/rh/ # to fix "no public key found" cd /etc/pki/rpm-gpg ls # confirm RPM-GPG-KEY-CentOS-SIG-SCLo exists sudo rpm --import RPM-GPG-KEY-CentOS-SIG-SCLo rpm -qa gpg* # confirm key with substring f2ee9d55 exists # to install devtoolset-6 sudo yum install devtoolset-6 # disable the vault after successful install sudo yum-config-manager --disable vault.centos.org_7.6.1810_sclo_x86_64_rh_ ``` -------------------------------- ### Maya Node Initialization Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/developer.md Example of a successful node initialization and subsequent attribute editor template generation. ```cpp // Our node successfully initialised! Woot! // All that's left is to generate the attribute editor template. generateAETemplate(); return MS::kSuccess; } ``` -------------------------------- ### Build Maya-USD on Windows Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Example command to build Maya-USD on Windows, specifying Maya, Pixar USD, and Devkit locations, along with the workspace directory. ```bash c:\maya-usd> python build.py --maya-location "C:\Program Files\Autodesk\Maya2025" --pxrusd-location C:\USD-Release --devkit-location C:\devkitBase C:\workspace ``` -------------------------------- ### Install PlugInfo JSON for USD Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/lib/AL_USDMaya/CMakeLists.txt Installs the generated plugInfo.json file to the USD resources directory. This file is used by USD to locate plugin resources. ```cmake install(FILES ${CMAKE_CURRENT_BINARY_DIR}/plugInfo.json DESTINATION ${AL_INSTALL_PREFIX}/lib/usd/${LIBRARY_NAME}/resources ) ``` -------------------------------- ### Copy and Install Python Init Script Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/lib/AL_USDMaya/CMakeLists.txt Copies the __init__.py script to the build directory and then installs it to the final destination. This ensures the Python package structure is correctly set up. ```cmake execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/lib/python/${arDirPath}/__init__.py) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib/python/${arDirPath}/__init__.py DESTINATION ${AL_INSTALL_PREFIX}/lib/python/${arDirPath} ) ``` -------------------------------- ### Install Windows PDB File Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsdAPI/CMakeLists.txt Conditionally installs the Program Database (PDB) file on Windows systems. ```cmake if(IS_WINDOWS) install(FILES $ DESTINATION ${LIBRARY_INSTALL_PATH} OPTIONAL ) endif() ``` -------------------------------- ### Import USD with PhysicsMassAPI Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsd/fileio/doc/SchemaAPI_Import_Export_in_Python.md Example of importing a USD file that contains PhysicsMassAPI. This demonstrates how to re-apply the schema during import and verify its application. ```python cmds.file(new=True, f=True) cmds.mayaUSDImport(file="physics_api_on_sphere.usda", apiSchema=["PhysicsMassAPI"]) sl = om.MSelectionList() # pSphereShape1 is the transform, since the bullet shape prevented # merging the mesh and the transform. # The shape will be named pSphereShape1Shape... sl.add("pSphereShape1") dagPath = sl.getDagPath(0) dagPath.extendToShape() adaptor = mayaUsdLib.Adaptor(dagPath.fullPathName()) print(adaptor.GetAppliedSchemas()) # Returns: ['PhysicsMassAPI'] ``` -------------------------------- ### Setting Installation Destination Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usd/CMakeLists.txt Defines the installation destination for top-level files, specifically setting it to the 'lib/usd' directory within the CMAKE_INSTALL_PREFIX. ```cmake set( INSTALL_DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/usd ) ``` -------------------------------- ### Install AL Plugin Module Source: https://github.com/autodesk/maya-usd/blob/dev/modules/CMakeLists.txt Configures and installs the AL plugin module. It selects a Windows-specific template if the build is on Windows, otherwise uses a generic template. ```cmake if (BUILD_AL_PLUGIN) if (IS_WINDOWS) configure_file("alUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod) else() configure_file("alUSD.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod) endif() install(FILES ${PROJECT_BINARY_DIR}/alUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Include Order Example Source: https://github.com/autodesk/maya-usd/blob/dev/doc/codingGuidelines.md Headers should be included in a specific order, separated by blank lines, and sorted alphabetically within sections. ```cpp #include "exportTranslator.h" #include "private/util.h" #include #include #include #include #include #include #include #include #include #include #ifdef UFE_V3_FEATURES_AVAILABLE #include #endif ``` -------------------------------- ### Install PXR Plugin Module Source: https://github.com/autodesk/maya-usd/blob/dev/modules/CMakeLists.txt Configures and installs the PXR plugin module. It selects a Windows-specific template if the build is on Windows, otherwise uses a generic template. ```cmake if (BUILD_PXR_PLUGIN) if (IS_WINDOWS) configure_file("pxrUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod) else() configure_file("pxrUSD.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod) endif() install(FILES ${PROJECT_BINARY_DIR}/pxrUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Install Python Module Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/python/CMakeLists.txt Installs the compiled Python extension module and its initialization file to the appropriate Python library directory. ```cmake set(PYLIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib/python/${PROJECT_NAME}) install(TARGETS ${PYTHON_TARGET_NAME} LIBRARY DESTINATION ${PYLIB_INSTALL_PREFIX} ARCHIVE DESTINATION ${PYLIB_INSTALL_PREFIX} RUNTIME DESTINATION ${PYLIB_INSTALL_PREFIX} ) install(FILES __init__.py DESTINATION ${PYLIB_INSTALL_PREFIX}) ``` -------------------------------- ### Build AL_USDMaya with Rez Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/build.md Build and install AL_USDMaya using Rez. Ensure to edit package names to match your internal Rez packages before building. ```bash git clone cd AL_USDMaya rez build --build-target RelWithDebInfo --install -- -- -j 8 ``` -------------------------------- ### Install MayaUtilsTests Target Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt Installs the built target library to the specified test plugins directory. This makes the plugin available for Maya to load. ```cmake install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${MAYAUTILS_TEST_MAYAPLUGIN_INSTALL_PATH} LIBRARY DESTINATION ${MAYAUTILS_TEST_MAYAPLUGIN_INSTALL_PATH} ) ``` -------------------------------- ### Define Library Name and Location Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/utils/AL/CMakeLists.txt Sets the name and installation directory for the AL event system library. ```cmake set(EVENTS_LIBRARY_NAME "AL_EventSystem") set(EVENTS_LIBRARY_LOCATION ${AL_INSTALL_PREFIX}/lib) ``` -------------------------------- ### Install ADSK Plugin Module Source: https://github.com/autodesk/maya-usd/blob/dev/modules/CMakeLists.txt Configures and installs the ADSK plugin module. It selects a Windows-specific template if the build is on Windows, otherwise uses a generic template. ```cmake if (BUILD_ADSK_PLUGIN) if (IS_WINDOWS) configure_file("mayaUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) else() configure_file("mayaUSD.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) endif() install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Install Python Plugin Modules and Config Files Source: https://github.com/autodesk/maya-usd/blob/dev/test/lib/usd/plugin/CMakeLists.txt Installs Python plugin files and their corresponding plugInfo.json configuration files into a structured directory. This loop iterates through a list of plugin names to handle each one individually. ```cmake set(PLUGPLUGIN_NAMES testPlugModule1 testPlugModule2 testPlugModule3 testPlugModule4 testPlugModule5 testPlugModule6 ) foreach(plugName ${PLUGPLUGIN_NAMES}) install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/${plugName}.py" RENAME __init__.py DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/TestMayaUsdPlug/${plugName}") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${plugName}_plugInfo.json" "${CMAKE_CURRENT_BINARY_DIR}/TestMayaUsdPlug/${plugName}/plugInfo.json" ) endforeach() ``` -------------------------------- ### Install Maya Outliner Icons Source: https://github.com/autodesk/maya-usd/blob/dev/lib/mayaUsd/resources/icons/CMakeLists.txt Installs Maya Outliner icons, renaming the _100.png files to remove the resolution suffix. Maya automatically selects higher resolution icons if available. ```cmake set(OUTLINER_ICONS MayaReference ) foreach(ICON_BASE ${OUTLINER_ICONS}) # The _100.png files need to be installed without the _100. This is the # base icon name that is used. Maya will automatically choose the _150/_200 # image if neeeded. install(FILES "out_USD_${ICON_BASE}_100.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" RENAME "out_USD_${ICON_BASE}.png" ) install(FILES "out_USD_${ICON_BASE}_150.png" "out_USD_${ICON_BASE}_200.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" ) endforeach() ``` -------------------------------- ### Install Maya USD Proxy Shape Icon Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/adsk/icons/CMakeLists.txt Installs the specific icon files for the Maya USD proxy shape, including SVG and PNG formats, with custom renaming for the base icon. ```cmake install(FILES "mayaUsdProxyShape.svg" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" ) # Special case - install files for proxy shape base # (same icon as proxy shape). set(MAYAUSDPROXYSHAPE "mayaUsdProxyShape") install(FILES "out_${MAYAUSDPROXYSHAPE}_100.png" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" RENAME "out_${MAYAUSDPROXYSHAPE}Base.png" ) install(FILES "out_${MAYAUSDPROXYSHAPE}_150.png" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" RENAME "out_${MAYAUSDPROXYSHAPE}Base_150.png" ) install(FILES "out_${MAYAUSDPROXYSHAPE}_200.png" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" RENAME "out_${MAYAUSDPROXYSHAPE}Base_200.png" ) install(FILES "${MAYAUSDPROXYSHAPE}.svg" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" RENAME "${MAYAUSDPROXYSHAPE}Base.svg" ) ``` -------------------------------- ### Configure Runtime Search Paths (macOS/Linux) Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/plugin/AL_USDMayaPlugin/CMakeLists.txt Initializes and adds runtime search paths for libraries and plugins on macOS and Linux systems. This includes paths relative to the Maya USD installation and the system's install prefix. ```cmake # handle run-time search paths if(IS_MACOSX OR IS_LINUX) mayaUsd_init_rpath(rpath "plugin") mayaUsd_add_rpath(rpath "../lib") if(DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath(rpath "../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib") elseif(DEFINED PXR_USD_LOCATION) mayaUsd_add_rpath(rpath "${PXR_USD_LOCATION}/lib") endif() if(IS_LINUX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath(rpath "../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib64") endif() if(IS_MACOSX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath(rpath "../../../../Maya.app/Contents/MacOS") endif() mayaUsd_add_rpath(rpath "${CMAKE_INSTALL_PREFIX}/lib") mayaUsd_add_rpath(rpath "${CMAKE_INSTALL_PREFIX}/plugin/pxr/lib") mayaUsd_add_rpath(rpath "${CMAKE_INSTALL_PREFIX}/plugin/pxr/maya/lib") mayaUsd_install_rpath(rpath ${PXR_PACKAGE}) endif() ``` -------------------------------- ### Writing plugInfo.json Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usd/CMakeLists.txt Writes a plugInfo.json file to the build directory. This file specifies include paths for USD plugins and is used during the installation process. ```cmake install(CODE "file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/lib/usd/plugInfo.json\" \"{\\ \\\"Includes\\\": [ \\\"*/resources/\\\" ]\\n}\")" ) ``` -------------------------------- ### Clone Repository and Set Up Development Branch Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/contributing.md Clone your fork of the AL_USDMaya repository and set up a new branch based on the develop branch of the original repository. ```shell git clone https://github.com/your_fork/AL_USDMaya.git cd AL_USD # Add the original repository as a remote git remote add al_origin https://github.com/AnimalLogic/AL_USDMaya.git git fetch al_origin git checkout -b my_feature al_origin/develop ``` -------------------------------- ### Prepare Assets and Shot Structure Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/tutorials/endToEndMaya/README.md These bash commands set up the necessary asset files and shot structure for the tutorial. They involve creating directories, copying files, and running Python scripts to add shading variants and create the room set. ```bash python scripts/create_asset.py Ball --shadingVariantLayer -o models/Ball -f python scripts/create_asset.py Table -o models/Table -f cp assets/Ball/Ball.maya.usd models/Ball/Ball.maya.usd cp assets/Table/Table.maya.usd models/Table/Table.maya.usd cp -r assets/Ball/tex/ models/Ball/ python tutorial_scripts/add_shadingVariants.py -f python tutorial_scripts/create_Room_set.py -f python scripts/create_shot.py s00 -o shots/s00 -b ../../assets/shot.usd -f python scripts/create_shot.py s00_01 -o shots/s00_01 -b ../s00/s00.usd -f python tutorial_scripts/add_set_to_s00.py -f ``` -------------------------------- ### Install Generated Schema USDA File Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/schemas/AL/usd/schemas/mayatest/CMakeLists.txt Installs the generated USDA schema file to the designated resource installation path. ```cmake install( FILES ${CMAKE_CURRENT_BINARY_DIR}/generatedSchema.usda DESTINATION ${resources_install_path} ) ``` -------------------------------- ### Install PDB Files on Windows Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/CMakeLists.txt Conditionally installs Program Database (PDB) files for debugging on Windows systems. This is an optional installation. ```cmake if(IS_WINDOWS) install(FILES $ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib OPTIONAL ) endif() ``` -------------------------------- ### Build Maya-USD on Linux Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Example command to build Maya-USD on Linux, specifying Maya, Pixar USD, and Devkit locations, along with the workspace directory. ```bash maya-usd python build.py --maya-location /usr/autodesk/maya2025 --pxrusd-location /usr/local/USD-Release --devkit-location /usr/local/devkitBase /usr/local/workspace ``` -------------------------------- ### Install Python Library Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/lib/AL_USDMaya/CMakeLists.txt Installs the Python library to the specified destination within the installation prefix. This ensures that Maya can find and import the necessary Python modules. ```cmake install(TARGETS ${PYTHON_LIBRARY_NAME} LIBRARY DESTINATION ${AL_INSTALL_PREFIX}/lib/python/${arDirPath} RUNTIME DESTINATION ${AL_INSTALL_PREFIX}/lib/python/${arDirPath} ) ``` -------------------------------- ### Clone and Prepare AL_USDMaya Repository Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/build.md Clone the AL_USDMaya repository and create a build directory. This is the initial step before configuring the build with CMake. ```bash git clone cd AL_USDMaya mkdir build cd build ``` -------------------------------- ### Define MayaUtils Test Plugin Installation Path Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt Sets a variable to define the installation path for the MayaUtils test plugins. This path is used later in the install command. ```cmake set(MAYAUTILS_TEST_MAYAPLUGIN_INSTALL_PATH ${AL_INSTALL_PREFIX}/testplugins) ``` -------------------------------- ### Build AL_USDMaya Docker Image Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/build.md Build the AL_USDMaya Docker image by cloning the repository and executing the build script. Ensure the base Docker image flavor matches the one used in the docker-usd repository. ```bash git clone https://github.al.com.au/rnd/AL_USDMaya cd AL_USDMaya sudo ./build_docker_centos6.sh ``` -------------------------------- ### Install Plugin Icons with CMake Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/adsk/icons/CMakeLists.txt Installs various plugin icons, ensuring that the base icon name is used for installation, allowing Maya to automatically select the appropriate resolution (_100, _150, _200). ```cmake set(PLUGIN_ICONS out_mayaUsdProxyShape menu_options toggle_off toggle_on USD_generic USD_stage ) foreach(ICON_BASE ${PLUGIN_ICONS}) # The _100.png files need to be installed without the _100. This is the # base icon name that is used. Maya will automatically choose the _150/_200 # image if neeeded. install(FILES "${ICON_BASE}_100.png" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" RENAME "${ICON_BASE}.png" ) install(FILES "${ICON_BASE}_150.png" "${ICON_BASE}_200.png" DESTINATION "${INSTALL_DIR_SUFFIX}/icons" ) endforeach() ``` -------------------------------- ### Set Maya USD Installation Subdirectory Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/pxr/maya/CMakeLists.txt Specifies the subdirectory where Maya-specific USD components will be installed. ```cmake set(PXR_INSTALL_SUBDIR "maya") ``` -------------------------------- ### Import USD File with AL_usdmaya_ImportCommand Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/MIGRATION_GUIDE.md Import a USD file using the AL_usdmaya_ImportCommand. ```bash AL_usdmaya_ImportCommand -f "" -primPath "/path/to/prim" ...options... ``` -------------------------------- ### Build Maya-USD on macOS Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Example command to build Maya-USD on macOS, specifying Maya, Pixar USD, and Devkit locations, along with the workspace directory. ```bash maya-usd python build.py --maya-location /Applications/Autodesk/maya2025 --pxrusd-location /opt/local/USD-Release --devkit-location /opt/local/devkitBase /opt/local/workspace ``` -------------------------------- ### Install MtoH Plugin Module Source: https://github.com/autodesk/maya-usd/blob/dev/modules/CMakeLists.txt Configures and installs the MtoH plugin module. This is done unconditionally if BUILD_HDMAYA is enabled. ```cmake if (BUILD_HDMAYA) configure_file("mtoh.mod.template" ${PROJECT_BINARY_DIR}/mtoh.mod) install(FILES ${PROJECT_BINARY_DIR}/mtoh.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() ``` -------------------------------- ### Install Debug Symbols on Windows Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/plugin/AL_USDMayaPlugin/CMakeLists.txt Conditionally installs the program database (PDB) file for the AL_USDMayaPlugin on Windows systems for debugging purposes. ```cmake if(IS_WINDOWS) install(FILES $ DESTINATION ${AL_INSTALL_PREFIX}/plugin OPTIONAL) endif() ``` -------------------------------- ### Install PDB File on Windows Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/python/CMakeLists.txt Conditionally installs the Program Database (PDB) file for the Python extension on Windows for debugging purposes. ```cmake if(IS_WINDOWS) install(FILES $ DESTINATION ${PYLIB_INSTALL_PREFIX} OPTIONAL) endif() ``` -------------------------------- ### Configure Run-Time Search Paths (macOS/Linux) Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/python/CMakeLists.txt Sets up run-time search paths for libraries on macOS and Linux systems, adjusting for different installation scenarios and USD locations. ```cmake if(IS_MACOSX OR IS_LINUX) mayaUsd_init_rpath("rpath" "lib") mayaUsd_add_rpath("rpath" "../../..") if(IS_MACOSX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath("rpath" "../../../../../Maya.app/Contents/MacOS") endif() if(DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath("rpath" "../../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib") if (IS_LINUX) mayaUsd_add_rpath("rpath" "../../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib64") endif() elseif(DEFINED PXR_USD_LOCATION) mayaUsd_add_rpath("rpath" "${PXR_USD_LOCATION}/lib") endif() mayaUsd_install_rpath("rpath" ${PYTHON_TARGET_NAME}) endif() ``` -------------------------------- ### List Installed Python Packages Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Use `pip list` to view installed Python packages and their versions, useful for verifying dependencies. ```bash ➜ pip list Package Version ---------- ------- pip 26.0.1 PyYAML 6.0.2 setuptools 80.9.0 ``` -------------------------------- ### Refer to Boost Python via PXR_BOOST_PYTHON_NAMESPACE Source: https://github.com/autodesk/maya-usd/blob/dev/doc/codingGuidelines.md For USD versions >= 24.11, include and use PXR_BOOST_PYTHON_NAMESPACE to access Boost Python code. ```cpp #include // Use PXR_BOOST_PYTHON_NAMESPACE for Boost Python objects PXR_BOOST_PYTHON_NAMESPACE::object myObject; ``` -------------------------------- ### Handle PyOpenGL Dependency Error Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md If PyOpenGL is not found, install it using pip or update your PYTHONPATH to include the directory where PyOpenGL is installed. ```bash PyOpenGL is not installed. If you have pip installed, run "pip install PyOpenGL" to install it, then re-run this script. If PyOpenGL is already installed, you may need to update your ```PYTHONPATH``` to indicate where it is located. ``` ```bash export PYTHONPATH=$PYTHONPATH:Library/Frameworks/Python.framework/Versions/2.7/site-packages ``` -------------------------------- ### Clone Maya-USD Repository Source: https://github.com/autodesk/maya-usd/blob/dev/doc/build.md Clone the Maya-USD repository to begin the build process. Navigate into the cloned directory. ```bash git clone https://github.com/Autodesk/maya-usd.git cd maya-usd ``` -------------------------------- ### Build USD with MaterialX Support Source: https://github.com/autodesk/maya-usd/blob/dev/doc/MaterialX.md Build the USD library with MaterialX enabled using the provided build script. This command assumes the MaterialX patches have already been applied. ```bash build_usd.py --materialx ``` -------------------------------- ### Install Maya USD Schemas Headers Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/schemas/AL/usd/schemas/maya/CMakeLists.txt Installs public header files for the Maya USD schemas. These headers are essential for integrating with the USD schemas. ```cmake install( FILES ModelAPI.h FrameRange.h api.h tokens.h DESTINATION ${AL_INSTALL_PREFIX}/include/AL/usd/schemas/maya ) ``` -------------------------------- ### Build Base Docker Image with Maya and USD Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/build.md Build a base Docker image containing Maya and USD by cloning the docker-usd repository and running the appropriate build script for your OS and Maya version. ```bash git clone https://github.com/AnimalLogic/docker-usd cd docker-usd/linux sudo ./build-centos6_maya2016.sh ``` -------------------------------- ### Configure USD Test Plugin Info File Source: https://github.com/autodesk/maya-usd/blob/dev/test/lib/usd/plugin/CMakeLists.txt Copies the plug-in information file for the USD test plugin to the build directory. This file contains metadata Maya uses to load the plugin. ```cmake configure_file("${CMAKE_CURRENT_SOURCE_DIR}/plugInfoUsd.json" "${CMAKE_CURRENT_BINARY_DIR}/USD/plugInfo.json" ) ``` -------------------------------- ### Configure Runtime Search Paths (Linux/macOS) Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/lib/AL_USDMaya/CMakeLists.txt Sets up runtime search paths for libraries on macOS and Linux systems. It includes paths relative to the installation prefix and potentially to USD locations. ```cmake if(IS_MACOSX OR IS_LINUX) mayaUsd_init_rpath(rpath lib/python/${arDirPath}) mayaUsd_add_rpath(rpath "${AL_INSTALL_PREFIX}/lib") if(DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath(rpath "../../../../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib") elseif(DEFINED PXR_USD_LOCATION) mayaUsd_add_rpath(rpath "${PXR_USD_LOCATION}/lib") endif() if (IS_LINUX AND DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) mayaUsd_add_rpath(rpath "../../../../../../${MAYAUSD_TO_USD_RELATIVE_PATH}/lib64") endif() mayaUsd_add_rpath(rpath "${CMAKE_INSTALL_PREFIX}/lib") mayaUsd_install_rpath(rpath ${PYTHON_LIBRARY_NAME}) endif() ``` -------------------------------- ### Install Component Creator Test Scripts Source: https://github.com/autodesk/maya-usd/blob/dev/test/lib/componentCreator/CMakeLists.txt Installs a list of Python scripts used for testing the Component Creator functionality. These scripts are organized into a CMake variable for easy management. ```cmake set(COMPONENT_CREATOR_TEST_SCRIPT_FILES testComponentCreatorLoadPlugin.py testComponentCreatorCreateComponentFromNodes.py testComponentCreatorCreateComponentFromUsdPrims.py testComponentCreatorCreateMultiVariantsComponentFromNodes.py testComponentCreatorCreateMultiVariantsComponentFromUsdPrims.py testComponentCreatorAddToComponentFromNodes.py testComponentCreatorAddToComponentFromUsdPrims.py testComponentCreatorDuplicateToComponent.py testComponentCreatorDeleteInComponent.py testComponentCreatorReparentInComponent.py testComponentCreatorRenameInComponent.py testComponentCreatorComponentStageInvariants.py testComponentCreatorAddPrimInComponent.py ) ``` -------------------------------- ### Configure Maya USD Test Plugin Info File Source: https://github.com/autodesk/maya-usd/blob/dev/test/lib/usd/plugin/CMakeLists.txt Copies the plug-in information file for the Maya USD test plugin to the build directory. This file contains metadata Maya uses to load the plugin. ```cmake configure_file("${CMAKE_CURRENT_SOURCE_DIR}/plugInfoMaya.json" "${CMAKE_CURRENT_BINARY_DIR}/Maya/plugInfo.json" ) ``` -------------------------------- ### Import Prim Path and Parents Source: https://github.com/autodesk/maya-usd/blob/dev/plugin/al/docs/proxyShape.md Imports a specified prim path and its parent transforms as AL_usdmaya_Transform nodes into Maya. These nodes act as wrappers for USD transforms, and modifications in Maya are translated back to USD. ```c++ AL_usdmaya_ProxyShapeImportPrimPathAsMaya "ProxyShape1" -pp "/some/prim/path"; ``` -------------------------------- ### Install TreeView Icons with CMake Source: https://github.com/autodesk/maya-usd/blob/dev/lib/usdUfe/resources/icons/CMakeLists.txt This snippet installs TreeView icons. It renames the _100.png files to remove the resolution suffix, as DCC applications will automatically select higher resolution versions if available. ```cmake set(TREEVIEW_ICONS BlendShape Camera Capsule Class CompArcBadge CompArcBadgeV Cone Cube Cylinder Def GeomSubset LightFilter LightPortal Material Mesh NodeGraph NurbsPatch PhysicsJoint Plane PluginLight PointInstancer Points Procedural Render Scope Shader SkelAnimation Skeleton SkelRoot Sphere UI UsdGeomCurves UsdGeomXformable UsdLuxBoundableLightBase UsdLuxNonboundableLightBase UsdTyped Volume ) foreach(ICON_BASE ${TREEVIEW_ICONS}) # The _100.png files need to be installed without the _100. This is the # base icon name that is used. A DCC (such as Maya) will automatically # choose the _150/_200 image if neeeded. install(FILES "out_USD_${ICON_BASE}_100.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" RENAME "out_USD_${ICON_BASE}.png" ) install(FILES "out_USD_${ICON_BASE}_150.png" "out_USD_${ICON_BASE}_200.png" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/icons" ) endforeach() ```