Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UsdGeomPrimvarAPI in UVExport Tests #2361

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions test/lib/usd/translators/testUsdExportUVSets.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,11 @@ def reexportUVSets(preserveUVSetNames, remapUVSetsTo):

# Sets should all be renamed to st1, st2, etc. by default
usdCubeMesh = self._GetCubeUsdMesh('MultipleUVSetsCube')
map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
pvAPI = UsdGeom.PrimvarsAPI(usdCubeMesh)
map1 = pvAPI.GetPrimvar('map1')
st = pvAPI.GetPrimvar('st')
st1 = pvAPI.GetPrimvar('st1')
foo1 = pvAPI.GetPrimvar('foo1')
self.assertFalse(map1)
self.assertTrue(st)
self.assertTrue(st1)
Expand All @@ -394,10 +395,11 @@ def reexportUVSets(preserveUVSetNames, remapUVSetsTo):
usdCubeMesh = reexportUVSets(
preserveUVSetNames=True,
remapUVSetsTo=[])
map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
pvAPI = UsdGeom.PrimvarsAPI(usdCubeMesh)
map1 = pvAPI.GetPrimvar('map1')
st = pvAPI.GetPrimvar('st')
st1 = pvAPI.GetPrimvar('st1')
foo1 = pvAPI.GetPrimvar('foo1')
self.assertTrue(map1)
self.assertFalse(st)
self.assertFalse(st1)
Expand All @@ -408,11 +410,12 @@ def reexportUVSets(preserveUVSetNames, remapUVSetsTo):
usdCubeMesh = reexportUVSets(
preserveUVSetNames=True,
remapUVSetsTo=[('map1', 'test1')])
map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
test1 = usdCubeMesh.GetPrimvar('test1')
pvAPI = UsdGeom.PrimvarsAPI(usdCubeMesh)
map1 = pvAPI.GetPrimvar('map1')
st = pvAPI.GetPrimvar('st')
st1 = pvAPI.GetPrimvar('st1')
foo1 = pvAPI.GetPrimvar('foo1')
test1 = pvAPI.GetPrimvar('test1')
self.assertFalse(map1)
self.assertFalse(st)
self.assertFalse(st1)
Expand All @@ -424,11 +427,12 @@ def reexportUVSets(preserveUVSetNames, remapUVSetsTo):
usdCubeMesh = reexportUVSets(
preserveUVSetNames=False,
remapUVSetsTo=[('map1', 'test1')])
map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
test1 = usdCubeMesh.GetPrimvar('test1')
pvAPI = UsdGeom.PrimvarsAPI(usdCubeMesh)
map1 = pvAPI.GetPrimvar('map1')
st = pvAPI.GetPrimvar('st')
st1 = pvAPI.GetPrimvar('st1')
foo1 = pvAPI.GetPrimvar('foo1')
test1 = pvAPI.GetPrimvar('test1')
self.assertFalse(map1)
self.assertFalse(st)
self.assertTrue(st1)
Expand All @@ -440,12 +444,13 @@ def reexportUVSets(preserveUVSetNames, remapUVSetsTo):
usdCubeMesh = reexportUVSets(
preserveUVSetNames=False,
remapUVSetsTo=[('map1', 'test1'), ('foo1', 'test2')])
map1 = usdCubeMesh.GetPrimvar('map1')
st = usdCubeMesh.GetPrimvar('st')
st1 = usdCubeMesh.GetPrimvar('st1')
foo1 = usdCubeMesh.GetPrimvar('foo1')
test1 = usdCubeMesh.GetPrimvar('test1')
test2 = usdCubeMesh.GetPrimvar('test2')
pvAPI = UsdGeom.PrimvarsAPI(usdCubeMesh)
map1 = pvAPI.GetPrimvar('map1')
st = pvAPI.GetPrimvar('st')
st1 = pvAPI.GetPrimvar('st1')
foo1 = pvAPI.GetPrimvar('foo1')
test1 = pvAPI.GetPrimvar('test1')
test2 = pvAPI.GetPrimvar('test2')
self.assertFalse(map1)
self.assertFalse(st)
self.assertFalse(st1)
Expand Down