Skip to content

Commit

Permalink
Roopavr/hydra 836/add mto a download support in maya hydra (#71)
Browse files Browse the repository at this point in the history
* Update maya-hydra build.py to support MtoA artifactory download

* remove unwanted string replace
  • Loading branch information
roopavr-adsk authored Feb 15, 2024
1 parent b501edb commit 31b4105
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
15 changes: 13 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,15 @@ def BuildAndInstall(context, buildArgs, stages):
stagesArgs = []
if context.mayaLocation:
extraArgs.append('-DMAYA_LOCATION="{mayaLocation}"'
.format(mayaLocation=context.mayaLocation))
.format(mayaLocation=context.mayaLocation))

if context.mayaUsdLocation:
extraArgs.append('-DMAYAUSD_LOCATION="{mayaUsdLocation}"'
.format(mayaUsdLocation=context.mayaUsdLocation.replace("\\","/")))
.format(mayaUsdLocation=context.mayaUsdLocation))

if context.mtoaLocation:
extraArgs.append('-DMTOAUSD_LOCATION="{mtoaLocation}"'
.format(mtoaLocation=context.mtoaLocation))

if context.pxrUsdLocation:
extraArgs.append('-DPXR_USD_LOCATION="{pxrUsdLocation}"'
Expand Down Expand Up @@ -571,6 +575,9 @@ def Package(context):

parser.add_argument("--mayausd-location", type=str,
help="Directory where MayaUsd is installed.")

parser.add_argument("--mtoa-location", type=str,
help="Directory where MtoA is installed.")

parser.add_argument("--pxrusd-location", type=str,
help="Directory where Pixar USD is installed.")
Expand Down Expand Up @@ -664,6 +671,10 @@ def __init__(self, args):
# MayaUsd Location
self.mayaUsdLocation = (os.path.abspath(args.mayausd_location).replace("\\","/")
if args.mayausd_location else None)

# MtoA Location
self.mtoaLocation = (os.path.abspath(args.mtoa_location).replace("\\","/")
if args.mtoa_location else None)

# PXR USD Location
self.pxrUsdLocation = (os.path.abspath(args.pxrusd_location)
Expand Down
16 changes: 16 additions & 0 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,22 @@ finally:
list(APPEND MAYAUSD_VARNAME_PXR_MTLX_STDLIB_SEARCH_PATHS
"${MAYAUSD_LOCATION}/libraries")
endif()

# mtoa
if(DEFINED MTOA_LOCATION)
list(APPEND MAYAUSD_VARNAME_PATH
"${MTOA_LOCATION}/bin")
list(APPEND MAYAUSD_VARNAME_MAYA_SCRIPT_PATH
"${MTOA_LOCATION}/scripts/mtoa/mel")
list(APPEND MAYAUSD_VARNAME_MAYA_PXR_PLUGINPATH_NAME
"${MTOA_LOCATION}/usd")
list(APPEND MAYAUSD_VARNAME_MAYA_RENDER_DESC_PATH
"${MTOA_LOCATION}/")
list(APPEND MAYAUSD_MATERIALX_SEARCH_PATH
"${MTOA_LOCATION}/materialx/arnold")
list(APPEND MAYAUSD_MATERIALX_SEARCH_PATH
"${MTOA_LOCATION}/materialx/targets")
endif()


if(IS_WINDOWS AND DEFINED ENV{PYTHONHOME})
Expand Down

0 comments on commit 31b4105

Please sign in to comment.