-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix display color not matching the source Lambert materials #2049
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -373,6 +373,10 @@ void _getColorData( | |
|
||
infoMap[HdTokens->displayColor] = std::make_unique<PrimvarInfo>( | ||
PrimvarSource(VtValue(colorArray), interpolation, PrimvarSource::CPUCompute), nullptr); | ||
} else { | ||
for (size_t i = 0; i < colorArray.size(); ++i) { | ||
colorArray[i] = MayaUsd::utils::ConvertLinearToMaya(colorArray[i]); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -1933,9 +1937,12 @@ void HdVP2Mesh::_UpdateDrawItem( | |
if ((colorInterp == HdInterpolationConstant || colorInterp == HdInterpolationInstance) | ||
&& (alphaInterp == HdInterpolationConstant | ||
|| alphaInterp == HdInterpolationInstance)) { | ||
const GfVec3f& clr3f = MayaUsd::utils::ConvertLinearToMaya(colorArray[0]); | ||
const GfVec3f& clr3f = colorArray[0]; | ||
const MColor color(clr3f[0], clr3f[1], clr3f[2], alphaArray[0]); | ||
shader = _delegate->GetFallbackShader(color); | ||
if (shader) { | ||
shader->setParameter("diffuse", 1.0f); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already multiply the exported display color by the |
||
} | ||
// The color of the fallback shader is ignored when the interpolation is | ||
// instance | ||
} else { | ||
|
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
Binary file modified
BIN
+319 Bytes
(100%)
...vp2RenderDelegate/VP2RenderDelegateConsolidationTest/baseline/capsule_green.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 modified
BIN
+790 Bytes
(100%)
...nderDelegate/VP2RenderDelegateConsolidationTest/baseline/capsule_unselected.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
+3.29 KB
...erDelegate/VP2RenderDelegateDisplayColorsTest/baseline/ColorTest_unselected.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 modified
BIN
+1.21 KB
(100%)
...Delegate/VP2RenderDelegateGeomSubsetTest/baseline/perFaceShaders_unselected.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 modified
BIN
+1.46 KB
(110%)
.../VP2RenderDelegateInteractiveWorkflowsTest/baseline/capsule_redo_set_height.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 modified
BIN
+1.46 KB
(110%)
...egate/VP2RenderDelegateInteractiveWorkflowsTest/baseline/capsule_set_height.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 modified
BIN
+1.08 KB
(110%)
.../VP2RenderDelegateInteractiveWorkflowsTest/baseline/capsule_undo_set_height.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 modified
BIN
+78 Bytes
(100%)
...egate/VP2RenderDelegateInteractiveWorkflowsTest/baseline/capsule_unselected.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 modified
BIN
+473 Bytes
(100%)
...nderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/autoLoadNewObjects.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 modified
BIN
+563 Bytes
(110%)
.../VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_ball01_ball04.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 modified
BIN
+1.14 KB
(110%)
.../VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_ball04_ball05.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 modified
BIN
+260 Bytes
(100%)
...enderDelegateIsolateSelectTest/baseline/autoLoadSelected_coneCapsuleCyliner.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 modified
BIN
+73 Bytes
(100%)
...rDelegate/VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_cube.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 modified
BIN
+1.82 KB
(110%)
...VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_instance_stage.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 modified
BIN
+844 Bytes
(110%)
...Delegate/VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_stage.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 modified
BIN
+147 Bytes
(100%)
...gate/VP2RenderDelegateIsolateSelectTest/baseline/autoLoadSelected_xformCone.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 modified
BIN
+337 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/ball01.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 modified
BIN
+462 Bytes
(110%)
...erDelegate/VP2RenderDelegateIsolateSelectTest/baseline/ball01_ball02_ball03.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 modified
BIN
+511 Bytes
(110%)
...vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/ball01_ball03.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 modified
BIN
+237 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/ball03.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 modified
BIN
+285 Bytes
(100%)
...p2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/capsuleAndCube.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 modified
BIN
+352 Bytes
(100%)
...rDelegate/VP2RenderDelegateIsolateSelectTest/baseline/capsuleAndCubeAndCone.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 modified
BIN
+73 Bytes
(100%)
...d/render/vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/cube.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 modified
BIN
-4 Bytes
(100%)
...nder/vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/cylinder.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 modified
BIN
+29 Bytes
(100%)
...gate/VP2RenderDelegateIsolateSelectTest/baseline/cylinderAfterCapsuleRemove.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 modified
BIN
+182 Bytes
(100%)
...nderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/cylinderAndCapsule.png
Oops, something went wrong.
Binary file modified
BIN
+640 Bytes
(110%)
...RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/isolateSelectOff.png
Oops, something went wrong.
Binary file modified
BIN
+29 Bytes
(100%)
...enderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/redoCapsuleRemove.png
Oops, something went wrong.
Binary file modified
BIN
+308 Bytes
(100%)
...p2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/reparentedCube.png
Oops, something went wrong.
Binary file modified
BIN
+334 Bytes
(100%)
...nderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/reparentedCubeBack.png
Oops, something went wrong.
Binary file modified
BIN
+351 Bytes
(100%)
...erDelegate/VP2RenderDelegateIsolateSelectTest/baseline/reparentedProxyShape.png
Oops, something went wrong.
Binary file modified
BIN
+29 Bytes
(100%)
...p2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/undoCapsuleAdd.png
Oops, something went wrong.
Binary file modified
BIN
+182 Bytes
(100%)
...enderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/undoCapsuleRemove.png
Oops, something went wrong.
Binary file modified
BIN
+639 Bytes
(110%)
...er/vp2RenderDelegate/VP2RenderDelegateIsolateSelectTest/baseline/unselected.png
Oops, something went wrong.
Binary file modified
BIN
-1 Byte
(100%)
...ePerInstanceInheritedDataTest/baseline/defaultMaterialBillboards_notDefault.png
Oops, something went wrong.
Binary file modified
BIN
-3 Bytes
(100%)
...atePerInstanceInheritedDataTest/baseline/defaultMaterialBillboards_selected.png
Oops, something went wrong.
Binary file modified
BIN
+4 Bytes
(100%)
...ePerInstanceInheritedDataTest/baseline/defaultMaterialBillboards_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+588 Bytes
(110%)
...stanceInheritedDataTest/baseline/inheritedDisplayColor_noPxrMtls_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+266 Bytes
(100%)
...tanceInheritedDataTest/baseline/inheritedDisplayColor_pxrSurface_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+569 Bytes
(110%)
...nceInheritedDataTest/baseline/perInstanceInheritedData_ball_03_and_04_guide.png
Oops, something went wrong.
Binary file modified
BIN
+569 Bytes
(110%)
...ceInheritedDataTest/baseline/perInstanceInheritedData_ball_03_and_04_hidden.png
Oops, something went wrong.
Binary file modified
BIN
+692 Bytes
(110%)
...erInstanceInheritedDataTest/baseline/perInstanceInheritedData_ball_03_guide.png
Oops, something went wrong.
Binary file modified
BIN
+692 Bytes
(110%)
...rInstanceInheritedDataTest/baseline/perInstanceInheritedData_ball_03_hidden.png
Oops, something went wrong.
Binary file modified
BIN
+702 Bytes
(100%)
...nstanceInheritedDataTest/baseline/perInstanceInheritedData_ball_03_selected.png
Oops, something went wrong.
Binary file modified
BIN
+675 Bytes
(110%)
...erInstanceInheritedDataTest/baseline/perInstanceInheritedData_ball_04_guide.png
Oops, something went wrong.
Binary file modified
BIN
+595 Bytes
(100%)
...rInstanceInheritedDataTest/baseline/perInstanceInheritedData_ball_04_hidden.png
Oops, something went wrong.
Binary file modified
BIN
+774 Bytes
(100%)
...anceInheritedDataTest/baseline/perInstanceInheritedData_default_after_guide.png
Oops, something went wrong.
Binary file modified
BIN
+702 Bytes
(100%)
...tanceInheritedDataTest/baseline/perInstanceInheritedData_shown_after_hidden.png
Oops, something went wrong.
Binary file modified
BIN
+680 Bytes
(100%)
...tePerInstanceInheritedDataTest/baseline/perInstanceInheritedData_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+111 Bytes
(100%)
...legatePointInstanceOrientationTest/baseline/point_instanced_axis_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+356 Bytes
(100%)
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube1.png
Oops, something went wrong.
Binary file modified
BIN
+277 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube1_moved.png
Oops, something went wrong.
Binary file modified
BIN
+211 Bytes
(100%)
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube2.png
Oops, something went wrong.
Binary file modified
BIN
+212 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube2_moved.png
Oops, something went wrong.
Binary file modified
BIN
+161 Bytes
(100%)
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube3.png
Oops, something went wrong.
Binary file modified
BIN
+106 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube3_moved.png
Oops, something went wrong.
Binary file modified
BIN
+502 Bytes
(100%)
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/final.png
Oops, something went wrong.
Binary file modified
BIN
+522 Bytes
(100%)
...Usd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/initial.png
Oops, something went wrong.
Binary file modified
BIN
+639 Bytes
(110%)
...p2RenderDelegate/VP2RenderDelegateSelectionTest/baseline/clear_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+705 Bytes
(110%)
...derDelegate/VP2RenderDelegateSelectionTest/baseline/clear_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+701 Bytes
(110%)
...erDelegate/VP2RenderDelegateSelectionTest/baseline/gatewayNode_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+701 Bytes
(110%)
...egate/VP2RenderDelegateSelectionTest/baseline/gatewayNode_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.87 KB
(110%)
...elegate/VP2RenderDelegateSelectionTest/baseline/instance_clear_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...te/VP2RenderDelegateSelectionTest/baseline/instance_clear_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.82 KB
(110%)
...e/VP2RenderDelegateSelectionTest/baseline/instance_gatewayNode_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.82 KB
(110%)
...RenderDelegateSelectionTest/baseline/instance_gatewayNode_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...derDelegateSelectionTest/baseline/instance_objectA_and_objectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.82 KB
(110%)
...legateSelectionTest/baseline/instance_objectA_and_objectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...egate/VP2RenderDelegateSelectionTest/baseline/instance_objectA_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
.../VP2RenderDelegateSelectionTest/baseline/instance_objectA_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...e/VP2RenderDelegateSelectionTest/baseline/instance_redoObjectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.82 KB
(110%)
...RenderDelegateSelectionTest/baseline/instance_redoObjectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...e/VP2RenderDelegateSelectionTest/baseline/instance_undoObjectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...RenderDelegateSelectionTest/baseline/instance_undoObjectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.87 KB
(110%)
...te/VP2RenderDelegateSelectionTest/baseline/instance_unselected_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+1.83 KB
(110%)
...2RenderDelegateSelectionTest/baseline/instance_unselected_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+637 Bytes
(110%)
...te/VP2RenderDelegateSelectionTest/baseline/objectA_and_objectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+706 Bytes
(110%)
...2RenderDelegateSelectionTest/baseline/objectA_and_objectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+631 Bytes
(110%)
...RenderDelegate/VP2RenderDelegateSelectionTest/baseline/objectA_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+705 Bytes
(110%)
...rDelegate/VP2RenderDelegateSelectionTest/baseline/objectA_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+637 Bytes
(110%)
...erDelegate/VP2RenderDelegateSelectionTest/baseline/redoObjectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+709 Bytes
(110%)
...egate/VP2RenderDelegateSelectionTest/baseline/redoObjectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+631 Bytes
(110%)
...erDelegate/VP2RenderDelegateSelectionTest/baseline/undoObjectB_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+705 Bytes
(110%)
...egate/VP2RenderDelegateSelectionTest/baseline/undoObjectB_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+639 Bytes
(110%)
...derDelegate/VP2RenderDelegateSelectionTest/baseline/unselected_smoothShaded.png
Oops, something went wrong.
Binary file modified
BIN
+703 Bytes
(110%)
...legate/VP2RenderDelegateSelectionTest/baseline/unselected_wireframeOnShaded.png
Oops, something went wrong.
Binary file modified
BIN
+2.01 KB
(110%)
...nderDelegateUsdCameraTest/baseline/TranslateRotate_vs_xform_cam2_translated.png
Oops, something went wrong.
Binary file modified
BIN
+783 Bytes
(110%)
...nderDelegateUsdCameraTest/baseline/TranslateRotate_vs_xform_cam2_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+1.41 KB
(110%)
...DelegateUsdCameraTest/baseline/camera_xformOp_transform_rotateX_cameraMoved.png
Oops, something went wrong.
Binary file modified
BIN
+1.35 KB
(110%)
...rDelegateUsdCameraTest/baseline/camera_xformOp_transform_rotateX_unselected.png
Oops, something went wrong.
Binary file modified
BIN
+772 Bytes
(100%)
...render/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/HIK_Export_0.png
Oops, something went wrong.
Binary file modified
BIN
+1.34 KB
(110%)
...nder/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/HIK_Export_100.png
Oops, something went wrong.
Binary file modified
BIN
+965 Bytes
(110%)
...ender/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/HIK_Export_50.png
Oops, something went wrong.
Binary file modified
BIN
+1.86 KB
(110%)
...ender/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/skinCluster_0.png
Oops, something went wrong.
Binary file modified
BIN
+2.98 KB
(110%)
...der/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/skinCluster_100.png
Oops, something went wrong.
Binary file modified
BIN
+1.7 KB
(100%)
...nder/vp2RenderDelegate/VP2RenderDelegateUsdSkelTest/baseline/skinCluster_50.png
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegateDisplayColors.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,88 @@ | ||
#!/usr/bin/env mayapy | ||
# | ||
# Copyright 2022 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 testVP2RenderDelegateDisplayColors(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, | ||
'VP2RenderDelegateDisplayColorsTest', '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("displayColors", self._testName + ".ma") | ||
|
||
cmds.file(testFile, o=True) | ||
|
||
exportedFile = os.path.join(self._testDir, "ColorTest.usda") | ||
cmds.mayaUSDExport(mergeTransformAndShape=True, | ||
file=exportedFile, | ||
shadingMode='none', | ||
exportDisplayColor=True) | ||
|
||
shapeNode = mayaUtils.createProxyFromFile(exportedFile)[0] | ||
cmds.move(0, 0, -1, shapeNode) | ||
|
||
globalSelection = ufe.GlobalSelection.get() | ||
globalSelection.clear() | ||
self.assertSnapshotClose('%s_unselected.png' % self._testName) | ||
|
||
def testPerInstanceInheritedData(self): | ||
self._StartTest('ColorTest') | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved upstream. See line 376.