Skip to content

Commit 991763e

Browse files
authored
Merge pull request #1259 from yannci/fixMayaUsdPlugin10.3
Fix the IECoreUSD build for maya with the USD libraries shipped by Autodesk
2 parents 6a0316d + 8e20697 commit 991763e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config/ie/options

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,15 @@ if targetApp=="maya" :
336336
if usdReg :
337337
USD_INCLUDE_PATH = os.path.join( usdReg["location"], targetApp, compatibilityVersion, "include" )
338338

339+
mayaMajorVersion = mayaVersion.split(".")[0]
339340
mayaLooseVersion = distutils.version.LooseVersion(mayaVersion)
340341
if mayaLooseVersion >= "2022" and mayaLooseVersion < "2023":
341342
# Maya 2022 installs the USD libs and the maya plugin itself for python 2 and 3. This is not the case for the 2020 version
342343
# We make the assumption, that the python version suffix is for Maya 2022 only, because Maya 2023 will be python 3 exclusively.
343344
mayaPythonMajorVersion = mayaReg["pythonVersion"].split(".")[0]
344-
USD_LIB_PATH = os.path.join( mayaUsdReg["location"], "mayausd/USD{}/lib".format( mayaPythonMajorVersion ) )
345+
USD_LIB_PATH = os.path.join( mayaUsdReg["location"], mayaMajorVersion, "mayausd/USD{}/lib".format( mayaPythonMajorVersion ) )
345346
else:
346-
USD_LIB_PATH = os.path.join( mayaUsdReg["location"], "mayausd/USD/lib" )
347+
USD_LIB_PATH = os.path.join( mayaUsdReg["location"], mayaMajorVersion, "mayausd/USD/lib" )
347348

348349
# Pixar introduced a library prefix `usd_` in USD v21.11, which Autodesk does not use yet, so we have to reset the prefix.
349350
# See https://github.com/Autodesk/maya-usd/issues/2108 for reference

contrib/IECoreUSD/src/IECoreUSD/USDScene.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ using namespace IECoreUSD;
9393
#define HasAuthoredValue HasAuthoredValueOpinion
9494
#endif
9595

96+
#if USD_VERSION < 2011
97+
#define GetPrimInPrototype GetPrimInMaster
98+
#endif
99+
96100
namespace
97101
{
98102

@@ -105,7 +109,7 @@ void appendPrimOrMasterPath( const pxr::UsdPrim &prim, IECore::MurmurHash &h )
105109
{
106110
if( prim.IsInstanceProxy() )
107111
{
108-
append( prim.GetPrimInMaster().GetPrimPath(), h );
112+
append( prim.GetPrimInPrototype().GetPrimPath(), h );
109113
}
110114
else
111115
{

0 commit comments

Comments
 (0)