Skip to content

Commit

Permalink
HYDRA-781 : Add helix test for super shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Feb 2, 2024
1 parent f58e583 commit b06cdd7
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def getSuperShapeCreationCallable(self, shapeType):
horizontalDivisions=1,
verticalDivisions=1,
mergeVertices=True)

def setupSuperShapeHelix(self, polyCreatorNodeName):
cmds.setAttr(polyCreatorNodeName + ".mergeVertices", False)
cmds.setAttr(polyCreatorNodeName + ".horizontalRevolutions", 1)
cmds.setAttr(polyCreatorNodeName + ".verticalRevolutions", 1)
cmds.setAttr(polyCreatorNodeName + ".verticalOffset", 2)
cmds.setAttr(polyCreatorNodeName + ".internalRadius", 2)
cmds.setAttr(polyCreatorNodeName + ".xOffset", 0.25)
cmds.setAttr(polyCreatorNodeName + ".zOffset", 0.75)

# Cube attributes is a superset of plane attributes
def test_PolygonCube(self):
Expand Down Expand Up @@ -276,10 +285,16 @@ def test_PolygonSuperEllipse(self):
cmds.setAttr(polyCreatorNodeName + ".heightBaseline", 0.5)
cmds.setAttr(polyCreatorNodeName + ".horizontalDivisions", 4)
cmds.setAttr(polyCreatorNodeName + ".verticalDivisions", 4)
cmds.setAttr(polyCreatorNodeName + ".ellipse0", 1.25)
cmds.setAttr(polyCreatorNodeName + ".ellipse0", 0.75)
cmds.setAttr(polyCreatorNodeName + ".ellipse1", 1.25)
self.compareSnapshot("superEllipse_modified.png")

cmds.setAttr(polyCreatorNodeName + ".ellipseMirror", True)
self.compareSnapshot("superEllipse_mirror.png")

self.setupSuperShapeHelix(polyCreatorNodeName)
self.compareSnapshot("superEllipse_helix.png")

def test_PolygonSphericalHarmonics(self):
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SphericalHarmonics"))[1]
self.compareSnapshot("sphericalHarmonics_fresh.png", 5)
Expand All @@ -298,6 +313,9 @@ def test_PolygonSphericalHarmonics(self):
cmds.setAttr(polyCreatorNodeName + ".harmonics7", 2)
self.compareSnapshot("sphericalHarmonics_modified.png")

self.setupSuperShapeHelix(polyCreatorNodeName)
self.compareSnapshot("sphericalHarmonics_helix.png")

def test_PolygonUltra(self):
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("UltraShape"))[1]
self.compareSnapshot("ultra_fresh.png", 5)
Expand Down Expand Up @@ -326,5 +344,8 @@ def test_PolygonUltra(self):
cmds.setAttr(polyCreatorNodeName + ".ultra15", 1.5) # Vertical Exponent 5
self.compareSnapshot("ultra_modified.png")

self.setupSuperShapeHelix(polyCreatorNodeName)
self.compareSnapshot("ultra_helix.png")

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

0 comments on commit b06cdd7

Please sign in to comment.