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
…n instances work (with usd 24.11)
  • Loading branch information
lanierd-adsk committed Dec 9, 2024
1 parent 505b724 commit 72563b6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 15 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 72563b6

Please sign in to comment.