-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1944 from Autodesk/krickw/MAYA-120722/test_orient…
…ation_in_vp2RenderDelegate Add a test to verify that the orientation of point instanced objects
- Loading branch information
Showing
4 changed files
with
121 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
+100 KB
...legatePointInstanceOrientationTest/baseline/point_instanced_axis_unselected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions
77
test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegatePointInstanceOrientation.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,77 @@ | ||
#!/usr/bin/env mayapy | ||
# | ||
# Copyright 2021 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 fixturesUtils | ||
import imageUtils | ||
import mayaUtils | ||
import usdUtils | ||
import testUtils | ||
|
||
from mayaUsd import lib as mayaUsdLib | ||
from mayaUsd import ufe as mayaUsdUfe | ||
|
||
from maya import cmds | ||
|
||
import ufe | ||
|
||
import os | ||
|
||
|
||
class testVP2RenderDelegatePointInstanceOrientation(imageUtils.ImageDiffingTestCase): | ||
""" | ||
Tests imaging using the Viewport 2.0 render delegate when using per-instance | ||
inherited data on instances. | ||
""" | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
# The test USD data is authored Z-up, so make sure Maya is configured | ||
# that way too. | ||
cmds.upAxis(axis='z') | ||
|
||
inputPath = fixturesUtils.setUpClass(__file__, | ||
initializeStandalone=False, loadPlugin=False) | ||
|
||
cls._baselineDir = os.path.join(inputPath, | ||
'VP2RenderDelegatePointInstanceOrientationTest', 'baseline') | ||
|
||
cls._testDir = os.path.abspath('.') | ||
|
||
def assertSnapshotClose(self, imageName): | ||
baselineImage = os.path.join(self._baselineDir, imageName) | ||
snapshotImage = os.path.join(self._testDir, imageName) | ||
imageUtils.snapshot(snapshotImage, width=960, height=540) | ||
return self.assertImagesClose(baselineImage, snapshotImage) | ||
|
||
def _StartTest(self, testName): | ||
cmds.file(force=True, new=True) | ||
mayaUtils.loadPlugin("mayaUsdPlugin") | ||
|
||
self._testName = testName | ||
testFile = testUtils.getTestScene("pointInstances", self._testName + ".usda") | ||
mayaUtils.createProxyFromFile(testFile) | ||
globalSelection = ufe.GlobalSelection.get() | ||
globalSelection.clear() | ||
self.assertSnapshotClose('%s_unselected.png' % self._testName) | ||
|
||
def testPerInstanceInheritedData(self): | ||
self._StartTest('point_instanced_axis') | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
Oops, something went wrong.