-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for Default Lighting with UsdStage
- Loading branch information
1 parent
99d1acd
commit 919242f
Showing
7 changed files
with
489 additions
and
0 deletions.
There are no files selected for viewing
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
Binary file added
BIN
+34.1 KB
...sd/render/mayaToHydra/UsdStageDefaultLightingTest/usdStageDefaultLighting_1.png
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
+52.3 KB
...sd/render/mayaToHydra/UsdStageDefaultLightingTest/usdStageDefaultLighting_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions
58
test/lib/mayaUsd/render/mayaToHydra/testUsdStageDefaultLighting.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,58 @@ | ||
# | ||
# Copyright 2024 Autodesk, Inc. All rights reserved. | ||
# | ||
# 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 | ||
import mayaUtils | ||
|
||
import platform | ||
|
||
class TestUsdTextureToggle(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose | ||
# MayaHydraBaseTestCase.setUpClass requirement. | ||
_file = __file__ | ||
|
||
IMAGE_DIFF_FAIL_THRESHOLD = 0.1 | ||
IMAGE_DIFF_FAIL_PERCENT = 1.5 | ||
|
||
def setUp(self): | ||
# Open simple Maya scene | ||
testFile = mayaUtils.openTestScene( | ||
"testUsdStageDefaultLighting", | ||
"testUsdStageDefaultLighting.ma") | ||
cmds.refresh() | ||
|
||
def setTextureMode(self, enabled): | ||
cmds.modelEditor(mayaUtils.activeModelPanel(), edit=True, displayTextures=enabled) | ||
cmds.refresh() | ||
|
||
def setCameraTransform(self, xtrans, ytrans, ztrans, xrot, yrot, zrot ): | ||
#Move camera | ||
cmds.setAttr('persp.translate', xtrans, ytrans, ztrans, type='float3') | ||
cmds.setAttr('persp.rotate', xrot, yrot, zrot, type='float3') | ||
|
||
def test_UsdStageDefaultLighting(self): | ||
self.setHdStormRenderer() | ||
self.setTextureMode(True) | ||
|
||
self.setCameraTransform(-21, 7, 18, -20, -50, 0) | ||
self.assertSnapshotClose("usdStageDefaultLighting_1" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
|
||
self.setCameraTransform(20, 12, 16, -30, 50, 0) | ||
self.assertSnapshotClose("usdStageDefaultLighting_2" + ".png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) | ||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
235 changes: 235 additions & 0 deletions
235
test/testSamples/testUsdStageDefaultLighting/testUsdStageDefaultLighting.ma
Large diffs are not rendered by default.
Oops, something went wrong.
195 changes: 195 additions & 0 deletions
195
test/testSamples/testUsdStageDefaultLighting/usdStageDefaultLighting.usd
Large diffs are not rendered by default.
Oops, something went wrong.