Skip to content

Commit

Permalink
HYDRA-307 : Modifs from code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Feb 23, 2024
1 parent eff7ba8 commit d8d2779
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 245 deletions.
19 changes: 5 additions & 14 deletions test/lib/mayaUsd/render/mayaToHydra/testFlowViewportAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class TestFlowViewportAPI(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTe
IMAGE_DIFF_FAIL_THRESHOLD = 0.1
IMAGE_DIFF_FAIL_PERCENT = 2

@classmethod
def tearDownClass(cls):
#Finish by a File New command to check that it's not crashing when cleaning up everything'
cmds.file(new=True, force=True)

def setupScene(self):
self.setHdStormRenderer()

Expand Down Expand Up @@ -102,9 +107,6 @@ def test_AddingPrimitives(self):
self.setHdStormRenderer()
self.assertSnapshotClose("add_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test filtering primitives
def test_FilteringPrimitives(self):
self.setupScene()
Expand Down Expand Up @@ -184,9 +186,6 @@ def test_FilteringPrimitives(self):
cmds.setAttr(sphereShape + '.subdivisionsAxis', 30) #Unfilter the prim
cmds.refresh()
self.assertSnapshotClose("filter_VP2AndThenBackToStorm_MovedSphereUnFiltered.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test Cube grids parameters
def test_CubeGrid(self):
Expand Down Expand Up @@ -241,9 +240,6 @@ def test_CubeGrid(self):
self.setHdStormRenderer()
self.assertSnapshotClose("cubeGrid_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test multiple nodes
def test_MultipleNodes(self):
self.setupScene()
Expand Down Expand Up @@ -345,9 +341,6 @@ def test_MultipleNodes(self):
self.setHdStormRenderer()
self.assertSnapshotClose("multipleNodes_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test multiple viewports
def test_MultipleViewports(self):
with PluginLoaded('flowViewportAPIMayaLocator'):
Expand Down Expand Up @@ -425,7 +418,5 @@ def test_MultipleViewports(self):
self.setHdStormRenderer()
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan2.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)
if __name__ == '__main__':
fixturesUtils.runTests(globals())
23 changes: 7 additions & 16 deletions test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ def imageDiffFailThreshold(self):
def imageDiffFailPercent(self):
return 0.1

@classmethod
def tearDownClass(cls):
#Finish by a File New command to check that it's not crashing when cleaning up everything'
cmds.file(new=True, force=True)

def setupScene(self):
testFile = mayaUtils.openTestScene( #Is an empty scene that is used to zoom in more on the foot print nodes, it also has Storm already set as the renderer
"testFootPrintNode",
"testFootPrintNode.ma")
self.setHdStormRenderer()
cmds.move(7.714, 5.786, 7.714, 'persp')
cmds.refresh()
self.setHdStormRenderer()#set Storm as the renderer (even if the scene is supposed to have it already)

#Test adding primitives
def test_AddingPrimitives(self):
Expand Down Expand Up @@ -105,9 +108,6 @@ def test_AddingPrimitives(self):
self.setHdStormRenderer()
self.assertSnapshotClose("add_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)

#Finish by a File New command to check that it's not crashing when cleaning up everything'
cmds.file(new=True, force=True)

#Test FootPrint grids parameters
def test_FootPrintAttributes(self):
with PluginLoaded('mayaHydraFootPrintNode'):
Expand All @@ -133,9 +133,6 @@ def test_FootPrintAttributes(self):
self.setHdStormRenderer()
self.assertSnapshotClose("footPrint_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test multiple nodes
def test_MultipleNodes(self):
with PluginLoaded('mayaHydraFootPrintNode'):
Expand Down Expand Up @@ -204,9 +201,6 @@ def test_MultipleNodes(self):
self.setHdStormRenderer()
self.assertSnapshotClose("multipleNodes_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test multiple viewports
def test_MultipleViewports(self):
with PluginLoaded('mayaHydraFootPrintNode'):
Expand Down Expand Up @@ -260,9 +254,6 @@ def test_MultipleViewports(self):
self.setHdStormRenderer()
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan3.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)

#Finish by a File New command to check that it's not crashing when cleaning up everything
cmds.file(new=True, force=True)

#Test loading a scene
def test_Load(self):
with PluginLoaded('mayaHydraFootPrintNode'):
Expand Down
Loading

0 comments on commit d8d2779

Please sign in to comment.