Skip to content

Commit

Permalink
HYDRA-781 : Return polyCreatorNodeName directly in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Feb 5, 2024
1 parent f14a777 commit 15dc150
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def compareSnapshot(self, referenceFilename, cameraDistance=15):
def setupScene(self, polygonCreationCallable):
cmds.loadPlugin('modelingToolkit') # Provides polyDisc, polyPlatonic, polyGear and polySuperShape
self.setHdStormRenderer()
polygonResult = polygonCreationCallable()
polyCreatorNodeName = polygonCreationCallable()[1]
cmds.refresh()
return polygonResult
return polyCreatorNodeName

def getSuperShapeCreationCallable(self, shapeType):
# Base parameters to have an actually visible mesh
Expand All @@ -66,7 +66,7 @@ def setupSuperShapeHelix(self, polyCreatorNodeName):

# Cube attributes is a superset of plane attributes
def test_PolygonCube(self):
polyCreatorNodeName = self.setupScene(cmds.polyCube)[1]
polyCreatorNodeName = self.setupScene(cmds.polyCube)
self.compareSnapshot("cube_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".width", 6)
Expand All @@ -83,7 +83,7 @@ def test_PolygonCube(self):

# Cylinder attributes is a superset of sphere and cone
def test_PolygonCylinder(self):
polyCreatorNodeName = self.setupScene(cmds.polyCylinder)[1]
polyCreatorNodeName = self.setupScene(cmds.polyCylinder)
self.compareSnapshot("cylinder_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 3)
Expand All @@ -104,7 +104,7 @@ def test_PolygonCylinder(self):
self.compareSnapshot("cylinder_roundCapHeightCompensation.png")

def test_PolygonTorus(self):
polyCreatorNodeName = self.setupScene(cmds.polyTorus)[1]
polyCreatorNodeName = self.setupScene(cmds.polyTorus)
self.compareSnapshot("torus_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 4)
Expand All @@ -119,7 +119,7 @@ def test_PolygonTorus(self):
self.compareSnapshot("torus_modified.png")

def test_PolygonDisc(self):
polyCreatorNodeName = self.setupScene(cmds.polyDisc)[1]
polyCreatorNodeName = self.setupScene(cmds.polyDisc)
self.compareSnapshot("disc_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".sides", 10)
Expand All @@ -143,7 +143,7 @@ def test_PolygonDisc(self):
self.compareSnapshot("disc_subdivision_circle.png")

def test_PolygonPlatonicSolid(self):
polyCreatorNodeName = self.setupScene(cmds.polyPlatonic)[1]
polyCreatorNodeName = self.setupScene(cmds.polyPlatonic)
self.compareSnapshot("platonic_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".subdivisions", 2)
Expand Down Expand Up @@ -172,7 +172,7 @@ def test_PolygonPlatonicSolid(self):
self.compareSnapshot("platonic_icosahedron_triangles.png")

def test_PolygonPyramid(self):
polyCreatorNodeName = self.setupScene(cmds.polyPyramid)[1]
polyCreatorNodeName = self.setupScene(cmds.polyPyramid)
self.compareSnapshot("pyramid_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".sideLength", 5)
Expand All @@ -193,7 +193,7 @@ def test_PolygonPyramid(self):
self.compareSnapshot("pyramid_5sides.png")

def test_PolygonPrism(self):
polyCreatorNodeName = self.setupScene(cmds.polyPrism)[1]
polyCreatorNodeName = self.setupScene(cmds.polyPrism)
self.compareSnapshot("prism_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".length", 4)
Expand All @@ -212,7 +212,7 @@ def test_PolygonPrism(self):
self.compareSnapshot("prism_8sides.png")

def test_PolygonPipe(self):
polyCreatorNodeName = self.setupScene(cmds.polyPipe)[1]
polyCreatorNodeName = self.setupScene(cmds.polyPipe)
self.compareSnapshot("pipe_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 3)
Expand All @@ -234,7 +234,7 @@ def test_PolygonPipe(self):
self.compareSnapshot("pipe_roundCapHeightCompensation.png")

def test_PolygonHelix(self):
polyCreatorNodeName = self.setupScene(cmds.polyHelix)[1]
polyCreatorNodeName = self.setupScene(cmds.polyHelix)
self.compareSnapshot("helix_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".coils", 2)
Expand All @@ -257,7 +257,7 @@ def test_PolygonHelix(self):
self.compareSnapshot("helix_clockwise.png")

def test_PolygonGear(self):
polyCreatorNodeName = self.setupScene(cmds.polyGear)[1]
polyCreatorNodeName = self.setupScene(cmds.polyGear)
self.compareSnapshot("gear_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".sides", 10)
Expand All @@ -275,7 +275,7 @@ def test_PolygonGear(self):
self.compareSnapshot("gear_modified.png")

def test_PolygonSoccerBall(self):
polyCreatorNodeName = self.setupScene(cmds.polyPrimitive)[1]
polyCreatorNodeName = self.setupScene(cmds.polyPrimitive)
self.compareSnapshot("soccerball_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 4)
Expand All @@ -289,7 +289,7 @@ def test_PolygonSoccerBall(self):
self.compareSnapshot("soccerball_modified.png")

def test_PolygonSuperEllipse(self):
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SuperEllipse"))[1]
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SuperEllipse"))
self.compareSnapshot("superEllipse_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 5)
Expand All @@ -307,7 +307,7 @@ def test_PolygonSuperEllipse(self):
self.compareSnapshot("superEllipse_helix.png")

def test_PolygonSphericalHarmonics(self):
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SphericalHarmonics"))[1]
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("SphericalHarmonics"))
self.compareSnapshot("sphericalHarmonics_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 5)
Expand All @@ -328,7 +328,7 @@ def test_PolygonSphericalHarmonics(self):
self.compareSnapshot("sphericalHarmonics_helix.png")

def test_PolygonUltra(self):
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("UltraShape"))[1]
polyCreatorNodeName = self.setupScene(self.getSuperShapeCreationCallable("UltraShape"))
self.compareSnapshot("ultra_fresh.png", 5)

cmds.setAttr(polyCreatorNodeName + ".radius", 5)
Expand Down

0 comments on commit 15dc150

Please sign in to comment.