Skip to content

Commit

Permalink
HYDRA-1098 : Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
debloip-adsk committed Oct 21, 2024
1 parent bd60069 commit acbaefc
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions test/lib/mayaUsd/render/mayaToHydra/testViewportFilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,19 @@ def test_UsdPolygons(self):
UsdGeom.Sphere.Define(stage, str(sphereXform.GetPath()) + "/" + sphereName)
cmds.select(clear=True)

cmds.polyTorus()
torusName = cmds.polyTorus()
cmds.move(3, 0, 3)
mayaUsd.lib.PrimUpdaterManager.duplicate(cmds.ls(torusName[0], long=True)[0], stagePath)
cmds.delete(torusName)
cmds.select(clear=True)

cmds.refresh()
self.checkFilter("polygons_USD", kExcludeMeshes, 10)

def test_UsdNurbsCurves(self):
def createUsdCurve(stagePath):
circleName = cmds.circle()
usdCircleName = mayaUsd.lib.PrimUpdaterManager.duplicate(cmds.ls(circleName[0], long=True)[0], stagePath)
cmds.select(circleName)
cmds.delete()
cmds.delete(circleName)
cmds.select(usdCircleName)
stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
self.stackInstances(functools.partial(createUsdCurve, stagePath), 50, [0, 0, 0.005])
Expand All @@ -291,17 +291,15 @@ def test_UsdNurbsPatches(self):
stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
torusName = cmds.torus(sections=20, spans=10, heightRatio=0.5)
mayaUsd.lib.PrimUpdaterManager.duplicate(cmds.ls(torusName[0], long=True)[0], stagePath)
cmds.select(torusName)
cmds.delete()
cmds.delete(torusName)
cmds.select(clear=True)
self.checkFilter("nurbsPatches_USD", kExcludeNurbsSurfaces, 3)

def test_UsdLights(self):
def createUsdLight(stagePath):
lightName = cmds.directionalLight()
usdLightName = mayaUsd.lib.PrimUpdaterManager.duplicate(cmds.ls(lightName, long=True)[0], stagePath)
cmds.select(lightName)
cmds.delete()
cmds.delete(lightName)
cmds.select(usdLightName)
stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
self.stackInstances(functools.partial(createUsdLight, stagePath), 50, [0.005, 0, 0])
Expand All @@ -311,8 +309,7 @@ def test_UsdCameras(self):
def createUsdCamera(stagePath):
cameraName = cmds.camera()
usdCameraName = mayaUsd.lib.PrimUpdaterManager.duplicate(cmds.ls(cameraName[0], long=True)[0], stagePath)
cmds.select(cameraName)
cmds.delete()
cmds.delete(cameraName)
cmds.select(usdCameraName)
stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
self.stackInstances(functools.partial(createUsdCamera, stagePath), 50, [0.005, 0, 0])
Expand Down

0 comments on commit acbaefc

Please sign in to comment.