Skip to content

Commit

Permalink
Merge remote-tracking branch 'public/dev' into vlasovi/HYDRA-538
Browse files Browse the repository at this point in the history
  • Loading branch information
vlasovi committed Mar 28, 2024
2 parents ed6ec61 + 63334cf commit bc5e1e7
Show file tree
Hide file tree
Showing 36 changed files with 137 additions and 292 deletions.
10 changes: 0 additions & 10 deletions test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ foreach(script ${TEST_SCRIPT_FILES})
# Maya uses a very old version of GLEW, so we need support for
# pre-loading a newer version from elsewhere.
"LD_PRELOAD=${ADDITIONAL_LD_PRELOAD}"

# Fallback to old color management. We will have to investigate
# and introduce OCIOv2 compatible version of these tests.
"MAYA_COLOR_MANAGEMENT_SYNCOLOR=1"
)

# Assign a CTest label to these tests for easy filtering.
Expand All @@ -118,8 +114,6 @@ foreach(script ${INTERACTIVE_TEST_SCRIPT_FILES_MESH_ADAPTER})

"LD_PRELOAD=${ADDITIONAL_LD_PRELOAD}"

"MAYA_COLOR_MANAGEMENT_SYNCOLOR=1"

"MAYA_HYDRA_USE_MESH_ADAPTER=1"
)

Expand Down Expand Up @@ -153,10 +147,6 @@ foreach(script ${INTERACTIVE_TEST_SCRIPT_FILES})
# Maya uses a very old version of GLEW, so we need support for
# pre-loading a newer version from elsewhere.
"LD_PRELOAD=${ADDITIONAL_LD_PRELOAD}"

# Fallback to old color management. We will have to investigate
# and introduce OCIOv2 compatible version of these tests.
"MAYA_COLOR_MANAGEMENT_SYNCOLOR=1"
)

# Add a ctest label to these tests for easy filtering.
Expand Down
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.
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.
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.
2 changes: 2 additions & 0 deletions test/lib/mayaUsd/render/mayaToHydra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Some important notes :
- Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_requiredPlugins` variable in your test class.
- Use relative paths in test data to make sure the tests will work anywhere.
- Prefer storing USD data in text-form .usda instead of binary, for readability and ease of modification should a test need to be tweaked.
- By default, tests will disable color management. However, it tends to be automatically re-enabled in certain conditions; while we have mitigated this by re-disabling it every time we've seen this occur, it is safer to make sure it is explicitly disabled if possible, such as by saving test scenes with color management off (as opposed to saving them with an undefined color management status, or having it enabled).
- If you add tests for color management, do **NOT** use the legacy SynColor system, as it is no longer supported on OSX.

# Image comparison

Expand Down
23 changes: 7 additions & 16 deletions test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,8 @@ class TestArnoldLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.
_file = __file__
_requiredPlugins = ['mtoa']

@property
def imageDiffFailThreshold(self):
return 0.01

@property
def imageDiffFailPercent(self):
# HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds
# for that platform specifically for now, so we can still catch issues on other platforms.
if platform.system() == "Darwin":
return 3
return 0.2
IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.2

def verifyLightingModes(self, shadowOn):
imageSuffix = "_shadowOn" if shadowOn else ""
Expand All @@ -47,31 +38,31 @@ def verifyLightingModes(self, shadowOn):
#All Lights mode
cmds.modelEditor(panel, edit=True, displayLights="all")
cmds.refresh()
self.assertSnapshotClose("allLights" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("allLights" + imageSuffix + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#TODO: Enable code below when those lighting modes are supported by arnold lights
#Default Light mode
#cmds.modelEditor(panel, edit=True, displayLights="default")
#cmds.refresh()
#self.assertSnapshotClose("defaultLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
#self.assertSnapshotClose("defaultLight" + imageSuffix + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Selected Light mode
#cmds.modelEditor(panel, edit=True, displayLights="selected")
#cmds.select( clear=True )

#cmds.select( 'aiSkyDomeLight1', r=True )
#cmds.refresh()
#self.assertSnapshotClose("spotLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
#self.assertSnapshotClose("spotLight" + imageSuffix + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Flat Light mode
#cmds.modelEditor(panel, edit=True, displayLights="flat")
#cmds.refresh()
#self.assertSnapshotClose("flatLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
#self.assertSnapshotClose("flatLight" + imageSuffix + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#No Light mode
#cmds.modelEditor(panel, edit=True, displayLights="none")
#cmds.refresh()
#self.assertSnapshotClose("noLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
#self.assertSnapshotClose("noLight" + imageSuffix + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Test arnold lights (e.g., aiSkyDomeLight,etc.) with a maya native sphere and usd sphere.
def test_ArnoldLights(self):
Expand Down
15 changes: 3 additions & 12 deletions test/lib/mayaUsd/render/mayaToHydra/testCurveTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,13 @@ class TestCurveTools(mtohUtils.MayaHydraBaseTestCase):
POINTS = [(0,-5,10), (-10, 0, 0), (0, 5, -10), (10, 0, 0), (0, -5, 5), (-5,0,0), (0,5,-5), (5, 0, 0), (0,0,0)]
CUSTOM_KNOTS = [0,1,2,3,4,5,6,7,8,9,10]

@property
def imageDiffFailThreshold(self):
return 0.05

@property
def imageDiffFailPercent(self):
# HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds
# for that platform specifically for now, so we can still catch issues on other platforms.
if platform.system() == "Darwin":
return 2
return 0.5
IMAGE_DIFF_FAIL_THRESHOLD = 0.05
IMAGE_DIFF_FAIL_PERCENT = 0.5

def compareSnapshot(self, referenceFilename, cameraDistance=15):
self.setBasicCam(cameraDistance)
cmds.refresh()
self.assertSnapshotClose(referenceFilename, self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose(referenceFilename, self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

def setUp(self):
super(TestCurveTools, self).setUp()
Expand Down
59 changes: 27 additions & 32 deletions test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ class TestFootPrintNode(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils
# MayaHydraBaseTestCase.setUpClass requirement.
_file = __file__

@property
def imageDiffFailThreshold(self):
return 0.01

@property
def imageDiffFailPercent(self):
return 0.1
IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.1

def tearDown(self):
#is called after each test : finish by a File New command to check that it's not crashing when cleaning up everything'
Expand All @@ -58,49 +53,49 @@ def test_AddingPrimitives(self):
#Increase its size
cmds.setAttr(footPrintNodeName + '.size', 5)
cmds.refresh()
self.assertSnapshotClose("add_NodeCreated.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeCreated.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Move the transform node, the added prims should move as well
# Get the transform node of the mayaHydraFootPrintNode
transformNode = cmds.listRelatives(footPrintNodeName, parent=True)[0]
self.assertIsNotNone(transformNode)
cmds.move(2, 0.5, -2, transformNode)
cmds.refresh()
self.assertSnapshotClose("add_NodeMoved.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeMoved.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Hide the transform node, this should hide the mayaHydraFootPrintNode node and the added prims as well.
cmds.hide(transformNode)
self.assertSnapshotClose("add_NodeHidden.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeHidden.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Unhide the transform node, this should unhide the mayaHydraFootPrintNode node and the added prims as well.
cmds.showHidden(transformNode)
self.assertSnapshotClose("add_NodeUnhidden.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeUnhidden.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Delete the shape node, this should hide the added prims as well
cmds.delete(footPrintNodeName)
self.assertSnapshotClose("add_NodeDeleted.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeDeleted.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Undo the delete, the node should be visible again so do the added prims
cmds.undo()
self.assertSnapshotClose("add_NodeDeletedUndo.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeDeletedUndo.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Redo the delete, the added prims should be hidden
cmds.redo()
self.assertSnapshotClose("add_NodeDeletedRedo.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeDeletedRedo.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Undo the delete again, the added prims should be visible
cmds.undo()
self.assertSnapshotClose("add_NodeDeletedUndoAgain.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeDeletedUndoAgain.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

cmds.move(-0.2, -0.5, 0, transformNode)
cmds.refresh()
self.assertSnapshotClose("add_NodeMovedAfterDeletionAndUndo.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_NodeMovedAfterDeletionAndUndo.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Switch to VP2
self.setViewport2Renderer()
#Switch back to Storm
self.setHdStormRenderer()
self.assertSnapshotClose("add_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("add_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Test FootPrint grids parameters
def test_FootPrintAttributes(self):
Expand All @@ -110,19 +105,19 @@ def test_FootPrintAttributes(self):
#Create a mayaHydraFootPrintNode node which adds a dataProducerSceneIndex and a Filtering scene index
footPrintNodeName = cmds.createNode("MhFootPrint")
cmds.refresh()
self.assertSnapshotClose("footPrint_BeforeModifs.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("footPrint_BeforeModifs.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Modify the attributes
cmds.setAttr(footPrintNodeName + '.size', 3)
cmds.setAttr(footPrintNodeName + '.color', 1.0, 1.0, 1.0, type="double3")
cmds.refresh()
self.assertSnapshotClose("footPrint_AfterModifs.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("footPrint_AfterModifs.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Switch to VP2
self.setViewport2Renderer()
#Switch back to Storm
self.setHdStormRenderer()
self.assertSnapshotClose("footPrint_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("footPrint_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Test multiple nodes
def test_MultipleNodes(self):
Expand Down Expand Up @@ -158,7 +153,7 @@ def test_MultipleNodes(self):
cmds.move(2, 0, -2, transformNode2)
cmds.refresh()

self.assertSnapshotClose("multipleNodes_BeforeModifs.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleNodes_BeforeModifs.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Modify the color of node #2, it shouldn't change node's #1 color
cmds.setAttr(footPrintNodeName2 + '.color', 1.0, 0.0, 0.0, type="double3")
Expand All @@ -168,21 +163,21 @@ def test_MultipleNodes(self):
cmds.rotate(0, 45, 0)
cmds.scale(4, 1, 1)
cmds.refresh()
self.assertSnapshotClose("multipleNodes_AfterModifs.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleNodes_AfterModifs.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Hide node #1
cmds.hide(transformNode1)
self.assertSnapshotClose("multipleNodes_Node1Hidden.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleNodes_Node1Hidden.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Unhide node #1
cmds.showHidden(transformNode1)
self.assertSnapshotClose("multipleNodes_Node1Unhidden.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleNodes_Node1Unhidden.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Switch to VP2
self.setViewport2Renderer()
#Switch back to Storm
self.setHdStormRenderer()
self.assertSnapshotClose("multipleNodes_VP2AndThenBackToStorm.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleNodes_VP2AndThenBackToStorm.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Test multiple viewports
def test_MultipleViewports(self):
Expand Down Expand Up @@ -213,25 +208,25 @@ def test_MultipleViewports(self):
cmds.refresh()

cmds.setFocus ('modelPanel4')
self.assertSnapshotClose("multipleViewports_viewPanel4.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_viewPanel4.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
cmds.setFocus ('modelPanel1')
self.assertSnapshotClose("multipleViewports_viewPanel1.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_viewPanel1.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Switch to VP2
cmds.setFocus ('modelPanel4')
self.setViewport2Renderer()
self.assertSnapshotClose("multipleViewports_VP2_modPan4.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_VP2_modPan4.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
cmds.setFocus ('modelPanel1')
self.setViewport2Renderer()
self.assertSnapshotClose("multipleViewports_VP2_modPan3.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_VP2_modPan3.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Switch back to Storm
cmds.setFocus ('modelPanel4')
self.setHdStormRenderer()
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan4.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan4.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)
cmds.setFocus ('modelPanel1')
self.setHdStormRenderer()
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan3.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("multipleViewports_VP2AndThenBackToStorm_modPan3.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Test loading a scene
def test_Load(self):
Expand All @@ -241,7 +236,7 @@ def test_Load(self):
"testFootPrintNode",
"testFootPrintNodeSaved.ma")
cmds.refresh()
self.assertSnapshotClose("loadingFootPrintScene.png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("loadingFootPrintScene.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

if __name__ == '__main__':
fixturesUtils.runTests(globals())
21 changes: 6 additions & 15 deletions test/lib/mayaUsd/render/mayaToHydra/testLookThrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ class TestLookThrough(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.M
# MayaHydraBaseTestCase.setUpClass requirement.
_file = __file__

@property
def imageDiffFailThreshold(self):
return 0.01

@property
def imageDiffFailPercent(self):
# HYDRA-837 : Wireframes seem to have a slightly different color on macOS. We'll increase the thresholds
# for that platform specifically for now, so we can still catch issues on other platforms.
if platform.system() == "Darwin":
return 3
return 0.2
IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.2

#Test look through camera and maya lights (spot & area).
def test_LookThrough(self):
Expand All @@ -46,22 +37,22 @@ def test_LookThrough(self):

#Verify Default display
panel = mayaUtils.activeModelPanel()
self.assertSnapshotClose("default" + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("default" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Verify look through camera
cmds.lookThru( panel, 'persp1' )
cmds.refresh()
self.assertSnapshotClose("lookThroughCamera" + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("lookThroughCamera" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Verify look through spot Light
cmds.lookThru( panel, 'spotLight1' )
cmds.refresh()
self.assertSnapshotClose("lookThroughSpotLight" + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("lookThroughSpotLight" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

#Verify look through area light, use a small far clip to clip the scene
cmds.lookThru( panel, 'areaLight1', nc=0.0, fc=7.5 )
cmds.refresh()
self.assertSnapshotClose("lookThroughAreaLight" + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent)
self.assertSnapshotClose("lookThroughAreaLight" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

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

0 comments on commit bc5e1e7

Please sign in to comment.