-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HYDRA-536 & HYDRA-537 : Background color and grid tests (#112)
* HYDRA-536 & HYDRA-537 : Add background color and grid tests * HYDRA-536 & HYDRA-537 : Refactor to apply test settings on scene open * HYDRA-536 & HYDRA-537 : Update test README * HYDRA-536 & HYDRA-537 : Remove background color change in applyTestSettings * HYDRA-536 & HYDRA-537 : Update README * HYDRA-537 : Adjust testGrid thresholds for OSX
- Loading branch information
1 parent
ef17d50
commit b412648
Showing
26 changed files
with
119 additions
and
143 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_black.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_blue.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_gray.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_green.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_red.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.08 KB
test/lib/mayaUsd/render/mayaToHydra/BackgroundColorTest/background_white.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
test/lib/mayaUsd/render/mayaToHydra/testBackgroundColor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2024 Autodesk | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
import maya.cmds as cmds | ||
|
||
import fixturesUtils | ||
import mtohUtils | ||
|
||
class TestBackgroundColor(mtohUtils.MayaHydraBaseTestCase): | ||
# MayaHydraBaseTestCase.setUpClass requirement. | ||
_file = __file__ | ||
|
||
IMAGE_DIFF_FAIL_THRESHOLD = 0.05 | ||
IMAGE_DIFF_FAIL_PERCENT = 1 | ||
|
||
def compareBackgroundColor(self, imageName): | ||
self.setViewport2Renderer() | ||
self.assertSnapshotClose(imageName, self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
self.setHdStormRenderer() | ||
self.assertSnapshotClose(imageName, self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
|
||
def test_BackgroundColor(self): | ||
cmds.displayRGBColor('background', 0.5, 0, 0) | ||
self.compareBackgroundColor("background_red.jpg") | ||
cmds.displayRGBColor('background', 0, 0.5, 0) | ||
self.compareBackgroundColor("background_green.jpg") | ||
cmds.displayRGBColor('background', 0, 0, 0.5) | ||
self.compareBackgroundColor("background_blue.jpg") | ||
|
||
cmds.displayRGBColor('background', 0, 0, 0) | ||
self.compareBackgroundColor("background_black.jpg") | ||
cmds.displayRGBColor('background', 0.5, 0.5, 0.5) | ||
self.compareBackgroundColor("background_gray.jpg") | ||
cmds.displayRGBColor('background', 1, 1, 1) | ||
self.compareBackgroundColor("background_white.jpg") | ||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2024 Autodesk | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
import maya.cmds as cmds | ||
|
||
import fixturesUtils | ||
import mtohUtils | ||
|
||
class TestGrid(mtohUtils.MayaHydraBaseTestCase): | ||
# MayaHydraBaseTestCase.setUpClass requirement. | ||
_file = __file__ | ||
|
||
IMAGE_DIFF_FAIL_THRESHOLD = 0.15 | ||
IMAGE_DIFF_FAIL_PERCENT = 2 | ||
|
||
def test_Grid(self): | ||
cmds.grid(toggle=True) | ||
self.assertSnapshotClose("grid_enabled.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
cmds.grid(toggle=False) | ||
self.assertSnapshotClose("grid_disabled.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.