Skip to content

Commit

Permalink
HYDRA-1020 : Re-enable 2 failing tests now that selection highlight o… (
Browse files Browse the repository at this point in the history
#221)

* HYDRA-1020 : Re-enable 2 failing tests now that selection highlight on instances work (with usd 24.11)

* Try to revert the images
  • Loading branch information
lanierd-adsk authored Dec 10, 2024
1 parent 25ae907 commit a950e95
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,13 @@ def test_UsdStageVariants(self):
self.assertIsNotNone(cube2Prim)
cube3Prim = shapeStage.GetPrimAtPath('/Cubes/Geom/CubeThree')
self.assertIsNotNone(cube3Prim)
cube1Prim.SetInstanceable(True)
self.assertTrue(cube1Prim.IsInstanceable())
#It is not legal in usd to set cube1 as instanceable
#We get the warning :
# Warning: The gprim at path </__Prototype_1> was directly instanced. In order to instance this prim, put the prim under an Xform, and instance the Xform parent.
#We have another test to check for selection highlight on instanceable prims (native instances)
cube1Prim.SetInstanceable(False) #don't set it as instanceable
self.assertFalse(cube1Prim.IsInstanceable())

cube2Prim.SetInstanceable(True)
self.assertTrue(cube2Prim.IsInstanceable())
cube3Prim.SetInstanceable(True)
Expand All @@ -103,20 +108,20 @@ def test_UsdStageVariants(self):
self.assertSnapshotClose("oneCubeInstanceable.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
ufeGlobalSel.clear()

# At time of writing selection highlighting of native instanced prims
# does not work (HYDRA-1161). Enable the following tests when
# HYDRA-1161 is fixed.
return
modVariant.SetVariantSelection('TwoCubes')
self.assertEqual(modVariant.GetVariantSelection(), 'TwoCubes')
ufeGlobalSel.append(cubesItems)
self.assertSnapshotClose("twoCubesInstanceable.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
ufeGlobalSel.clear()
#Do these image comparisons only with usd 24.11+ where the selection highlight on instanceable prims is working
if self._usdVersion >= (0, 24, 11):
modVariant.SetVariantSelection('TwoCubes')
self.assertEqual(modVariant.GetVariantSelection(), 'TwoCubes')
ufeGlobalSel.append(cubesItems)
self.assertSnapshotClose("twoCubesInstanceable.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
ufeGlobalSel.clear()

modVariant.SetVariantSelection('ThreeCubes')
self.assertEqual(modVariant.GetVariantSelection(), 'ThreeCubes')
ufeGlobalSel.append(cubesItems)
self.assertSnapshotClose("threeCubesInstanceable.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
modVariant.SetVariantSelection('ThreeCubes')
self.assertEqual(modVariant.GetVariantSelection(), 'ThreeCubes')
ufeGlobalSel.append(cubesItems)
self.assertSnapshotClose("threeCubesInstanceable.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

self.resetDefaultLightIntensityByUsdVersion()

if __name__ == '__main__':
fixturesUtils.runTests(globals())

0 comments on commit a950e95

Please sign in to comment.