-
Notifications
You must be signed in to change notification settings - Fork 4
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
Re-instated BasicRender and DagChanges unit tests. #203
Conversation
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.
The core change in this pull request :)
self.assertSnapshotEqual("flat_orange.png") | ||
self.assertRaises(AssertionError, | ||
self.assertSnapshotEqual, "flat_orange_bad.png") | ||
self.assertSnapshotClose( |
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.
Changed from assertSnapshotEqual to assertSnapshotClose everywhere.
imageVersion = None | ||
if maya.mel.eval("defaultShaderName") != "standardSurface1": | ||
imageVersion = 'lambertDefaultMaterial' | ||
imageVersion = maya.mel.eval("defaultShaderName").rstrip(digits) |
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.
Expected image files are now in a subdirectory based on the default shader name stripped of its numerical suffix, e.g. lambert, standardSurface, openPBRSurface.
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.
Couldn't reinstate this test, because we still have native instancing selection highlighting to fix, but updated the comment.
@@ -165,8 +165,14 @@ def assertInIndex(self, rprim): | |||
def assertNodeNameInIndex(self, nodeName): | |||
for rprim in self.getIndex(): | |||
if nodeName in rprim: | |||
return True |
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.
assertNodeNameInIndex was not asserting anything at all... Now it does.
self.grp2 = cmds.createNode('transform', name='group2') | ||
self.grp2Rprim = self.rprimPath(self.grp2) |
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.
Unused.
self.imageVersion = None | ||
if maya.mel.eval("defaultShaderName") != "standardSurface1": | ||
self.imageVersion = 'lambertDefaultMaterial' | ||
self.imageVersion = maya.mel.eval("defaultShaderName").rstrip(digits) |
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.
Now using the same directory structure as the BasicRenderTest, with a subdirectory per default material.
index = self.getIndex() | ||
self.assertIn(grp1ShapeRprim, index) | ||
self.assertNotIn(self.cubeRprim, index) | ||
self.assertNodeNameInIndex(grp1ShapeRprim) |
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.
Hydra prims created from MRenderItem's won't match exactly what's in a previously-computed render index, because the numerical suffix to e.g. StandardShadedItem will change. The important thing to assert is that the path does not change.
@@ -111,22 +117,28 @@ def test_instances(self): | |||
|
|||
# No instances to start | |||
# (1) |pCube1|pCubeShape1 | |||
self.assertSnapshotEqual("instances_1.png", self.imageVersion) | |||
self.assertSnapshotClose( |
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.
Now using assertSnapshotClose rather than assertSnapshotEqual everywhere.
|
||
self.setHdStormRenderer() | ||
|
||
if maya.mel.eval("defaultShaderName") == "standardSurface1": |
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.
Copy-pasted from makeCubeScene().
Eyeballed the expected image comparison files, which were expected to be different because of default material and other rendering changes.