From 108205e6d1db7b26e041c08a8bc7fc07c78e5db0 Mon Sep 17 00:00:00 2001 From: debloip Date: Wed, 20 Mar 2024 17:02:05 -0400 Subject: [PATCH 01/18] HYDRA-861 : Fix mtoa loading --- cmake/test.cmake | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/cmake/test.cmake b/cmake/test.cmake index 0e6521660d..f800b6a06b 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -224,6 +224,7 @@ finally: set(ALL_PATH_VARS PYTHONPATH + MAYA_MODULE_PATH MAYA_PLUG_IN_PATH MAYA_SCRIPT_PATH XBMLANGPATH @@ -299,18 +300,8 @@ finally: # mtoa if(DEFINED MTOA_LOCATION) - list(APPEND MAYAUSD_VARNAME_PATH - "${MTOA_LOCATION}/bin") - list(APPEND MAYAUSD_VARNAME_MAYA_SCRIPT_PATH - "${MTOA_LOCATION}/scripts/mtoa/mel") - list(APPEND MAYAUSD_VARNAME_MAYA_PXR_PLUGINPATH_NAME - "${MTOA_LOCATION}/usd") - list(APPEND MAYAUSD_VARNAME_MAYA_RENDER_DESC_PATH - "${MTOA_LOCATION}/") - list(APPEND MAYAUSD_MATERIALX_SEARCH_PATH - "${MTOA_LOCATION}/materialx/arnold") - list(APPEND MAYAUSD_MATERIALX_SEARCH_PATH - "${MTOA_LOCATION}/materialx/targets") + list(APPEND MAYAUSD_VARNAME_MAYA_MODULE_PATH + "${MTOA_LOCATION}") endif() # lookdevx @@ -395,10 +386,6 @@ finally: endif() endforeach() - # Unset any MAYA_MODULE_PATH as we set all the individual variables - # so we don't want to conflict with a MayaUsd module. - set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "MAYA_MODULE_PATH=") - # set all env vars foreach(pathvar ${ALL_PATH_VARS}) set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT From 071ba0787afe8b959241ec28b7cfcff2c525c40f Mon Sep 17 00:00:00 2001 From: debloip Date: Fri, 22 Mar 2024 14:43:52 -0400 Subject: [PATCH 02/18] HYDRA-861 : Make USD stage path relative in testArnoldLights scene --- .../UsdStageWithSphereMatXStdSurf.usd | Bin 1230 -> 0 bytes .../UsdStageWithSphereMatXStdSurf.usda | 25 ++++++++++++++++++ .../testArnoldLights/testArnoldLights.ma | 4 +-- 3 files changed, 27 insertions(+), 2 deletions(-) delete mode 100644 test/testSamples/testArnoldLights/UsdStageWithSphereMatXStdSurf.usd create mode 100644 test/testSamples/testArnoldLights/UsdStageWithSphereMatXStdSurf.usda diff --git a/test/testSamples/testArnoldLights/UsdStageWithSphereMatXStdSurf.usd b/test/testSamples/testArnoldLights/UsdStageWithSphereMatXStdSurf.usd deleted file mode 100644 index dca2aed50c76b8282d1f125c5543d34e136f6ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1230 zcmbtUPfrs;6o0$jZ7VIb1sW9)8$zNrl1S>QURr4tR7%Ts6B9MKbf8n`^|g5_j}WwnU?P_&!|da4#Ge! zDE0jR&LR^KuqQZ005Q^sSOX&gg}g_pT}bi4_^GQ zE|~h4RkzC@%opO8%>{_y1xC5Ug5x~7ckaea8Wg*M95f3puL-tewB{N{Q+JRF;M%BW z)D7fJ!`>Kp8#XFwEd-02ha5v|-ZV_zFxT?s1<-6msWnhbbD=c}Q`yyva4?G1EE_qV zfm~2(7=r6*rmi{qiraSTS`E!E!)LJCp56A`EbhOa#dQEmL(`E1hFQ0=hCU750n7o< zdV)9gRKu-Tji%vkK&i0u7^DUayYsLc(@|Y(H!)9h){s}$yoL)k%QR8VGb}R>`{H`t za#~Av)^jw|ZQ@@s45=mOIdlZwYOgj?rq|=aqd(ttl%a7R>6{@4EmYNt8t8Tt*aC-#g}Qt$Bb#nUoqIC3Qy48v?B*T8cM-s3q9Q5yL|@esv(6vrv{DITF%!1L8y zlH!+P$V|bTFeJw5I+ljaS(u2!=4E=Gk + double3 xformOp:translate = (0, 0, -2.3244301402269603) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +def Scope "mtl" +{ + def Material "standard_surface1" + { + token outputs:mtlx:surface.connect = + + def Shader "standard_surface1" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + token outputs:out + } + } +} + diff --git a/test/testSamples/testArnoldLights/testArnoldLights.ma b/test/testSamples/testArnoldLights/testArnoldLights.ma index 13318f7f5c..b2b00a310b 100644 --- a/test/testSamples/testArnoldLights/testArnoldLights.ma +++ b/test/testSamples/testArnoldLights/testArnoldLights.ma @@ -89,11 +89,11 @@ createNode mayaUsdProxyShape -n "stageShape1" -p "stage1"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; - setAttr ".fp" -type "string" "E:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".fp" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".pp" -type "string" ""; setAttr ".epp" -type "string" ""; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".usdStageTargetLayer" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; createNode transform -n "pSphere1"; rename -uid "8341F116-479B-C1D9-6F2C-62A9A75EE673"; setAttr ".t" -type "double3" 0 0 2.324 ; From 7ab3980b990216f450017e200852530df498d762 Mon Sep 17 00:00:00 2001 From: debloip Date: Fri, 22 Mar 2024 14:47:45 -0400 Subject: [PATCH 03/18] HYDRA-932 : Remove Arnold/mtoa/ai references in testMayaDisplayModes scene --- .../testMayaDisplayModes.ma | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma b/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma index ce9bde55ef..6bdbb3b22e 100644 --- a/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma +++ b/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma @@ -7,8 +7,6 @@ requires -nodeType "polyPlatonic" "modelingToolkit" "0.0.0.0"; requires "stereoCamera" "10.0"; requires -nodeType "mayaUsdLayerManager" -nodeType "mayaUsdProxyShape" -dataType "pxrUsdStageData" "mayaUsdPlugin" "0.27.0"; -requires -nodeType "aiOptions" -nodeType "aiAOVDriver" -nodeType "aiAOVFilter" -nodeType "aiSkyDomeLight" - "mtoa" "5.4.0"; currentUnit -l centimeter -a degree -t film; fileInfo "application" "maya"; fileInfo "product" "Maya 2025"; @@ -111,11 +109,6 @@ createNode mesh -n "pPlaneShape1" -p "pPlane1"; setAttr ".dcc" -type "string" "Ambient+Diffuse"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; -createNode transform -n "aiSkyDomeLight1"; - rename -uid "F445CCFF-4A13-14B5-6DC2-43B49F52EC3C"; -createNode aiSkyDomeLight -n "aiSkyDomeLightShape1" -p "aiSkyDomeLight1"; - rename -uid "8912373B-468E-50CE-3251-F8BC54576336"; - setAttr -k off ".v"; createNode transform -n "pTorus1"; rename -uid "B951C7A3-4CC5-49AD-7F5D-B99000A6D913"; setAttr ".t" -type "double3" 0 1.3200451985855537 0 ; @@ -240,21 +233,6 @@ createNode script -n "sceneConfigurationScriptNode"; createNode polyPlane -n "polyPlane1"; rename -uid "CD3BB296-4188-C6F4-E747-E59F1B806502"; setAttr ".cuv" 2; -createNode aiOptions -s -n "defaultArnoldRenderOptions"; - rename -uid "5C8CAC3A-4022-1801-F232-F29A9F4F3DD6"; - setAttr ".version" -type "string" "5.4.0"; -createNode aiAOVFilter -s -n "defaultArnoldFilter"; - rename -uid "02F19E5B-4678-C78F-5BC9-CD89DA6B39FC"; -createNode aiAOVDriver -s -n "defaultArnoldDriver"; - rename -uid "1AFC3678-4ACB-5752-ED36-8AABA1A04BE1"; -createNode aiAOVDriver -s -n "defaultArnoldDisplayDriver"; - rename -uid "98BF77D4-4638-5934-44B7-189F61D8051C"; - setAttr ".ai_translator" -type "string" "maya"; - setAttr ".output_mode" 0; -createNode file -n "file1"; - rename -uid "A5B2E234-4145-AD8E-DC06-C39AE469E979"; - setAttr ".ftn" -type "string" "D:/repos/mayaHydra/ecg-maya-hydra/ecg-maya-hydra/maya-hydra/test/testSamples/testArnoldLights/sky.hdr"; - setAttr ".cs" -type "string" "Raw"; createNode place2dTexture -n "place2dTexture1"; rename -uid "C4487DF0-4526-18EC-36CE-D0BA7685024A"; createNode mayaUsdLayerManager -n "mayaUsdLayerManager1"; @@ -357,7 +335,6 @@ select -ne :hardwareRenderGlobals; setAttr ".btrs" 512; connectAttr ":time1.o" "stageShape1.tm"; connectAttr "polyPlane1.out" "pPlaneShape1.i"; -connectAttr "file1.oc" "aiSkyDomeLightShape1.sc"; connectAttr "polyTorus1.out" "pTorusShape1.i"; connectAttr "polyPlatonic1.output" "pPlatonicShape1.i"; connectAttr "polyTorus2.out" "pTorusShape2.i"; @@ -369,32 +346,6 @@ relationship "shadowLink" ":lightLinker1" ":initialParticleSE.message" ":default relationship "shadowLink" ":lightLinker1" "standardSurface2SG.message" ":defaultLightSet.message"; connectAttr "layerManager.dli[0]" "defaultLayer.id"; connectAttr "renderLayerManager.rlmi[0]" "defaultRenderLayer.rlid"; -connectAttr ":defaultArnoldDisplayDriver.msg" ":defaultArnoldRenderOptions.drivers" - -na; -connectAttr ":defaultArnoldFilter.msg" ":defaultArnoldRenderOptions.filt"; -connectAttr ":defaultArnoldDriver.msg" ":defaultArnoldRenderOptions.drvr"; -connectAttr ":defaultColorMgtGlobals.cme" "file1.cme"; -connectAttr ":defaultColorMgtGlobals.cfe" "file1.cmcf"; -connectAttr ":defaultColorMgtGlobals.cfp" "file1.cmcp"; -connectAttr ":defaultColorMgtGlobals.wsn" "file1.ws"; -connectAttr "place2dTexture1.c" "file1.c"; -connectAttr "place2dTexture1.tf" "file1.tf"; -connectAttr "place2dTexture1.rf" "file1.rf"; -connectAttr "place2dTexture1.mu" "file1.mu"; -connectAttr "place2dTexture1.mv" "file1.mv"; -connectAttr "place2dTexture1.s" "file1.s"; -connectAttr "place2dTexture1.wu" "file1.wu"; -connectAttr "place2dTexture1.wv" "file1.wv"; -connectAttr "place2dTexture1.re" "file1.re"; -connectAttr "place2dTexture1.of" "file1.of"; -connectAttr "place2dTexture1.r" "file1.ro"; -connectAttr "place2dTexture1.n" "file1.n"; -connectAttr "place2dTexture1.vt1" "file1.vt1"; -connectAttr "place2dTexture1.vt2" "file1.vt2"; -connectAttr "place2dTexture1.vt3" "file1.vt3"; -connectAttr "place2dTexture1.vc1" "file1.vc1"; -connectAttr "place2dTexture1.o" "file1.uv"; -connectAttr "place2dTexture1.ofs" "file1.fs"; connectAttr "file2.oc" "standardSurface2.bc"; connectAttr "standardSurface2.oc" "standardSurface2SG.ss"; connectAttr "pPlaneShape1.iog" "standardSurface2SG.dsm" -na; @@ -428,15 +379,12 @@ connectAttr "standardSurface2.msg" ":defaultShaderList1.s" -na; connectAttr "place2dTexture1.msg" ":defaultRenderUtilityList1.u" -na; connectAttr "place2dTexture2.msg" ":defaultRenderUtilityList1.u" -na; connectAttr "defaultRenderLayer.msg" ":defaultRenderingList1.r" -na; -connectAttr "aiSkyDomeLightShape1.ltd" ":lightList1.l" -na; connectAttr "directionalLightShape1.ltd" ":lightList1.l" -na; connectAttr "pointLightShape1.ltd" ":lightList1.l" -na; -connectAttr "file1.msg" ":defaultTextureList1.tx" -na; connectAttr "file2.msg" ":defaultTextureList1.tx" -na; connectAttr "pTorusShape1.iog" ":initialShadingGroup.dsm" -na; connectAttr "pPlatonicShape1.iog" ":initialShadingGroup.dsm" -na; connectAttr "pTorusShape2.iog" ":initialShadingGroup.dsm" -na; -connectAttr "aiSkyDomeLight1.iog" ":defaultLightSet.dsm" -na; connectAttr "directionalLight1.iog" ":defaultLightSet.dsm" -na; connectAttr "pointLight1.iog" ":defaultLightSet.dsm" -na; // End of testMayaDisplayModes.ma From 76d1aeebfac0501f97c9da1cdbbd562f50b0878a Mon Sep 17 00:00:00 2001 From: debloip Date: Fri, 22 Mar 2024 15:15:01 -0400 Subject: [PATCH 04/18] HYDRA-861 : Fix LookdevX loading --- cmake/test.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/test.cmake b/cmake/test.cmake index f800b6a06b..363ba85b62 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -316,6 +316,8 @@ finally: "${LOOKDEVX_LOCATION}/scripts") list(APPEND MAYAUSD_VARNAME_PYTHONPATH "${LOOKDEVX_LOCATION}/python") + list(APPEND MAYAUSD_VARNAME_MAYA_PLUG_IN_PATH + "${LOOKDEVX_LOCATION}/plug-ins") endif() if(IS_WINDOWS AND DEFINED ENV{PYTHONHOME}) From 1f19933f0a555160d8052c124055c5e3e98e83a2 Mon Sep 17 00:00:00 2001 From: debloip Date: Fri, 22 Mar 2024 15:16:57 -0400 Subject: [PATCH 05/18] HYDRA-861 : Rework plugin loading test infrastructure and fail if plugin can't load --- test/lib/mayaUsd/render/mayaToHydra/README.md | 33 +++------ .../mayaToHydra/cpp/testMayaUsdUfeItems.py | 1 - .../mayaToHydra/cpp/testPathInterface.py | 1 - .../render/mayaToHydra/cpp/testPicking.py | 6 +- .../mayaToHydra/cpp/testPrimInstancing.py | 1 - .../mayaToHydra/cpp/testSceneCorrectness.py | 1 - .../cpp/testUsdStageLayerMuting.py | 1 - ...stWireframeSelectionHighlightSceneIndex.py | 1 - .../render/mayaToHydra/testArnoldLights.py | 4 +- .../render/mayaToHydra/testCurveTools.py | 2 +- .../render/mayaToHydra/testFlowViewportAPI.py | 2 +- .../render/mayaToHydra/testFootPrintNode.py | 2 +- .../render/mayaToHydra/testImageDiffing.py | 2 +- .../render/mayaToHydra/testLookThrough.py | 2 +- .../mayaToHydra/testMaterialXOnNative.py | 4 +- .../mayaToHydra/testMayaDisplayLayers.py | 2 +- .../mayaToHydra/testMayaDisplayModes.py | 2 +- .../mayaToHydra/testMayaIsolateSelect.py | 2 +- .../render/mayaToHydra/testMayaLights.py | 3 +- .../mayaToHydra/testMayaShadingModes.py | 2 +- .../render/mayaToHydra/testMayaUsdAPIUsage.py | 3 +- .../render/mayaToHydra/testMtohBasicRender.py | 4 +- .../render/mayaToHydra/testMtohDagChanges.py | 4 +- .../mayaToHydra/testNewSceneWithStage.py | 1 - .../render/mayaToHydra/testNurbsPrimitives.py | 2 +- .../render/mayaToHydra/testObjectTemplate.py | 2 +- .../mayaToHydra/testPolygonPrimitives.py | 2 +- .../render/mayaToHydra/testSceneBrowser.py | 11 +-- .../render/mayaToHydra/testStageAddPrim.py | 1 - .../testStagePayloadsReferences.py | 5 +- .../render/mayaToHydra/testStageVariants.py | 3 +- .../render/mayaToHydra/testStandardSurface.py | 2 +- .../render/mayaToHydra/testTransforms.py | 3 +- .../render/mayaToHydra/testUSDLights.py | 3 +- .../render/mayaToHydra/testVisibility.py | 2 +- test/testUtils/mtohUtils.py | 74 +++++++++---------- 36 files changed, 80 insertions(+), 116 deletions(-) diff --git a/test/lib/mayaUsd/render/mayaToHydra/README.md b/test/lib/mayaUsd/render/mayaToHydra/README.md index 35443a972b..c4d7eb4c49 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/README.md +++ b/test/lib/mayaUsd/render/mayaToHydra/README.md @@ -26,7 +26,7 @@ For example, to run testVisibility on RelWithDebInfo : ### Running tests with MayaUSD -Some tests require the MayaUSD plugin to be loaded in order to be run. If MayaUSD cannot be loaded, those tests will be skipped. In order for the test framework to find and load MayaUSD, the `-DMAYAUSD_LOCATION` CMake flag must be set to your MayaUSD installation directory when building MayaHydra. For convenience, you can use the `--mayausd-location` parameter when using the [build.py](../../../../../build.py) script, which will set the CMake flag for you with the given argument. The specified path should point to the directory where your MayaUSD `.mod` file resides. Note that the test framework will not find MayaUSD using the MAYA_MODULE_PATH environment variable. +The tests require MayaUSD in order to be run. In order for the test framework to find and load MayaUSD, the `-DMAYAUSD_LOCATION` CMake flag must be set to your MayaUSD installation directory when building MayaHydra. For convenience, you can use the `--mayausd-location` parameter when using the [build.py](../../../../../build.py) script, which will set the CMake flag for you with the given argument. The specified path should point to the directory where your MayaUSD `.mod` file resides. Note that the test framework will not find MayaUSD using the MAYA_MODULE_PATH environment variable. For example, if your MayaUSD `.mod` file resides in `/install/RelWithDebInfo`, you could call build.py as such : @@ -54,29 +54,26 @@ Looking to add a C++ test suite? See the corresponding [README.md](./cpp/README. To add a new Python-only test suite : 1. Create a new test[...].py file in the current folder. -2. Create a test class that derives from unittest.TestCase (doesn't need to directly inherit from it). -3. Add `test_[...]` methods for each test case in your test suite. -4. Add the following snippet at the bottom of your file : +2. Create a test class that derives from `mtohUtils.MayaHydraBaseTestCase`. +3. Add the line `_file = __file__` in your class definition. +4. If needed, set `_extraPluginsToLoad` to list any plugins that need to be loaded for your test. MayaUSD does not need to be specified, it will be loaded automatically. +5. Add `test_[...]` methods for each test case in your test suite. +6. Add the following snippet at the bottom of your file : ```python if __name__ == '__main__': fixturesUtils.runTests(globals()) ``` -5. Add the name of your test[...].py file to the list of `TEST_SCRIPT_FILES` in the [current folder's CMakeLists.txt](./CMakeLists.txt) - -Some important notes : -- By default, the mayaHydra plugin will not be loaded. An easy way to load it is to have your test class derive from `MayaHydraBaseTestCase`, which will automatically load mayaHydra when running tests. Don't forget to add the line `_file = __file__` in your class. -- After loading mayaHydra, the renderer will still be on Viewport 2.0. If you want to use another renderer, your test will have to switch to it. If you want to use HdStorm, an easy way to do it is to have your test class derive from `MayaHydraBaseTestCase` and call `self.setHdStormRenderer()` +7. Add the name of your test[...].py file to the list of `TEST_SCRIPT_FILES` in the [current folder's CMakeLists.txt](./CMakeLists.txt) # Image comparison Image comparison is done using [idiff from OpenImageIO](https://openimageio.readthedocs.io/en/latest/idiff.html). Some utilities exist to facilitate image comparison tests. Here is the simplest way to get going : -1. Make your test class derive from `MtohTestCase`. -2. Don't forget to add the line `_file = __file__` in your class. -3. Create a folder called [TestName]Test (e.g. for testVisibility, create a folder VisibilityTest) -4. Put the images you want to use for comparison in that folder -5. Call `self.assertImagesClose`, `self.assertImagesEqual` and/or `self.assertSnapshotClose` with the file names of the images to compare with. +1. Make sure your test class derives from `mtohUtils.MayaHydraBaseTestCase` (and has the line `_file = __file__`). +2. Create a folder called [TestName]Test (e.g. for testVisibility, create a folder VisibilityTest) +3. Put the images you want to use for comparison in that folder +4. Call `self.assertImagesClose`, `self.assertImagesEqual` and/or `self.assertSnapshotClose` with the file names of the images to compare with. For the `assert[...]Close` methods, you will need to pass in a fail threshold for individual pixels and a fail percentage for the whole image. Other parameters are also available for you to specify. You can find more information on these parameters on the [idiff documentation page](https://openimageio.readthedocs.io/en/latest/idiff.html). @@ -88,10 +85,4 @@ To create a reference snapshot, an easy way is to first write your test, and the # Utilities -Utility files are located under [/test/testUtils](../../../../testUtils/). Note that at the time of writing this (2023/08/16), many of the utils files and their contents were inherited from the USD plugin, and are not all used. Here are some of the main utilities you might find useful : - -- mtohutils.py : - - `checkForMayaUsdPlugin()` will try to load the MayaUsd plugin and return a boolean indicating if the plugin was loaded successfully. By decorating a test case with the following line, you can run the test only if the MayaUsd plugin is found and loaded : - ```@unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.")``` - - `MayaHydraBaseTestCase` is a base class you can use for your test classes that will provide you with some useful functionality, such as automatically loading the mayaHydra plugin. It also provides a method to use the HdStorm renderer (`setHdStormRenderer`), and another to create a simple scene with a cube (`makeCubeScene`). - - `MtohTestCase` is a class you can use as a base for your test classes that will provide you with image comparison functionality (see [Image comparison](#Image-comparison) section). Note that this class already derives from MayaHydraBaseTestCase, so it will also automatically load the mayaHydra plugin. +Utility files are located under [/test/testUtils](../../../../testUtils/). Note that at the time of writing this (2023/08/16), many of the utils files and their contents were inherited from the USD plugin, and are not all used. diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py index 744d2ae29a..c92c159dcd 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py @@ -37,7 +37,6 @@ def setupUsdStage(self): UsdLux.RectLight.Define(usdStage, "/USDRectLight") cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_SkipMayaUsdUfeLights(self): self.setupUsdStage() with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py index 07b9ec053c..5ae42a2364 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py @@ -66,7 +66,6 @@ def setupScene(self): cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PathInterface(self): self.setupScene() with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py index 32bc3647c6..6691bb8586 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py @@ -20,7 +20,7 @@ from testUtils import PluginLoaded -class TestPicking(mtohUtils.MtohTestCase): +class TestPicking(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -89,7 +89,6 @@ def test_PickMayaLight(self): with PluginLoaded('mayaHydraCppTests'): cmds.mayaHydraCppTest(directionalLightObjectName, "simpleLight", f="TestPicking.pickObject") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickUsdMesh(self): import mayaUsd_createStageWithNewLayer stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer() @@ -97,7 +96,6 @@ def test_PickUsdMesh(self): with PluginLoaded('mayaHydraCppTests'): cmds.mayaHydraCppTest(cubeObjectName, "mesh", f="TestPicking.pickObject") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickUsdImplicitSurface(self): import mayaUsd_createStageWithNewLayer stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer() @@ -105,7 +103,6 @@ def test_PickUsdImplicitSurface(self): with PluginLoaded('mayaHydraCppTests'): cmds.mayaHydraCppTest(cubeObjectName, "mesh", f="TestPicking.pickObject") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickUsdLight(self): import mayaUsd_createStageWithNewLayer stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer() @@ -113,7 +110,6 @@ def test_PickUsdLight(self): with PluginLoaded('mayaHydraCppTests'): cmds.mayaHydraCppTest(rectLightObjectName, "rectLight", f="TestPicking.pickObject") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_MarqueeSelection(self): import mayaUsd_createStageWithNewLayer stagePath = mayaUsd_createStageWithNewLayer.createStageWithNewLayer() diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py index bee463f53f..fa79f81352 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py @@ -32,7 +32,6 @@ def loadUsdScene(self): self.setHdStormRenderer() cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdPrimInstancing(self): self.loadUsdScene() with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py index cf9a27755e..1a1593e704 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py @@ -31,7 +31,6 @@ def loadUsdScene(self): usdUtils.createStageFromFile(usdScenePath) self.setHdStormRenderer() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_HydraFromUsdSceneCorrectness(self): self.loadUsdScene() cmds.select(all=True) diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py index 3c12162c3a..6b131b23d2 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py @@ -57,7 +57,6 @@ def setupUsdStage(self): cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdStageLayerMuting(self): self.setupUsdStage() with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py index 0e2a595606..6dabde2fbf 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py @@ -10,7 +10,6 @@ class TestWireframeSelectionHighlightSceneIndex(mtohUtils.MayaHydraBaseTestCase) # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_wireframeSelectionHighlightSceneIndex(self): self.setHdStormRenderer() with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py index 3592dc3450..f169f89c62 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py @@ -21,9 +21,10 @@ import unittest import platform -class TestArnoldLights(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestArnoldLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ + _extraPluginsToLoad = ['mtoa'] @property def imageDiffFailThreshold(self): @@ -74,7 +75,6 @@ def verifyLightingModes(self, shadowOn): #self.assertSnapshotClose("noLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent) #Test arnold lights (e.g., aiSkyDomeLight,etc.) with a maya native sphere and usd sphere. - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin() and mtohUtils.checkForMtoAPlugin(), "Requires Maya USD and MtoA Plugins.") def test_ArnoldLights(self): cmds.file(new=True, force=True) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testCurveTools.py b/test/lib/mayaUsd/render/mayaToHydra/testCurveTools.py index 17e894ab64..b139d157d0 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testCurveTools.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testCurveTools.py @@ -18,7 +18,7 @@ import platform -class TestCurveTools(mtohUtils.MtohTestCase): +class TestCurveTools(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testFlowViewportAPI.py b/test/lib/mayaUsd/render/mayaToHydra/testFlowViewportAPI.py index 44d222d6a5..824dac9eb2 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testFlowViewportAPI.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testFlowViewportAPI.py @@ -31,7 +31,7 @@ def setRotateY(matrixAsAList, angle): matrixAsAList[2+4*0] = sin(angle) return matrixAsAList -class TestFlowViewportAPI(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestFlowViewportAPI(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py b/test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py index 586c9f943a..9a71cf66b0 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testFootPrintNode.py @@ -26,7 +26,7 @@ HD_STORM = "HdStormRendererPlugin" HD_STORM_OVERRIDE = "mayaHydraRenderOverride_" + HD_STORM -class TestFootPrintNode(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestFootPrintNode(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py b/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py index 71c7cdc515..6c0144cc5a 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py @@ -22,7 +22,7 @@ import fixturesUtils import mtohUtils -class TestImageDiffing(mtohUtils.MtohTestCase): +class TestImageDiffing(mtohUtils.MayaHydraBaseTestCase): """Test the image diffing setup to make sure it works and returns the expected results.""" _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testLookThrough.py b/test/lib/mayaUsd/render/mayaToHydra/testLookThrough.py index 3e0baf4d2f..e15e7dcad9 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testLookThrough.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testLookThrough.py @@ -20,7 +20,7 @@ import mayaUtils import platform -class TestLookThrough(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestLookThrough(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py index 53cc0f5bdb..11b1fa3ca8 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py @@ -18,8 +18,9 @@ import mtohUtils import unittest -class TestMaterialXOnNative(mtohUtils.MtohTestCase): +class TestMaterialXOnNative(mtohUtils.MayaHydraBaseTestCase): _file = __file__ + _extraPluginsToLoad = ['LookdevXMaya'] IMAGEDIFF_FAIL_THRESHOLD = 0.01 IMAGEDIFF_FAIL_PERCENT = 0.1 @@ -30,7 +31,6 @@ def verifySnapshot(self, imageName): self.IMAGEDIFF_FAIL_THRESHOLD, self.IMAGEDIFF_FAIL_PERCENT) - @unittest.skipUnless(mtohUtils.checkForPlugin('LookdevXMaya'), "Requires LookDevX Plugin.") def test_MaterialX(self): mayaUtils.openTestScene("testMaterialX", "RedMtlxSphere.ma") self.setBasicCam(2) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayLayers.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayLayers.py index d9fa140381..3c1acd82f6 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayLayers.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayLayers.py @@ -20,7 +20,7 @@ import platform -class TestMayaDisplayLayers(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaDisplayLayers(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py index 58fc905909..a0deb31ace 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py @@ -23,7 +23,7 @@ import platform -class TestMayaDisplayModes(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaDisplayModes(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaIsolateSelect.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaIsolateSelect.py index a10e66f097..b2225dd630 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaIsolateSelect.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaIsolateSelect.py @@ -20,7 +20,7 @@ import platform -class TestMayaIsolateSelect(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaIsolateSelect(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py index 11ee9c441c..8ae3414488 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py @@ -22,7 +22,7 @@ import platform -class TestMayaLights(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -88,7 +88,6 @@ def verifyLightingModes(self, shadowOn): self.assertSnapshotClose("noLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent) #Test maya lights (e.g., default,directional,point,spot,etc.) with a maya native sphere and usd sphere. - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_MayaLights(self): cmds.file(new=True, force=True) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaShadingModes.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaShadingModes.py index c1314474c3..08ca45a22d 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaShadingModes.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaShadingModes.py @@ -21,7 +21,7 @@ import platform -class TestMayaShadingModes(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaShadingModes(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py index 1bd90c3038..5391ea36a7 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py @@ -21,7 +21,7 @@ import mayaUtils import platform -class TestMayaUsdAPI(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestMayaUsdAPI(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -37,7 +37,6 @@ def imageDiffFailPercent(self): return 3 return 0.2 - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_MovingUsdStage(self): # Load a maya scene with a sphere prim in a UsdStage and a directional light, with HdStorm already being the viewport renderer. testFile = mayaUtils.openTestScene( diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py b/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py index deb6b518b9..bc44c872a9 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py @@ -25,7 +25,7 @@ import fixturesUtils import mtohUtils -class TestSnapshot(mtohUtils.MtohTestCase): +class TestSnapshot(mtohUtils.MayaHydraBaseTestCase): """Tests whether our snapshot rendering works with basic Viewport 2.0""" _file = __file__ @@ -60,7 +60,7 @@ def test_flat_orange(self): self.assertRaises(AssertionError, self.assertSnapshotEqual, "flat_orange_bad.png") -class TestMayaHydraRender(mtohUtils.MtohTestCase): +class TestMayaHydraRender(mtohUtils.MayaHydraBaseTestCase): _file = __file__ def test_cube(self): diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py b/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py index 2115672c26..1eee9cac3d 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py @@ -22,7 +22,7 @@ import fixturesUtils import mtohUtils -class TestDagChanges(mtohUtils.MtohTestCase): +class TestDagChanges(mtohUtils.MayaHydraBaseTestCase): _file = __file__ def setUp(self): @@ -262,7 +262,7 @@ def test_instance_move(self): self.assertSnapshotEqual("instances_12.png", self.imageVersion) -class TestUndo(mtohUtils.MtohTestCase): +class TestUndo(mtohUtils.MayaHydraBaseTestCase): _file = __file__ def test_node_creation_undo(self): diff --git a/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py b/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py index 044a6988af..a5de691b79 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py @@ -23,7 +23,6 @@ class TestStage(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_newFileWithUsdStage(self): import mayaUsd_createStageWithNewLayer import mayaUsd.lib diff --git a/test/lib/mayaUsd/render/mayaToHydra/testNurbsPrimitives.py b/test/lib/mayaUsd/render/mayaToHydra/testNurbsPrimitives.py index d318fd6649..7e67e23c83 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testNurbsPrimitives.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testNurbsPrimitives.py @@ -16,7 +16,7 @@ import fixturesUtils import mtohUtils -class TestNurbsPrimitives(mtohUtils.MtohTestCase): +class TestNurbsPrimitives(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testObjectTemplate.py b/test/lib/mayaUsd/render/mayaToHydra/testObjectTemplate.py index 1ea7e04c03..773732ffba 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testObjectTemplate.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testObjectTemplate.py @@ -20,7 +20,7 @@ import mayaUtils import platform -class TestObjectTemplate(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestObjectTemplate(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py b/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py index 6ce36c1832..1f2f7b83d4 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testPolygonPrimitives.py @@ -18,7 +18,7 @@ import platform -class TestPolygonPrimitives(mtohUtils.MtohTestCase): +class TestPolygonPrimitives(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py index 34030fc50f..1267873f72 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py @@ -25,9 +25,7 @@ class TestSceneBrowser(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - - SCENE_BROWSER_TEST_PLUGIN_NAME = 'mayaHydraSceneBrowserTest' - SCENE_BROWSER_TEST_PLUGIN_COMMAND = SCENE_BROWSER_TEST_PLUGIN_NAME + _extraPluginsToLoad = ['mayaHydraSceneBrowserTest'] def setupScene(self): import mayaUsd @@ -44,14 +42,9 @@ def setupScene(self): cmds.directionalLight(name="MayaDirectionalLight") cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin() and mtohUtils.checkForPlugin(SCENE_BROWSER_TEST_PLUGIN_NAME) - and platform.system() != "Darwin", - f'Requires mayaUSD and {SCENE_BROWSER_TEST_PLUGIN_NAME} plugins. ' - 'Currently also disabled on OSX.') def test_SceneBrowser(self): self.setupScene() - with PluginLoaded(self.SCENE_BROWSER_TEST_PLUGIN_NAME): - mel.eval(self.SCENE_BROWSER_TEST_PLUGIN_COMMAND) + cmds.mayaHydraSceneBrowserTest() if __name__ == '__main__': fixturesUtils.runTests(globals()) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py b/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py index f4d0e1abbf..c13e226822 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py @@ -26,7 +26,6 @@ class TestStage(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_addPrim(self): import mayaUsd_createStageWithNewLayer import mayaUsd.lib diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py b/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py index 047885dd90..e0707b1d84 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py @@ -23,7 +23,7 @@ import ufe from pxr import Usd, Sdf -class TestUsdStagePayloadsAndReferences(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestUsdStagePayloadsAndReferences(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -95,7 +95,6 @@ def setUpPayloadScene(self): cmds.select(clear=True) - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdStagePayloadsOnTheFly(self): import mayaUsd.ufe import usdUfe @@ -143,7 +142,6 @@ def test_UsdStagePayloadsOnTheFly(self): self.assertTrue(prim.IsLoaded()) self.assertSnapshotClose("cubeLoadWithDescendants.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdStagePayloadsFromScene(self): from mayaUsd import lib as mayaUsdLib self.loadUsdPayloadScene() @@ -162,7 +160,6 @@ def test_UsdStagePayloadsFromScene(self): self.assertEqual(modVariant.GetVariantSelection(), 'FlowerPotB') self.assertSnapshotClose("payloadSceneLoadedPotB.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdStageReferences(self): self.setUpReferenceScene() self.assertSnapshotClose("referencesSceneCreated.png", self.IMAGE_DIFF_FAIL_THRESHOLD, self.IMAGE_DIFF_FAIL_PERCENT) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py index 4c7e699bf5..0578431c25 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py @@ -22,14 +22,13 @@ import mayaUtils import ufe -class TestStageVariants(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestStageVariants(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ IMAGE_DIFF_FAIL_THRESHOLD = 0.1 IMAGE_DIFF_FAIL_PERCENT = 0.3 - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_UsdStageVariants(self): import usdUtils from mayaUsd import lib as mayaUsdLib diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStandardSurface.py b/test/lib/mayaUsd/render/mayaToHydra/testStandardSurface.py index 051b3b1270..a5fcf60386 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStandardSurface.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStandardSurface.py @@ -19,7 +19,7 @@ import mtohUtils import mayaUtils -class TestStandardSurface(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestStandardSurface(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py b/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py index e862dd92f7..15a7ad6e53 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py @@ -19,7 +19,7 @@ import mtohUtils import unittest -class TestTransforms(mtohUtils.MtohTestCase): +class TestTransforms(mtohUtils.MayaHydraBaseTestCase): _file = __file__ IMAGEDIFF_FAIL_THRESHOLD = 0.01 @@ -56,7 +56,6 @@ def test_nativePrim(self): cmds.scale(2, 2, 2, cubeParent, absolute=True) self.verifySnapshot("cube_parent_moved_rotated_scaled.png") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_usdPrim(self): import mayaUsd import mayaUsd_createStageWithNewLayer diff --git a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py index 53f36fd3ed..4ef9408897 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py @@ -21,7 +21,7 @@ import unittest import platform -class TestUSDLights(mtohUtils.MtohTestCase): #Subclassing mtohUtils.MtohTestCase to be able to call self.assertSnapshotClose +class TestUSDLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -82,7 +82,6 @@ def verifyLightingModes(self, shadowOn): #self.assertSnapshotClose("noLight" + imageSuffix + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent) #Test usd lights (e.g., disk,distant,dome,etc.) with a maya native sphere and usd sphere. - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_USDLights(self): cmds.file(new=True, force=True) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testVisibility.py b/test/lib/mayaUsd/render/mayaToHydra/testVisibility.py index be6159d426..a80f3c7bb0 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testVisibility.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testVisibility.py @@ -19,7 +19,7 @@ import fixturesUtils import mtohUtils -class TestVisibility(mtohUtils.MtohTestCase): +class TestVisibility(mtohUtils.MayaHydraBaseTestCase): _file = __file__ IMAGEDIFF_FAIL_THRESHOLD = 0.01 diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index afee67a92e..8ed50f29b0 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -28,6 +28,7 @@ HD_STORM = "HdStormRendererPlugin" HD_STORM_OVERRIDE = "mayaHydraRenderOverride_" + HD_STORM +MAYAUSD_PLUGIN_NAME = 'mayaUsdPlugin' def checkForPlugin(pluginName: str): try: @@ -42,21 +43,44 @@ def checkForMayaUsdPlugin(): def checkForMtoAPlugin(): return checkForPlugin('mtoa') -class MayaHydraBaseTestCase(unittest.TestCase): - '''Base class for mayaHydra unit tests without image comparison.''' - - _file = None +class MayaHydraBaseTestCase(unittest.TestCase, ImageDiffingTestCase): + '''Base class for mayaHydra unit tests.''' DEFAULT_CAM_DIST = 24 + _inputDir = None + + # Variables to be set in subclasses + _file = None + _extraPluginsToLoad = [] + @classmethod def setUpClass(cls): if cls._file is None: - raise ValueError("Subclasses of MayaHydraBaseTestCase must " - "define `_file = __file__`") - # Set up all tests with their own test directory to write out test-specific coverage information - fixturesUtils.setUpClass(cls._file, 'mayaHydra', - initializeStandalone=False) + raise ValueError("Subclasses of MayaHydraBaseTestCase must define " + "`_file = __file__`") + + inputPath = fixturesUtils.setUpClass( + cls._file, 'mayaHydra', initializeStandalone=False, + suffix=('_' + cls.__name__)) + + if cls._inputDir is None: + inputDirName = os.path.splitext(os.path.basename(cls._file))[0] + inputDirName = testUtils.stripPrefix(inputDirName, 'test') + if not inputDirName.endswith('Test'): + inputDirName += 'Test' + cls._inputDir = os.path.join(inputPath, inputDirName) + + cls._testDir = os.path.abspath('.') + + if MAYAUSD_PLUGIN_NAME not in cls._extraPluginsToLoad: + cls._extraPluginsToLoad.append(MAYAUSD_PLUGIN_NAME) + + for pluginToLoad in cls._extraPluginsToLoad: + # If a plugin fails to load, the entire test suite will be immediately aborted. + # Note that in the case of mtoa, the plugin might load successfully but not + # initialize properly, which means issues will only be caught in the actual tests. + cmds.loadPlugin(pluginToLoad) def setUp(self): # Maya is not closed/reset between each test of a test suite, @@ -137,30 +161,6 @@ def trace(self, msg): def traceIndex(self, msg): self.trace(msg.format(str(self.getIndex()))) -class MtohTestCase(MayaHydraBaseTestCase, ImageDiffingTestCase): - '''Base class for mayaHydra unit tests with image comparison.''' - - _inputDir = None - - @classmethod - def setUpClass(cls): - if cls._file is None: - raise ValueError("Subclasses of MtohTestCase, must define " - "`_file = __file__`") - - inputPath = fixturesUtils.setUpClass( - cls._file, 'mayaHydra', initializeStandalone=False, - suffix=('_' + cls.__name__)) - - if cls._inputDir is None: - inputDirName = os.path.splitext(os.path.basename(cls._file))[0] - inputDirName = testUtils.stripPrefix(inputDirName, 'test') - if not inputDirName.endswith('Test'): - inputDirName += 'Test' - cls._inputDir = os.path.join(inputPath, inputDirName) - - cls._testDir = os.path.abspath('.') - def resolveRefImage(self, refImage, imageVersion): if not os.path.isabs(refImage): if imageVersion: @@ -173,21 +173,21 @@ def assertImagesClose(self, image1, image2, fail, failpercent, image1Version=Non hardfail=None, warn=None, warnpercent=None, hardwarn=None, perceptual=False): imagePath1 = self.resolveRefImage(image1, image1Version) imagePath2 = self.resolveRefImage(image2, image2Version) - super(MtohTestCase, self).assertImagesClose(imagePath1, imagePath2, fail, failpercent, hardfail, + super(MayaHydraBaseTestCase, self).assertImagesClose(imagePath1, imagePath2, fail, failpercent, hardfail, warn, warnpercent, hardwarn, perceptual) def assertImagesEqual(self, image1, image2, image1Version=None, image2Version=None): imagePath1 = self.resolveRefImage(image1, image1Version) imagePath2 = self.resolveRefImage(image2, image2Version) - super(MtohTestCase, self).assertImagesEqual(imagePath1, imagePath2) + super(MayaHydraBaseTestCase, self).assertImagesEqual(imagePath1, imagePath2) def assertSnapshotClose(self, refImage, fail, failpercent, imageVersion=None, hardfail=None, warn=None, warnpercent=None, hardwarn=None, perceptual=False): refImage = self.resolveRefImage(refImage, imageVersion) - super(MtohTestCase, self).assertSnapshotClose(refImage, fail, failpercent, hardfail, + super(MayaHydraBaseTestCase, self).assertSnapshotClose(refImage, fail, failpercent, hardfail, warn, warnpercent, hardwarn, perceptual) def assertSnapshotEqual(self, refImage, imageVersion=None): '''Use of this method is discouraged, as renders can vary slightly between renderer architectures.''' refImage = self.resolveRefImage(refImage, imageVersion) - super(MtohTestCase, self).assertSnapshotEqual(refImage) + super(MayaHydraBaseTestCase, self).assertSnapshotEqual(refImage) From 2fb37455d076c3cd074a2b7ec13f4cbe96211bca Mon Sep 17 00:00:00 2001 From: debloip Date: Sun, 24 Mar 2024 01:23:00 -0400 Subject: [PATCH 06/18] HYDRA-861 : Use relative paths in all test scene files --- .../testMayaDisplayModes.ma | 16 +---------- .../UsdStageWithSphereMatXStdSurf.usd | Bin 1230 -> 0 bytes .../UsdStageWithSphereMatXStdSurf.usda | 25 ++++++++++++++++++ .../testMayaLights/testMayaLights.ma | 4 +-- .../UsdStageWithSphereMatXStdSurf.ma | 4 +-- .../UsdStageWithSphereMatXStdSurf.usd | Bin 1230 -> 0 bytes .../UsdStageWithSphereMatXStdSurf.usda | 25 ++++++++++++++++++ .../testStagePayloadsReferences/FlowerPot.ma | 2 +- .../testStagePayloadsReferences/References.ma | 2 +- .../testStageVariants/testStageVariants.ma | 4 +-- .../UsdStageWithSphereMatXStdSurf.usd | Bin 1230 -> 0 bytes .../UsdStageWithSphereMatXStdSurf.usda | 25 ++++++++++++++++++ .../testUSDLights/testUSDLights.ma | 8 +++--- 13 files changed, 88 insertions(+), 27 deletions(-) delete mode 100644 test/testSamples/testMayaLights/UsdStageWithSphereMatXStdSurf.usd create mode 100644 test/testSamples/testMayaLights/UsdStageWithSphereMatXStdSurf.usda delete mode 100644 test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.usd create mode 100644 test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.usda delete mode 100644 test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd create mode 100644 test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usda diff --git a/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma b/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma index 6bdbb3b22e..fa033cafc3 100644 --- a/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma +++ b/test/testSamples/testMayaDisplayModes/testMayaDisplayModes.ma @@ -81,20 +81,6 @@ createNode camera -s -n "sideShape" -p "side"; setAttr ".o" yes; createNode transform -n "stage1"; rename -uid "572BC593-45A8-D62E-274A-AC9996659D7D"; -createNode mayaUsdProxyShape -n "stageShape1" -p "stage1"; - rename -uid "0BC1538A-4275-D25C-B070-DA9B2C0A9747"; - addAttr -r false -ci true -h true -sn "forceCompute" -ln "forceCompute" -min 0 - -max 1 -at "bool"; - addAttr -ci true -h true -sn "usdStageLoadRules" -ln "usdStageLoadRules" -dt "string"; - addAttr -ci true -h true -sn "usdStageTargetLayer" -ln "usdStageTargetLayer" -dt "string"; - setAttr -k off ".v"; - setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; - setAttr ".covm[0]" 0; - setAttr ".cdvm[0]" 0; - setAttr ".fp" -type "string" "E:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; - setAttr ".pp" -type "string" ""; - setAttr ".epp" -type "string" ""; createNode transform -n "pPlane1"; rename -uid "BF71B974-4691-9BE5-B685-EAA0EE2AE03B"; setAttr ".t" -type "double3" 0 -1 0 ; @@ -250,7 +236,7 @@ createNode materialInfo -n "materialInfo1"; rename -uid "7A353D3A-4CE0-1AA9-B650-97B907DB1314"; createNode file -n "file2"; rename -uid "024402E0-4F08-CE4B-8A38-2194E8643C1A"; - setAttr ".ftn" -type "string" "D:/repos/mayaHydra/ecg-maya-hydra/ecg-maya-hydra/maya-hydra/test/testSamples/testMayaDisplayModes/diffuse.png"; + setAttr ".ftn" -type "string" "./diffuse.png"; setAttr ".cs" -type "string" "sRGB"; createNode place2dTexture -n "place2dTexture2"; rename -uid "8C4D244C-4C70-F0D0-007B-139D0D202499"; diff --git a/test/testSamples/testMayaLights/UsdStageWithSphereMatXStdSurf.usd b/test/testSamples/testMayaLights/UsdStageWithSphereMatXStdSurf.usd deleted file mode 100644 index dca2aed50c76b8282d1f125c5543d34e136f6ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1230 zcmbtUPfrs;6o0$jZ7VIb1sW9)8$zNrl1S>QURr4tR7%Ts6B9MKbf8n`^|g5_j}WwnU?P_&!|da4#Ge! zDE0jR&LR^KuqQZ005Q^sSOX&gg}g_pT}bi4_^GQ zE|~h4RkzC@%opO8%>{_y1xC5Ug5x~7ckaea8Wg*M95f3puL-tewB{N{Q+JRF;M%BW z)D7fJ!`>Kp8#XFwEd-02ha5v|-ZV_zFxT?s1<-6msWnhbbD=c}Q`yyva4?G1EE_qV zfm~2(7=r6*rmi{qiraSTS`E!E!)LJCp56A`EbhOa#dQEmL(`E1hFQ0=hCU750n7o< zdV)9gRKu-Tji%vkK&i0u7^DUayYsLc(@|Y(H!)9h){s}$yoL)k%QR8VGb}R>`{H`t za#~Av)^jw|ZQ@@s45=mOIdlZwYOgj?rq|=aqd(ttl%a7R>6{@4EmYNt8t8Tt*aC-#g}Qt$Bb#nUoqIC3Qy48v?B*T8cM-s3q9Q5yL|@esv(6vrv{DITF%!1L8y zlH!+P$V|bTFeJw5I+ljaS(u2!=4E=Gk + double3 xformOp:translate = (0, 0, -2.3244301402269603) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +def Scope "mtl" +{ + def Material "standard_surface1" + { + token outputs:mtlx:surface.connect = + + def Shader "standard_surface1" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + token outputs:out + } + } +} + diff --git a/test/testSamples/testMayaLights/testMayaLights.ma b/test/testSamples/testMayaLights/testMayaLights.ma index e94cd5d109..ff7476ab80 100644 --- a/test/testSamples/testMayaLights/testMayaLights.ma +++ b/test/testSamples/testMayaLights/testMayaLights.ma @@ -87,12 +87,12 @@ createNode mayaUsdProxyShape -n "stageShape1" -p "stage1"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; - setAttr ".fp" -type "string" "E:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".fp" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".pp" -type "string" ""; setAttr ".epp" -type "string" ""; setAttr ".forceCompute" yes; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".usdStageTargetLayer" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; createNode transform -n "directionalLight1"; rename -uid "4EB83726-4CD0-CA21-AAEC-80AC18F34BCD"; setAttr ".r" -type "double3" -90 0 0 ; diff --git a/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.ma b/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.ma index 0b2c2250c7..b4e8d41a74 100644 --- a/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.ma +++ b/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.ma @@ -84,12 +84,12 @@ createNode mayaUsdProxyShape -n "stageShape1" -p "stage1"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; - setAttr ".fp" -type "string" "X:/GIT/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".fp" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".pp" -type "string" ""; setAttr ".epp" -type "string" ""; setAttr ".forceCompute" yes; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "x:/GIT/ecg-maya-hydra/maya-hydra/test/testSamples/testDirectionalLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".usdStageTargetLayer" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; createNode transform -n "directionalLight1"; rename -uid "4EB83726-4CD0-CA21-AAEC-80AC18F34BCD"; setAttr ".t" -type "double3" 0 0 -0.34456476275179959 ; diff --git a/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.usd b/test/testSamples/testMayaUsdAPIUsage/UsdStageWithSphereMatXStdSurf.usd deleted file mode 100644 index dca2aed50c76b8282d1f125c5543d34e136f6ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1230 zcmbtUPfrs;6o0$jZ7VIb1sW9)8$zNrl1S>QURr4tR7%Ts6B9MKbf8n`^|g5_j}WwnU?P_&!|da4#Ge! zDE0jR&LR^KuqQZ005Q^sSOX&gg}g_pT}bi4_^GQ zE|~h4RkzC@%opO8%>{_y1xC5Ug5x~7ckaea8Wg*M95f3puL-tewB{N{Q+JRF;M%BW z)D7fJ!`>Kp8#XFwEd-02ha5v|-ZV_zFxT?s1<-6msWnhbbD=c}Q`yyva4?G1EE_qV zfm~2(7=r6*rmi{qiraSTS`E!E!)LJCp56A`EbhOa#dQEmL(`E1hFQ0=hCU750n7o< zdV)9gRKu-Tji%vkK&i0u7^DUayYsLc(@|Y(H!)9h){s}$yoL)k%QR8VGb}R>`{H`t za#~Av)^jw|ZQ@@s45=mOIdlZwYOgj?rq|=aqd(ttl%a7R>6{@4EmYNt8t8Tt*aC-#g}Qt$Bb#nUoqIC3Qy48v?B*T8cM-s3q9Q5yL|@esv(6vrv{DITF%!1L8y zlH!+P$V|bTFeJw5I+ljaS(u2!=4E=Gk + double3 xformOp:translate = (0, 0, -2.3244301402269603) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +def Scope "mtl" +{ + def Material "standard_surface1" + { + token outputs:mtlx:surface.connect = + + def Shader "standard_surface1" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + token outputs:out + } + } +} + diff --git a/test/testSamples/testStagePayloadsReferences/FlowerPot.ma b/test/testSamples/testStagePayloadsReferences/FlowerPot.ma index 55e6d1f457..02fcda7375 100644 --- a/test/testSamples/testStagePayloadsReferences/FlowerPot.ma +++ b/test/testSamples/testStagePayloadsReferences/FlowerPot.ma @@ -89,7 +89,7 @@ createNode mayaUsdProxyShape -n "FlowerPotShape" -p "FlowerPot"; setAttr ".epp" -type "string" ""; setAttr ".forceCompute" yes; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "x:/GIT/maya-hydra-opensource/test/testSamples/testStagePayloadsReferences/FlowerPot.usda"; + setAttr ".usdStageTargetLayer" -type "string" "./FlowerPot.usda"; createNode lightLinker -s -n "lightLinker1"; rename -uid "C6C6B39A-4A43-E8E4-FF7F-43B1BCC75A33"; setAttr -s 2 ".lnk"; diff --git a/test/testSamples/testStagePayloadsReferences/References.ma b/test/testSamples/testStagePayloadsReferences/References.ma index 6411a02488..695e02f229 100644 --- a/test/testSamples/testStagePayloadsReferences/References.ma +++ b/test/testSamples/testStagePayloadsReferences/References.ma @@ -89,7 +89,7 @@ createNode mayaUsdProxyShape -n "referencesExampleShape" -p "referencesExample"; setAttr ".epp" -type "string" ""; setAttr ".forceCompute" yes; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "x:/GIT/maya-hydra-opensource/test/testSamples/testStagePayloadsReferences/referencesExample.usda"; + setAttr ".usdStageTargetLayer" -type "string" "./referencesExample.usda"; createNode lightLinker -s -n "lightLinker1"; rename -uid "8D01FE9F-4A1A-8749-28C0-D2A9E4833F67"; setAttr -s 2 ".lnk"; diff --git a/test/testSamples/testStageVariants/testStageVariants.ma b/test/testSamples/testStageVariants/testStageVariants.ma index de29125551..94e7c00d2a 100644 --- a/test/testSamples/testStageVariants/testStageVariants.ma +++ b/test/testSamples/testStageVariants/testStageVariants.ma @@ -84,11 +84,11 @@ createNode mayaUsdProxyShape -n "variantsShape" -p "variants"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; - setAttr ".fp" -type "string" "X:/GIT/maya-hydra-opensource/test/testSamples/testStageVariants/variants.usda"; + setAttr ".fp" -type "string" "./variants.usda"; setAttr ".pp" -type "string" ""; setAttr ".epp" -type "string" ""; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "x:/GIT/maya-hydra-opensource/test/testSamples/testStageVariants/variants.usda"; + setAttr ".usdStageTargetLayer" -type "string" "./variants.usda"; createNode lightLinker -s -n "lightLinker1"; rename -uid "8F516624-4B3B-FCC4-CE43-C184E6DB6B3E"; setAttr -s 2 ".lnk"; diff --git a/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd b/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd deleted file mode 100644 index dca2aed50c76b8282d1f125c5543d34e136f6ea7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1230 zcmbtUPfrs;6o0$jZ7VIb1sW9)8$zNrl1S>QURr4tR7%Ts6B9MKbf8n`^|g5_j}WwnU?P_&!|da4#Ge! zDE0jR&LR^KuqQZ005Q^sSOX&gg}g_pT}bi4_^GQ zE|~h4RkzC@%opO8%>{_y1xC5Ug5x~7ckaea8Wg*M95f3puL-tewB{N{Q+JRF;M%BW z)D7fJ!`>Kp8#XFwEd-02ha5v|-ZV_zFxT?s1<-6msWnhbbD=c}Q`yyva4?G1EE_qV zfm~2(7=r6*rmi{qiraSTS`E!E!)LJCp56A`EbhOa#dQEmL(`E1hFQ0=hCU750n7o< zdV)9gRKu-Tji%vkK&i0u7^DUayYsLc(@|Y(H!)9h){s}$yoL)k%QR8VGb}R>`{H`t za#~Av)^jw|ZQ@@s45=mOIdlZwYOgj?rq|=aqd(ttl%a7R>6{@4EmYNt8t8Tt*aC-#g}Qt$Bb#nUoqIC3Qy48v?B*T8cM-s3q9Q5yL|@esv(6vrv{DITF%!1L8y zlH!+P$V|bTFeJw5I+ljaS(u2!=4E=Gk + double3 xformOp:translate = (0, 0, -2.3244301402269603) + uniform token[] xformOpOrder = ["xformOp:translate"] +} + +def Scope "mtl" +{ + def Material "standard_surface1" + { + token outputs:mtlx:surface.connect = + + def Shader "standard_surface1" + { + uniform token info:id = "ND_standard_surface_surfaceshader" + token outputs:out + } + } +} + diff --git a/test/testSamples/testUSDLights/testUSDLights.ma b/test/testSamples/testUSDLights/testUSDLights.ma index 3f6a37b7f1..e08805c80b 100644 --- a/test/testSamples/testUSDLights/testUSDLights.ma +++ b/test/testSamples/testUSDLights/testUSDLights.ma @@ -86,12 +86,12 @@ createNode mayaUsdProxyShape -n "testUSDLights:stageShape1" -p "testUSDLights:st setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; setAttr ".cdvm[0]" 0 1 1; - setAttr ".fp" -type "string" "E:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".fp" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".epp" -type "string" ""; setAttr ".oslid" -type "string" "anon:0000018889420F50:UsdStageWithSphereMatXStdSurf-session.usda"; - setAttr ".orlid" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".orlid" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".usdStageLoadRules" -type "string" "/=all"; - setAttr ".usdStageTargetLayer" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".usdStageTargetLayer" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; createNode transform -n "testUSDLights:pSphere1"; rename -uid "34F75DDF-48D8-4C4F-A85A-3CB7A16E2341"; setAttr ".t" -type "double3" 0 0 2.324 ; @@ -198,7 +198,7 @@ createNode mayaUsdLayerManager -n "mayaUsdLayerManager1"; setAttr ".lyr[0].fid" -type "string" "usda"; setAttr ".lyr[0].szd" -type "string" ""; setAttr ".lyr[0].ann" yes; - setAttr ".lyr[1].id" -type "string" "e:/MayaHydra/ecg-maya-hydra/maya-hydra/test/testSamples/testUSDLights/UsdStageWithSphereMatXStdSurf.usd"; + setAttr ".lyr[1].id" -type "string" "./UsdStageWithSphereMatXStdSurf.usda"; setAttr ".lyr[1].fid" -type "string" "usd"; setAttr ".lyr[1].szd" -type "string" ( "#usda 1.0\n\ndef Sphere \"Sphere1\" (\n prepend apiSchemas = [\"MaterialBindingAPI\"]\n)\n{\n rel material:binding = \n double3 xformOp:translate = (0, 0, -2.3244301402269603)\n uniform token[] xformOpOrder = [\"xformOp:translate\"]\n}\n\ndef Scope \"mtl\"\n{\n def Material \"standard_surface1\"\n {\n token outputs:mtlx:surface.connect = \n\n def Shader \"standard_surface1\"\n {\n uniform token info:id = \"ND_standard_surface_surfaceshader\"\n token outputs:out\n }\n }\n}\n\ndef DistantLight \"DistantLight1\"\n{\n float inputs:angle = 0.53\n color3f inputs:shadow:color\n bool inputs:shadow:enable = 1\n token visibility = \"inherited\"\n float3 xformOp:rotateXYZ = (-90, 0, 0)\n double3 xformOp:translate = (0, 2, 0)\n uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:rotateXYZ\"]\n}\n\ndef DiskLight \"DiskLight1\"\n{\n float inputs:radius = 2.4875622\n token visibility = \"inherited\"\n float3 xformOp:rotateXYZ = (-90, 0, 0)\n" From 80f6a95ec2c9bcc4ab990f3672059d486eef70c7 Mon Sep 17 00:00:00 2001 From: debloip Date: Sun, 24 Mar 2024 01:56:00 -0400 Subject: [PATCH 07/18] HYDRA-861 : Kill ADPClientService.exe on test suite end --- test/testUtils/mtohUtils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index 8ed50f29b0..8c7fe376d1 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -24,6 +24,8 @@ import testUtils from imageUtils import ImageDiffingTestCase +import platform +import subprocess import sys HD_STORM = "HdStormRendererPlugin" @@ -89,6 +91,11 @@ def setUp(self): cmds.file(new=True, force=True) self.setHdStormRenderer() + @classmethod + def tearDownClass(cls): + if platform.system() == "Windows": + subprocess.run(['taskkill', '/f', '/im', 'ADPClientService.exe']) + def setHdStormRenderer(self): self.activeEditor = cmds.playblast(activeEditor=1) cmds.modelEditor( From a8cfd804ef932a643c34f47b3d98afe47de59b5d Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 12:31:47 -0400 Subject: [PATCH 08/18] HYDRA-861 : Add comment for killing ADPClientService --- test/testUtils/mtohUtils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index 8c7fe376d1..2601b191be 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -94,6 +94,11 @@ def setUp(self): @classmethod def tearDownClass(cls): if platform.system() == "Windows": + # On Windows, ADPClientService can linger around after a test ends and Maya closes, + # keeping a handle open into the temporary test directory that holds preferences, + # settings, etc. This prevents us from deleting the temporary test directory, and + # thus from cleaning the build. To avoid this, kill the process immediately. + # So far (2024-03-25), this has only been observed when using LookdevX. subprocess.run(['taskkill', '/f', '/im', 'ADPClientService.exe']) def setHdStormRenderer(self): From 0794aa0822361383f2980d79369f2fbc222f668e Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 14:26:04 -0400 Subject: [PATCH 09/18] HYDRA-861 : Update point instance picking test and remove specific checkForPlugin functions --- .../render/mayaToHydra/cpp/testPointInstancePicking.py | 5 +---- test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py | 1 - test/testUtils/mtohUtils.py | 6 ------ 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py index d7213c8827..cb1d2c8b37 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py @@ -21,7 +21,7 @@ import testUtils from testUtils import PluginLoaded -class TestPointInstancePicking(mtohUtils.MtohTestCase): +class TestPointInstancePicking(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -45,7 +45,6 @@ def setUp(self): cmds.setAttr('persp.rotate', -33.4, 63.0, 0, type='float3') cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickPointInstancer(self): with PluginLoaded('mayaHydraCppTests'): @@ -63,7 +62,6 @@ def test_PickPointInstancer(self): self.PICK_PATH + marker, f="TestPointInstancePicking.pickPointInstance") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickInstances(self): with PluginLoaded('mayaHydraCppTests'): @@ -87,7 +85,6 @@ def test_PickInstances(self): self.PICK_PATH + marker, f="TestPointInstancePicking.pickPointInstance") - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_PickPrototypes(self): with PluginLoaded('mayaHydraCppTests'): diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py index a0deb31ace..a718e64f62 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py @@ -100,7 +100,6 @@ def test_MayaDisplayModes(self): self.assertSnapshotClose("displayTextures" + ".png", self.imageDiffFailThreshold, self.imageDiffFailPercent) cmds.modelEditor(panel, edit=True, displayTextures=False) - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_MayaBoundingBoxDisplayMode(self): with PluginLoaded('mayaHydraFlowViewportAPILocator'): # open a Maya scene that contains USD prims, custom flow viewport data producer prims and maya native prims diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index 2601b191be..635835b79f 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -39,12 +39,6 @@ def checkForPlugin(pluginName: str): return False return True -def checkForMayaUsdPlugin(): - return checkForPlugin('mayaUsdPlugin') - -def checkForMtoAPlugin(): - return checkForPlugin('mtoa') - class MayaHydraBaseTestCase(unittest.TestCase, ImageDiffingTestCase): '''Base class for mayaHydra unit tests.''' From fa519c0918e081613891d018cf75d133692f5d00 Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 14:55:17 -0400 Subject: [PATCH 10/18] HYDRA-861 : Add back skipping testSceneBrowser on OSX --- test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py index 1267873f72..6032fb30b2 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py @@ -42,6 +42,7 @@ def setupScene(self): cmds.directionalLight(name="MayaDirectionalLight") cmds.refresh() + @unittest.skipUnless(platform.system() != "Darwin", 'This test is disabled on OSX.') def test_SceneBrowser(self): self.setupScene() cmds.mayaHydraSceneBrowserTest() From f889e4f99934c38974aa60aa011bde78cab01b08 Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 15:25:17 -0400 Subject: [PATCH 11/18] HYDRA-861 : Document force flag usage in taskkill --- test/testUtils/mtohUtils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index 635835b79f..84ce1f9e91 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -93,6 +93,8 @@ def tearDownClass(cls): # settings, etc. This prevents us from deleting the temporary test directory, and # thus from cleaning the build. To avoid this, kill the process immediately. # So far (2024-03-25), this has only been observed when using LookdevX. + # Note that the force (/f) flag seems necessary, omitting it did not end up killing + # the process. subprocess.run(['taskkill', '/f', '/im', 'ADPClientService.exe']) def setHdStormRenderer(self): From 5f9e5fb789328e1caf6417d62628a17850688e4d Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 15:32:23 -0400 Subject: [PATCH 12/18] HYDRA-861 : Add best practices section in test README --- test/lib/mayaUsd/render/mayaToHydra/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lib/mayaUsd/render/mayaToHydra/README.md b/test/lib/mayaUsd/render/mayaToHydra/README.md index c4d7eb4c49..715c290f3e 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/README.md +++ b/test/lib/mayaUsd/render/mayaToHydra/README.md @@ -65,6 +65,9 @@ To add a new Python-only test suite : ``` 7. Add the name of your test[...].py file to the list of `TEST_SCRIPT_FILES` in the [current folder's CMakeLists.txt](./CMakeLists.txt) +# Best practices +- Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_extraPluginsToLoad` variable in your test class. + # Image comparison Image comparison is done using [idiff from OpenImageIO](https://openimageio.readthedocs.io/en/latest/idiff.html). From c39d5dd0a8b32afab6db55daadcd00f408867c04 Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 15:37:13 -0400 Subject: [PATCH 13/18] HYDRA-861 : Document MAYA_MODULE_PATH usage for MtoA --- cmake/test.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/test.cmake b/cmake/test.cmake index 363ba85b62..5358b5540f 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -300,6 +300,12 @@ finally: # mtoa if(DEFINED MTOA_LOCATION) + # It seems like we need to use MAYA_MODULE_PATH for MtoA to work properly. + # Even if we emulate the .mod file by manually setting the same env vars + # to the same values, MtoA itself will appear to load successfully when + # calling loadPlugin, but some of its extensions will fail to initialize, + # leading to incorrect behavior and test failures. In those cases, it seems + # like having a locally installed MtoA fixed it, but we can't rely on that. list(APPEND MAYAUSD_VARNAME_MAYA_MODULE_PATH "${MTOA_LOCATION}") endif() From 18bcfdf92b2fedc50503b02097c8ae64c0899fda Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 16:13:50 -0400 Subject: [PATCH 14/18] HYDRA-861 : Re-add existing line about MAYA_MODULE_PATH --- cmake/test.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/test.cmake b/cmake/test.cmake index 5358b5540f..c5bf6b674d 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -394,6 +394,10 @@ finally: endif() endforeach() + # Unset any MAYA_MODULE_PATH as we set all the individual variables + # so we don't want to conflict with a MayaUsd module. + set_property(TEST ${test_name} APPEND PROPERTY ENVIRONMENT "MAYA_MODULE_PATH=") + # set all env vars foreach(pathvar ${ALL_PATH_VARS}) set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT From ec4e6c0b398613975712d2ea6d44bfeb78f96a81 Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 16:35:12 -0400 Subject: [PATCH 15/18] HYDRA-861 : Add note on what happens before each test --- test/lib/mayaUsd/render/mayaToHydra/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/lib/mayaUsd/render/mayaToHydra/README.md b/test/lib/mayaUsd/render/mayaToHydra/README.md index 715c290f3e..68a00b6749 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/README.md +++ b/test/lib/mayaUsd/render/mayaToHydra/README.md @@ -65,6 +65,9 @@ To add a new Python-only test suite : ``` 7. Add the name of your test[...].py file to the list of `TEST_SCRIPT_FILES` in the [current folder's CMakeLists.txt](./CMakeLists.txt) +Some important notes : +- Before each test, a new file will be opened and the renderer will be switched to Hydra. If you need to switch between renderers, you can use the `self.setHdStormRenderer()` and `self.setViewport2Renderer()` methods. + # Best practices - Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_extraPluginsToLoad` variable in your test class. From 758bf272f4e472ff2da1621157a7c6343c0e3f3c Mon Sep 17 00:00:00 2001 From: debloip Date: Mon, 25 Mar 2024 17:11:24 -0400 Subject: [PATCH 16/18] HYDRA-861 : Add other best practices --- test/lib/mayaUsd/render/mayaToHydra/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/mayaUsd/render/mayaToHydra/README.md b/test/lib/mayaUsd/render/mayaToHydra/README.md index 68a00b6749..cac7c20507 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/README.md +++ b/test/lib/mayaUsd/render/mayaToHydra/README.md @@ -70,6 +70,8 @@ Some important notes : # Best practices - Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_extraPluginsToLoad` variable in your test class. +- Use relative paths in test data to make sure the tests will work anywhere. +- Prefer storing USD data in text-form .usda instead of binary, for readability and ease of modification should a test need to be tweaked. # Image comparison From 3e1a73d8986674bd3ce5808a6cd2807bbedd2141 Mon Sep 17 00:00:00 2001 From: debloip Date: Tue, 26 Mar 2024 12:08:32 -0400 Subject: [PATCH 17/18] HYDRA-861 : Rename _extraPluginsToLoad to _requiredPlugins --- test/lib/mayaUsd/render/mayaToHydra/README.md | 4 ++-- test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py | 2 +- .../mayaUsd/render/mayaToHydra/testMaterialXOnNative.py | 2 +- test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py | 2 +- test/testUtils/mtohUtils.py | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/lib/mayaUsd/render/mayaToHydra/README.md b/test/lib/mayaUsd/render/mayaToHydra/README.md index cac7c20507..2795de898d 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/README.md +++ b/test/lib/mayaUsd/render/mayaToHydra/README.md @@ -56,7 +56,7 @@ To add a new Python-only test suite : 1. Create a new test[...].py file in the current folder. 2. Create a test class that derives from `mtohUtils.MayaHydraBaseTestCase`. 3. Add the line `_file = __file__` in your class definition. -4. If needed, set `_extraPluginsToLoad` to list any plugins that need to be loaded for your test. MayaUSD does not need to be specified, it will be loaded automatically. +4. If needed, set `_requiredPlugins` to list any plugins that need to be loaded for your test. MayaUSD does not need to be specified, it will be loaded automatically. 5. Add `test_[...]` methods for each test case in your test suite. 6. Add the following snippet at the bottom of your file : ```python @@ -69,7 +69,7 @@ Some important notes : - Before each test, a new file will be opened and the renderer will be switched to Hydra. If you need to switch between renderers, you can use the `self.setHdStormRenderer()` and `self.setViewport2Renderer()` methods. # Best practices -- Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_extraPluginsToLoad` variable in your test class. +- Don't skip tests unless necessary. If a test requires a certain plugin to be loaded, don't skip the test if the plugin fails to load, as this will falsely be reported as a pass. For such cases, prefer setting the `_requiredPlugins` variable in your test class. - Use relative paths in test data to make sure the tests will work anywhere. - Prefer storing USD data in text-form .usda instead of binary, for readability and ease of modification should a test need to be tweaked. diff --git a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py index f169f89c62..c41841b57d 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py @@ -24,7 +24,7 @@ class TestArnoldLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - _extraPluginsToLoad = ['mtoa'] + _requiredPlugins = ['mtoa'] @property def imageDiffFailThreshold(self): diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py index 11b1fa3ca8..6cf3cbc741 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py @@ -20,7 +20,7 @@ class TestMaterialXOnNative(mtohUtils.MayaHydraBaseTestCase): _file = __file__ - _extraPluginsToLoad = ['LookdevXMaya'] + _requiredPlugins = ['LookdevXMaya'] IMAGEDIFF_FAIL_THRESHOLD = 0.01 IMAGEDIFF_FAIL_PERCENT = 0.1 diff --git a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py index 6032fb30b2..f5d78a9841 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py @@ -25,7 +25,7 @@ class TestSceneBrowser(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ - _extraPluginsToLoad = ['mayaHydraSceneBrowserTest'] + _requiredPlugins = ['mayaHydraSceneBrowserTest'] def setupScene(self): import mayaUsd diff --git a/test/testUtils/mtohUtils.py b/test/testUtils/mtohUtils.py index 84ce1f9e91..252e99b856 100644 --- a/test/testUtils/mtohUtils.py +++ b/test/testUtils/mtohUtils.py @@ -48,7 +48,7 @@ class MayaHydraBaseTestCase(unittest.TestCase, ImageDiffingTestCase): # Variables to be set in subclasses _file = None - _extraPluginsToLoad = [] + _requiredPlugins = [] @classmethod def setUpClass(cls): @@ -69,10 +69,10 @@ def setUpClass(cls): cls._testDir = os.path.abspath('.') - if MAYAUSD_PLUGIN_NAME not in cls._extraPluginsToLoad: - cls._extraPluginsToLoad.append(MAYAUSD_PLUGIN_NAME) + if MAYAUSD_PLUGIN_NAME not in cls._requiredPlugins: + cls._requiredPlugins.append(MAYAUSD_PLUGIN_NAME) - for pluginToLoad in cls._extraPluginsToLoad: + for pluginToLoad in cls._requiredPlugins: # If a plugin fails to load, the entire test suite will be immediately aborted. # Note that in the case of mtoa, the plugin might load successfully but not # initialize properly, which means issues will only be caught in the actual tests. From 31354e85cd22d97b2f6bba751822704df728944c Mon Sep 17 00:00:00 2001 From: debloip Date: Tue, 26 Mar 2024 15:44:47 -0400 Subject: [PATCH 18/18] HYDRA-861 : Adjust testRefinement and testUsdNativeInstancePicking + remove a bunch of unused imports --- .../mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py | 1 - .../mayaUsd/render/mayaToHydra/cpp/testPathInterface.py | 2 -- test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py | 1 - .../render/mayaToHydra/cpp/testPointInstancePicking.py | 1 - .../mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py | 1 - .../mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py | 1 - .../render/mayaToHydra/cpp/testUsdNativeInstancePicking.py | 4 +--- .../render/mayaToHydra/cpp/testUsdStageLayerMuting.py | 1 - .../cpp/testWireframeSelectionHighlightSceneIndex.py | 2 -- test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py | 7 ------- .../mayaUsd/render/mayaToHydra/testMaterialXOnNative.py | 1 - .../lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py | 5 ----- test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py | 3 --- .../mayaUsd/render/mayaToHydra/testNewSceneWithStage.py | 2 -- test/lib/mayaUsd/render/mayaToHydra/testRefinement.py | 4 +--- test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py | 5 ----- .../render/mayaToHydra/testStagePayloadsReferences.py | 1 - test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py | 2 -- test/lib/mayaUsd/render/mayaToHydra/testTransforms.py | 2 -- test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py | 1 - 25 files changed, 2 insertions(+), 50 deletions(-) diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py index c92c159dcd..43424b45a2 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testMayaUsdUfeItems.py @@ -16,7 +16,6 @@ import fixturesUtils import mtohUtils -import unittest from testUtils import PluginLoaded diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py index 5ae42a2364..d7c0ac817c 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPathInterface.py @@ -23,8 +23,6 @@ from testUtils import PluginLoaded -import unittest - class TestPathInterface(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py index 6691bb8586..0d66f58808 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPicking.py @@ -16,7 +16,6 @@ import fixturesUtils import mayaUtils import mtohUtils -import unittest from testUtils import PluginLoaded diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py index cb1d2c8b37..7021cc6a11 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPointInstancePicking.py @@ -15,7 +15,6 @@ import maya.cmds as cmds import fixturesUtils import mtohUtils -import unittest import usdUtils import testUtils diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py index fa79f81352..321093fb31 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testPrimInstancing.py @@ -16,7 +16,6 @@ import fixturesUtils import mtohUtils -import unittest import testUtils from testUtils import PluginLoaded diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py index 1a1593e704..7284cfecf6 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testSceneCorrectness.py @@ -16,7 +16,6 @@ import fixturesUtils import mtohUtils -import unittest import testUtils from testUtils import PluginLoaded diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdNativeInstancePicking.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdNativeInstancePicking.py index aa1e2d1677..77eb979385 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdNativeInstancePicking.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdNativeInstancePicking.py @@ -15,13 +15,12 @@ import maya.cmds as cmds import fixturesUtils import mtohUtils -import unittest import usdUtils import testUtils from testUtils import PluginLoaded -class TestUsdNativeInstancePicking(mtohUtils.MtohTestCase): +class TestUsdNativeInstancePicking(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ @@ -36,7 +35,6 @@ def setUp(self): self.loadUsdScene() cmds.refresh() - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_NativeInstances(self): with PluginLoaded('mayaHydraCppTests'): instances = ["/cubes_1", "/cubes_2"] diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py index 6b131b23d2..e2d92cca01 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testUsdStageLayerMuting.py @@ -16,7 +16,6 @@ import fixturesUtils import mtohUtils -import unittest from testUtils import PluginLoaded diff --git a/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py b/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py index 6dabde2fbf..d92c1532d7 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py +++ b/test/lib/mayaUsd/render/mayaToHydra/cpp/testWireframeSelectionHighlightSceneIndex.py @@ -4,8 +4,6 @@ import mayaUtils from testUtils import PluginLoaded -import unittest - class TestWireframeSelectionHighlightSceneIndex(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py index c41841b57d..b13e984d7e 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testArnoldLights.py @@ -18,7 +18,6 @@ import fixturesUtils import mtohUtils import mayaUtils -import unittest import platform class TestArnoldLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose diff --git a/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py b/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py index 6c0144cc5a..52f2a6fe74 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testImageDiffing.py @@ -12,13 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os.path -import sys -import unittest - -import maya.cmds as cmds -import maya.mel - import fixturesUtils import mtohUtils diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py index 6cf3cbc741..31605cf430 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMaterialXOnNative.py @@ -16,7 +16,6 @@ import mayaUtils import fixturesUtils import mtohUtils -import unittest class TestMaterialXOnNative(mtohUtils.MayaHydraBaseTestCase): _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py index a718e64f62..fea6b8f85a 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaDisplayModes.py @@ -18,7 +18,6 @@ import fixturesUtils import mtohUtils import mayaUtils -import unittest from testUtils import PluginLoaded import platform diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py index 8ae3414488..b7954f0de3 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaLights.py @@ -18,7 +18,6 @@ import fixturesUtils import mtohUtils import mayaUtils -import unittest import platform diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py b/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py index 5391ea36a7..23148e37f9 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMayaUsdAPIUsage.py @@ -17,7 +17,6 @@ import maya.cmds as cmds import fixturesUtils import mtohUtils -import unittest import mayaUtils import platform diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py b/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py index bc44c872a9..7b974d9d14 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMtohBasicRender.py @@ -14,11 +14,6 @@ # limitations under the License. # # Test to make sure that our snapshot-comparison tools work - -import os.path -import sys -import unittest - import maya.cmds as cmds import maya.mel diff --git a/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py b/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py index 1eee9cac3d..838b807170 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testMtohDagChanges.py @@ -13,9 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import sys -import unittest - import maya.cmds as cmds import maya.mel diff --git a/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py b/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py index a5de691b79..7bb6d2d8ea 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testNewSceneWithStage.py @@ -17,8 +17,6 @@ import fixturesUtils import mtohUtils -import unittest - class TestStage(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testRefinement.py b/test/lib/mayaUsd/render/mayaToHydra/testRefinement.py index 6817cd65a2..61361436fa 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testRefinement.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testRefinement.py @@ -16,10 +16,9 @@ import fixturesUtils import mtohUtils -import unittest import testUtils -class TestRefinement(mtohUtils.MtohTestCase): +class TestRefinement(mtohUtils.MayaHydraBaseTestCase): _file = __file__ IMAGEDIFF_FAIL_THRESHOLD = 0.01 @@ -31,7 +30,6 @@ def verifySnapshot(self, imageName): self.IMAGEDIFF_FAIL_THRESHOLD, self.IMAGEDIFF_FAIL_PERCENT) - @unittest.skipUnless(mtohUtils.checkForMayaUsdPlugin(), "Requires Maya USD Plugin.") def test_usdPrim(self): import usdUtils usdScenePath = testUtils.getTestScene('testStagePayloadsReferences', 'cube.usda') diff --git a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py index f5d78a9841..bfcd1cba04 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testSceneBrowser.py @@ -13,7 +13,6 @@ # limitations under the License. # import maya.cmds as cmds -import maya.mel as mel import fixturesUtils import mtohUtils diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py b/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py index c13e226822..11eba7990a 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStageAddPrim.py @@ -16,11 +16,6 @@ import fixturesUtils import mtohUtils -import mayaUtils -from testUtils import PluginLoaded - -import unittest -import sys class TestStage(mtohUtils.MayaHydraBaseTestCase): # MayaHydraBaseTestCase.setUpClass requirement. diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py b/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py index e0707b1d84..504ac064ea 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStagePayloadsReferences.py @@ -17,7 +17,6 @@ import maya.cmds as cmds import fixturesUtils import mtohUtils -import unittest import testUtils import mayaUtils import ufe diff --git a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py index 0578431c25..1b97fcd4ea 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testStageVariants.py @@ -17,8 +17,6 @@ import maya.cmds as cmds import fixturesUtils import mtohUtils -import unittest -import testUtils import mayaUtils import ufe diff --git a/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py b/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py index 15a7ad6e53..70f27b2d6a 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testTransforms.py @@ -13,11 +13,9 @@ # limitations under the License. # import maya.cmds as cmds -import maya.mel import fixturesUtils import mtohUtils -import unittest class TestTransforms(mtohUtils.MayaHydraBaseTestCase): _file = __file__ diff --git a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py index 4ef9408897..fc78af534c 100644 --- a/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py +++ b/test/lib/mayaUsd/render/mayaToHydra/testUSDLights.py @@ -18,7 +18,6 @@ import fixturesUtils import mtohUtils import mayaUtils -import unittest import platform class TestUSDLights(mtohUtils.MayaHydraBaseTestCase): #Subclassing mtohUtils.MayaHydraBaseTestCase to be able to call self.assertSnapshotClose