From a950e95ca664f5adea34cfed24b27a9824da1193 Mon Sep 17 00:00:00 2001 From: David Lanier <122012029+lanierd-adsk@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:49:06 +0100 Subject: [PATCH] =?UTF-8?q?HYDRA-1020=20:=20Re-enable=202=20failing=20test?= =?UTF-8?q?s=20now=20that=20selection=20highlight=20o=E2=80=A6=20(#221)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * HYDRA-1020 : Re-enable 2 failing tests now that selection highlight on instances work (with usd 24.11) * Try to revert the images --- .../render/mayaToHydra/testStageVariants.py | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py index c23ed0837..de5bd4cd3 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py @@ -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 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) @@ -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())