Skip to content

Commit

Permalink
Merge pull request #3938 from Autodesk/azharia/EMSUSD-1654/updates-ba…
Browse files Browse the repository at this point in the history
…seline-images-for-testVP2RenderDelegateLights-test

EMSUSD-1654 Updated baseline images for testVP2RenderDelegateLights test
  • Loading branch information
seando-adsk authored Oct 1, 2024
2 parents 602a22e + efe9fbb commit 2d5da8f
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions test/lib/mayaUsd/render/vp2RenderDelegate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ 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}"

# Used in detecting whether there is support for volume light gizmos
"UFE_VOLUME_LIGHTS_SUPPORT=${UFE_VOLUME_LIGHTS_SUPPORT}"
)

# Assign 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.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ def setUpClass(cls):
'VP2RenderDelegateLightsTest', 'baseline')

cls._testDir = os.path.abspath('.')

if (os.getenv('UFE_VOLUME_LIGHTS_SUPPORT', 'FALSE') == 'FALSE'):
cls._suffix = '-legacy'
else:
cls._suffix = ''

def assertSnapshotClose(self, imageName):
baselineImage = os.path.join(self._baselineDir, imageName)
Expand All @@ -66,7 +71,7 @@ def _RunTest(self):
# unselect all and compare images
globalSelection = ufe.GlobalSelection.get()
globalSelection.clear()
self.assertSnapshotClose('%s_unselected.png' % (self._testName))
self.assertSnapshotClose('%s_unselected%s.png' % (self._testName, self._suffix))

# select all 4 lights and compare images
selection = ufe.Selection()
Expand All @@ -75,36 +80,36 @@ def _RunTest(self):
selection.append(self._GetSceneItem('|stage|stageShape', '/lights/directionalLight'))
selection.append(self._GetSceneItem('|stage|stageShape', '/lights/areaLight'))
globalSelection.replaceWith(selection)
self.assertSnapshotClose('%s_selected.png' % (self._testName))
self.assertSnapshotClose('%s_selected%s.png' % (self._testName, self._suffix))

# move all 4 lights and compare images
cmds.move(-2, -2, -2, relative=True)
self.assertSnapshotClose('%s_moved.png' % (self._testName))
self.assertSnapshotClose('%s_moved%s.png' % (self._testName, self._suffix))

# rename the stage to verify that the proxy light handles this properly
cmds.rename('|stage', 'stage2')

# select the stage and compare images
globalSelection.clear()
cmds.select('|stage2')
self.assertSnapshotClose('%s_stage_selected.png' % (self._testName))
self.assertSnapshotClose('%s_stage_selected%s.png' % (self._testName, self._suffix))

# delete one of the lights to verify that the proxy light handles this properly
cmds.delete('|stage2|stage2Shape,/lights/pointLight')

# move the stage and compare images
cmds.move(4, 4, 4, absolute=True)
self.assertSnapshotClose('%s_stage_moved.png' % (self._testName))
self.assertSnapshotClose('%s_stage_moved%s.png' % (self._testName, self._suffix))

# add a new USD light and compare images
stage = mayaUsdUfe.getStage("|stage2|stage2Shape")
stage.DefinePrim('/lights2/pointLight2', "SphereLight")
cmds.select( clear=True )
self.assertSnapshotClose('%s_with_new_light.png' % (self._testName))
self.assertSnapshotClose('%s_with_new_light%s.png' % (self._testName, self._suffix))

# set time and verify light animation
cmds.currentTime(3)
self.assertSnapshotClose('%s_animation.png' % (self._testName))
self.assertSnapshotClose('%s_animation%s.png' % (self._testName, self._suffix))

def _GetSceneItem(self, mayaPathString, usdPathString):
mayaPathSegment = mayaUtils.createUfePathSegment(mayaPathString)
Expand Down

0 comments on commit 2d5da8f

Please sign in to comment.