Skip to content

Commit aed88ca

Browse files
committed
Fix export tests to explicitly set legacyMaterialScope=False
Tests fail without this flag when the default materialScope behavior changes. Explicitly setting legacyMaterialScope=False ensures the tests produce the expected output regardless of the default setting.
1 parent 03e5aa8 commit aed88ca

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

test/lib/usd/translators/testUsdExportEmptyXforms.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ def _exportToUSD(self, filename, includeEmpties, defaultPrimPath=None):
139139
'''
140140
Export to USD, either including or excluding empty Xforms.
141141
'''
142-
cmds.usdExport(file=filename, includeEmptyTransforms=includeEmpties, defaultPrim=defaultPrimPath)
142+
cmds.usdExport(file=filename, includeEmptyTransforms=includeEmpties,
143+
defaultPrim=defaultPrimPath, legacyMaterialScope=False,
144+
materialsScopeName='mtl',
145+
chaser=["AddPayloadOrRefChaser"])
143146

144147
def _verifyPrims(self, stage, present = [], absent = []):
145148
'''

test/lib/usd/translators/testUsdExportMaterialX.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def testExportTexturedMaterialXpPlane1(self):
146146
usdFilePath = os.path.abspath('UsdExportMaterialXTest.usda')
147147
cmds.mayaUSDExport(mergeTransformAndShape=True, file=usdFilePath,
148148
shadingMode='useRegistry', convertMaterialsTo=['MaterialX'],
149-
materialsScopeName='Materials', defaultPrim='None')
149+
materialsScopeName='Materials', legacyMaterialScope=False,
150+
defaultPrim='None')
150151

151152
stage = Usd.Stage.Open(usdFilePath)
152153
self.assertTrue(stage)
@@ -292,7 +293,8 @@ def testPythonCustomShaderExporter(self):
292293
usdFilePath = os.path.abspath('MaterialX_decal.usda')
293294
cmds.mayaUSDExport(mergeTransformAndShape=True, file=usdFilePath,
294295
shadingMode='useRegistry', convertMaterialsTo=['MaterialX'],
295-
materialsScopeName='Materials', defaultPrim='None')
296+
materialsScopeName='Materials', legacyMaterialScope=False,
297+
defaultPrim='None')
296298

297299
stage = Usd.Stage.Open(usdFilePath)
298300
self.assertTrue(stage)

0 commit comments

Comments
 (0)