Skip to content
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

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Nov 15, 2024

Eyeballed the expected image comparison files, which were expected to be different because of default material and other rendering changes.

@ppt-adsk ppt-adsk self-assigned this Nov 15, 2024
@ppt-adsk ppt-adsk assigned ppt-adsk and unassigned ppt-adsk Nov 15, 2024
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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":
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy-pasted from makeCubeScene().

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 18, 2024
@lilike-adsk lilike-adsk merged commit 8db08d7 into dev Nov 18, 2024
10 checks passed
@lilike-adsk lilike-adsk deleted the tremblp/HYDRA-1124/reenable_unit_tests branch November 18, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants