Skip to content

Commit

Permalink
Disable upAxis translation on import/export in tests
Browse files Browse the repository at this point in the history
Pixar's configuration will use Z-up for USD stages by default, but Maya
defaults to Y-up. This was causing objects to get rotated on
import/export, which caused test failures. Disable this translation for
these tests
  • Loading branch information
dj-mcg committed Oct 8, 2024
1 parent 0668bf5 commit 42f4a17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/lib/mayaUsd/fileio/testDuplicateAs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def testDuplicateAsMaya(self):
# Duplicate USD data as Maya data, placing it under the root.
with mayaUsd.lib.OpUndoItemList():
self.assertTrue(mayaUsd.lib.PrimUpdaterManager.duplicate(
aUsdUfePathStr, ''))
aUsdUfePathStr, '', {'upAxis': False}))

# Should now have two transform nodes in the Maya scene: the path
# components in the second segment of the aUsdItem and bUsdItem will
Expand Down Expand Up @@ -131,7 +131,7 @@ def testDuplicateAsMayaUndoRedo(self):
previousSn = cmds.ls(sl=True, ufe=True, long=True)

# Duplicate USD data as Maya data, placing it under the root.
cmds.mayaUsdDuplicate(aUsdUfePathStr, '')
cmds.mayaUsdDuplicate(aUsdUfePathStr, '', exportOptions='upAxis=0')

def verifyDuplicate():
# Should now have two transform nodes in the Maya scene: the path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ def testImportDisplayColor(self):
testFile = testUtils.getTestScene("UsdPreviewSurface", "DisplayColorCube.usda")
options = ["shadingMode=[[useRegistry,UsdPreviewSurface]]",
"primPath=/",
"preferredMaterial=none"]
"preferredMaterial=none",
"upAxis=0"]
cmds.file(testFile, i=True, type="USD Import",
ignoreVersion=True, ra=True, mergeNamespacesOnClash=False,
namespace="Test", pr=True, importTimeRange="combine",
Expand Down
2 changes: 1 addition & 1 deletion test/lib/usd/translators/testUsdImportXformAnim.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class testUsdImportXformAnim(unittest.TestCase):
def _LoadUsd(self):
# Import the USD file.
usdFilePath = os.path.join(self.inputPath, "UsdImportXformAnimTest", "Mesh.usda")
cmds.usdImport(file=usdFilePath, readAnimData=False)
cmds.usdImport(file=usdFilePath, readAnimData=False, upAxis=False)
self.stage = Usd.Stage.Open(usdFilePath)
self.assertTrue(self.stage)

Expand Down

0 comments on commit 42f4a17

Please sign in to comment.