Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Maya module file into separate plugins #731

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,34 @@ if (DEFINED MAYAUSD_TO_USD_RELATIVE_PATH)
else()
set(USD_INSTALL_LOCATION ${PXR_USD_LOCATION})
endif()
if (IS_WINDOWS)
configure_file("modules/mayaUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod)
else()
configure_file("modules/mayaUSD.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod)


#------------------------------------------------------------------------------
# Maya module files
#------------------------------------------------------------------------------
if (BUILD_ADSK_PLUGIN)
if (IS_WINDOWS)
configure_file("modules/mayaUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod)
else()
configure_file("modules/mayaUSD.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod)
endif()
install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
Comment on lines +190 to +197
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each plugin now has its own module file. So configure each one separately.


if (BUILD_PXR_PLUGIN)
if (IS_WINDOWS)
configure_file("modules/pxrUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod)
else()
configure_file("modules/pxrUSD.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod)
endif()
install(FILES ${PROJECT_BINARY_DIR}/pxrUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()

if (BUILD_AL_PLUGIN)
if (IS_WINDOWS)
configure_file("modules/alUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod)
else()
configure_file("modules/alUSD.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod)
endif()
install(FILES ${PROJECT_BINARY_DIR}/alUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
13 changes: 11 additions & 2 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,23 @@ finally:
# -----------------

set(ALL_PATH_VARS
PATH
PYTHONPATH
MAYA_PLUG_IN_PATH
MAYA_SCRIPT_PATH
PXR_PLUGINPATH_NAME
LD_LIBRARY_PATH
)

if(IS_WINDOWS)
# Put path at the front of the list of env vars.
list(INSERT ALL_PATH_VARS 0
PATH
)
else()
list(APPEND ALL_PATH_VARS
LD_LIBRARY_PATH
)
endif()
Comment on lines +142 to +151
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env var PATH is only needed and Windows. And on Windows we don't need LD_LIBRARY_PATH.


# Set initial empty values for all path vars
foreach(pathvar ${ALL_PATH_VARS})
set(MAYAUSD_VARNAME_${pathvar})
Expand Down
5 changes: 5 additions & 0 deletions modules/alUSD.mod.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al
plug-ins: plugin
PYTHONPATH+:=lib/python
PXR_PLUGINPATH_NAME+:=lib/usd
PXR_PLUGINPATH_NAME+:=plugin
Comment on lines +1 to +5
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved here as-is from the mayaUsd.mod.template.

6 changes: 6 additions & 0 deletions modules/alUSD_Win.mod.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al
plug-ins: plugin
PYTHONPATH+:=lib/python
PATH+:=lib
PXR_PLUGINPATH_NAME+:=lib/usd
PXR_PLUGINPATH_NAME+:=plugin
18 changes: 5 additions & 13 deletions modules/mayaUSD.mod.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ presets:
scripts:
resources:
PYTHONPATH+:=lib/python

+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr
icons: maya/lib/usd/usdMaya/resources
plug-ins: maya/plugin
scripts: maya/lib/usd/usdMaya/resources
PYTHONPATH+:=lib/python
PXR_PLUGINPATH_NAME+:=lib/usd
USD_LOCATION:=
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helper env variable which will be set to the location where USD is (when running Maya). Inside Maya can then query and use that var.


+ MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}
icons:
Expand All @@ -27,11 +21,9 @@ ${MAYAUSD_GTEST_PATH}
+ MayaUSD ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/adsk
plug-ins: plugin

+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al
plug-ins: plugin
PYTHONPATH+:=lib/python
PXR_PLUGINPATH_NAME+:=lib/usd
PXR_PLUGINPATH_NAME+:=plugin

+ MTOH ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/lib
icons:
plug-ins: maya
presets:
scripts:
resources:
20 changes: 5 additions & 15 deletions modules/mayaUSD_Win.mod.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ resources:
PYTHONPATH+:=lib/python
PATH+:=bin
PATH+:=lib

+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr
icons: maya/lib/usd/usdMaya/resources
plug-ins: maya/plugin
scripts: maya/lib/usd/usdMaya/resources
PYTHONPATH+:=lib/python
PATH+:=maya/lib
PXR_PLUGINPATH_NAME+:=lib/usd
USD_LOCATION:=

+ MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}
icons:
Expand All @@ -31,12 +24,9 @@ ${MAYAUSD_GTEST_PATH}
+ MayaUSD ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/adsk
plug-ins: plugin

+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al
plug-ins: plugin
PYTHONPATH+:=lib/python
PATH+:=lib
PXR_PLUGINPATH_NAME+:=lib/usd
PXR_PLUGINPATH_NAME+:=plugin

+ MTOH ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/lib
icons:
plug-ins: maya
presets:
scripts:
resources:
Comment on lines 27 to +32
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mtoh doesn't need all these extra vars. This is the syntax to remove them.

6 changes: 6 additions & 0 deletions modules/pxrUSD.mod.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr
icons: maya/lib/usd/usdMaya/resources
plug-ins: maya/plugin
scripts: maya/lib/usd/usdMaya/resources
PYTHONPATH+:=lib/python
PXR_PLUGINPATH_NAME+:=lib/usd
7 changes: 7 additions & 0 deletions modules/pxrUSD_Win.mod.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr
icons: maya/lib/usd/usdMaya/resources
plug-ins: maya/plugin
scripts: maya/lib/usd/usdMaya/resources
PYTHONPATH+:=lib/python
PATH+:=maya/lib
PXR_PLUGINPATH_NAME+:=lib/usd
10 changes: 9 additions & 1 deletion test/lib/usd/pxrUsdPreviewSurface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ set(TARGET_NAME MAYAUSD_NODES_TEST)
# Unit test scripts.
set(TEST_SCRIPT_FILES
testPxrUsdPreviewSurfaceDraw.py
testPxrUsdPreviewSurfaceExport.py
)

if(BUILD_PXR_PLUGIN)
# This test uses the file "PxrUsdPreviewSurfaceExportTest.ma" which
# requires the plugin "pxrUsdPreviewSurface" that is built by the
# Pixar plugin.
list(APPEND TEST_SCRIPT_FILES
testPxrUsdPreviewSurfaceExport.py
)
endif()
Comment on lines +8 to +15
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discovered this while building only the MayaUsd plugin (I turned off Pixar and AL). When running the tests this one failed because it need the pxrUsdPreviewSurface plugin built only when building Pixar plugin.


# copy tests to ${CMAKE_CURRENT_BINARY_DIR} and run them from there
add_custom_target(${TARGET_NAME} ALL)

Expand Down