Skip to content

Commit

Permalink
Add a unit test to check that passing normals works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
lanierd-adsk committed Apr 10, 2024
1 parent 07efb7a commit 53fe92d
Show file tree
Hide file tree
Showing 4 changed files with 1,776 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/lib/mayaUsd/render/mayaToHydra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(INTERACTIVE_TEST_SCRIPT_FILES
testFootPrintNode.py
testBackgroundColor.py
testGrid.py
testPassingNormalsOnMayaNative.py
cpp/testColorPreferences.py
cpp/testCppFramework.py
cpp/testMayaSceneFlattening.py
Expand Down
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
@@ -0,0 +1,39 @@
#
# Copyright 2023 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.
#

from math import*
import maya.cmds as cmds
import fixturesUtils
import mtohUtils
import mayaUtils

class TestPassingNormalsOnMayaNative(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose
# MayaHydraBaseTestCase.setUpClass requirement.
_file = __file__

IMAGE_DIFF_FAIL_THRESHOLD = 0.01
IMAGE_DIFF_FAIL_PERCENT = 0.1

#Test loading a scene
def test_Load(self):
testFile = mayaUtils.openTestScene(
"testPassingNormals",
"test_ImportedAssetsNormals.ma")
cmds.refresh()
self.assertSnapshotClose("importedAssetsNormals.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT)

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

0 comments on commit 53fe92d

Please sign in to comment.