Skip to content

Commit

Permalink
Updated test for UV set name preservation to include set renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjondev committed Apr 12, 2022
1 parent f768d70 commit 135b048
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions test/lib/usd/translators/testUsdExportUVSets.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ def testExportUvVersusUvIndexFromIterator(self):

def testExportMultipleUVSetsPreserveNames(self):
"""
Tests that a cube mesh with multiple UV sets renames them appropriately
and preserves them if requested (with the exception of "map1")
Tests that a cube mesh with multiple UV sets renames them appropriately,
preserves them if requested, and remaps them as specified
"""
usdCubeMesh = self._GetCubeUsdMesh('MultipleUVSetsCube')

Expand Down Expand Up @@ -394,10 +394,35 @@ def testExportMultipleUVSetsPreserveNames(self):
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
self.assertTrue(map1)
self.assertFalse(st)
self.assertFalse(st1)
self.assertTrue(foo1)

usdFilePath = os.path.abspath('UsdExportUVSetsTest.usda')
cmds.usdExport(mergeTransformAndShape=True,
file=usdFilePath,
shadingMode='none',
exportColorSets=False,
exportDisplayColor=False,
exportUVs=True,
preserveUVSetNames=True,
remapUVSetsTo=[
('map1', 'test1'),
])
testUsdExportUVSets._stage = Usd.Stage.Open(usdFilePath)
usdCubeMesh = self._GetCubeUsdMesh('MultipleUVSetsCube')

map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
test1 = usdCubeMesh.GetPrimvar('test1')
self.assertFalse(map1)
self.assertTrue(st)
self.assertFalse(st)
self.assertFalse(st1)
self.assertTrue(foo1)
self.assertTrue(test1)

if __name__ == '__main__':
unittest.main(verbosity=2)

0 comments on commit 135b048

Please sign in to comment.