From bf6ddf6c708aae6f0b932b6378beecbbfd2b8b6f Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Thu, 3 Sep 2020 11:48:25 -0700 Subject: [PATCH] remove pxr dependencies from pxrUsdMayaGL tests --- .../ProxyShapeDrawLightingTest.ma | 6 +-- .../ProxyShapeDrawPurposeTest.ma | 8 ++-- .../blank.usda | 0 .../plane0.usda | 0 .../plane1.usda | 0 .../render/pxrUsdMayaGL/testPxrUsdMayaGL.py | 37 ++++++++++++------- 6 files changed, 32 insertions(+), 19 deletions(-) rename test/lib/mayaUsd/render/pxrUsdMayaGL/{PxrUsdMayaGL => PxrUsdMayaGLTest}/blank.usda (100%) rename test/lib/mayaUsd/render/pxrUsdMayaGL/{PxrUsdMayaGL => PxrUsdMayaGLTest}/plane0.usda (100%) rename test/lib/mayaUsd/render/pxrUsdMayaGL/{PxrUsdMayaGL => PxrUsdMayaGLTest}/plane1.usda (100%) diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawLightingTest/ProxyShapeDrawLightingTest.ma b/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawLightingTest/ProxyShapeDrawLightingTest.ma index 2dbb0a8dc0..1777b216b1 100644 --- a/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawLightingTest/ProxyShapeDrawLightingTest.ma +++ b/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawLightingTest/ProxyShapeDrawLightingTest.ma @@ -3,7 +3,7 @@ //Last modified: Wed, Jul 25, 2018 10:38:54 AM //Codeset: UTF-8 requires maya "2016"; -requires -nodeType "pxrUsdProxyShape" -dataType "pxrUsdStageData" "pxrUsd" "1.0"; +requires -nodeType "mayaUsdProxyShape" "mayaUsdPlugin" "1.0"; requires "stereoCamera" "10.0"; currentUnit -l centimeter -a degree -t film; fileInfo "application" "maya"; @@ -111,7 +111,7 @@ createNode transform -n "Hydra" -p "ProxyShapeDrawLightingTest"; createNode transform -n "Torus" -p "Hydra"; rename -uid "2DAE0900-0000-511C-5AD9-371B00000265"; setAttr ".t" -type "double3" 0 0 0.1 ; -createNode pxrUsdProxyShape -n "TorusShape" -p "|ProxyShapeDrawLightingTest|Hydra|Torus"; +createNode mayaUsdProxyShape -n "TorusShape" -p "|ProxyShapeDrawLightingTest|Hydra|Torus"; rename -uid "2DAE0900-0000-511C-5AD9-371B00000264"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; @@ -120,7 +120,7 @@ createNode pxrUsdProxyShape -n "TorusShape" -p "|ProxyShapeDrawLightingTest|Hydr createNode transform -n "Plane" -p "Hydra"; rename -uid "2DAE0900-0000-511C-5AD9-371B00000267"; setAttr ".t" -type "double3" 0 0 0.1 ; -createNode pxrUsdProxyShape -n "PlaneShape" -p "|ProxyShapeDrawLightingTest|Hydra|Plane"; +createNode mayaUsdProxyShape -n "PlaneShape" -p "|ProxyShapeDrawLightingTest|Hydra|Plane"; rename -uid "2DAE0900-0000-511C-5AD9-371B00000266"; setAttr -k off ".v"; setAttr ".covm[0]" 0 1 1; diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawPurposeTest/ProxyShapeDrawPurposeTest.ma b/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawPurposeTest/ProxyShapeDrawPurposeTest.ma index 33608a54e2..c45aef22fd 100644 --- a/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawPurposeTest/ProxyShapeDrawPurposeTest.ma +++ b/test/lib/mayaUsd/render/pxrUsdMayaGL/ProxyShapeDrawPurposeTest/ProxyShapeDrawPurposeTest.ma @@ -3,7 +3,7 @@ //Last modified: Fri, Mar 30, 2018 05:50:15 PM //Codeset: UTF-8 requires maya "2016"; -requires -nodeType "pxrUsdProxyShape" -dataType "pxrUsdStageData" "pxrUsd" "1.0"; +requires -nodeType "mayaUsdProxyShape" "mayaUsdPlugin" "1.0"; currentUnit -l centimeter -a degree -t film; fileInfo "application" "maya"; fileInfo "product" "Maya 2016"; @@ -75,9 +75,11 @@ createNode transform -n "ProxyShapeDrawPurposeTest"; rename -uid "F117D900-0000-12C3-5ABE-DA5000000253"; createNode transform -n "PurposeCubesProxy" -p "ProxyShapeDrawPurposeTest"; rename -uid "F117D900-0000-12C3-5ABE-DA4C00000252"; -createNode pxrUsdProxyShape -n "PurposeCubesProxyShape" -p "PurposeCubesProxy"; +createNode mayaUsdProxyShape -n "PurposeCubesProxyShape" -p "PurposeCubesProxy"; rename -uid "F117D900-0000-12C3-5ABE-DA180000024E"; - setAttr ".isc" yes; + setAttr -k off ".v"; + setAttr ".covm[0]" 0 1 1; + setAttr ".cdvm[0]" 0 1 1; setAttr ".fp" -type "string" "./PurposeCubes.usda"; setAttr ".pp" -type "string" "/PurposeCubes"; createNode transform -n "MainCamera"; diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/blank.usda b/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/blank.usda similarity index 100% rename from test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/blank.usda rename to test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/blank.usda diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/plane0.usda b/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/plane0.usda similarity index 100% rename from test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/plane0.usda rename to test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/plane0.usda diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/plane1.usda b/test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/plane1.usda similarity index 100% rename from test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGL/plane1.usda rename to test/lib/mayaUsd/render/pxrUsdMayaGL/PxrUsdMayaGLTest/plane1.usda diff --git a/test/lib/mayaUsd/render/pxrUsdMayaGL/testPxrUsdMayaGL.py b/test/lib/mayaUsd/render/pxrUsdMayaGL/testPxrUsdMayaGL.py index 410ff511d9..1e832ff70e 100644 --- a/test/lib/mayaUsd/render/pxrUsdMayaGL/testPxrUsdMayaGL.py +++ b/test/lib/mayaUsd/render/pxrUsdMayaGL/testPxrUsdMayaGL.py @@ -14,41 +14,52 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +from maya import cmds + import os import sys import unittest -from pxr import Usd - -from maya import cmds class testPxrUsdMayaGL(unittest.TestCase): + @classmethod def setUpClass(cls): - cmds.loadPlugin('pxrUsd') + # The test USD data is authored Z-up, so make sure Maya is configured + # that way too. + cmds.upAxis(axis='z') + + cmds.loadPlugin('mayaUsdPlugin') + + cls._testName = 'PxrUsdMayaGLTest' + cls._inputDir = os.path.abspath(cls._testName) def testEmptySceneDraws(self): cmds.file(new=True, force=True) - usdFilePath = os.path.abspath(os.path.join('PxrUsdMayaGL', 'blank.usda')) - assembly = cmds.assembly(name='blank', type='pxrUsdReferenceAssembly') - cmds.setAttr("%s.filePath" % assembly, usdFilePath, type='string') - cmds.assembly(assembly, edit=True, active='Collapsed') + + usdFilePath = os.path.join(self._inputDir, 'blank.usda') + proxyShape = cmds.createNode('mayaUsdProxyShape', name='blank') + cmds.setAttr("%s.filePath" % proxyShape, usdFilePath, type='string') + cmds.refresh() def testSimpleSceneDrawsAndReloads(self): # a memory issue would sometimes cause maya to crash when opening a new - # scene. + # scene. for _ in range(20): cmds.file(new=True, force=True) + for i in range(10): - usdFilePath = os.path.abspath(os.path.join('PxrUsdMayaGL', 'plane%d.usda' % (i%2))) - assembly = cmds.assembly(name='plane', type='pxrUsdReferenceAssembly') - cmds.setAttr("%s.filePath" % assembly, usdFilePath, type='string') - cmds.assembly(assembly, edit=True, active='Collapsed') + usdFilePath = os.path.join(self._inputDir, 'plane%d.usda' % (i%2)) + proxyShape = cmds.createNode('mayaUsdProxyShape', name='plane') + cmds.setAttr("%s.filePath" % proxyShape, usdFilePath, type='string') + cmds.refresh() cmds.file(new=True, force=True) + if __name__ == '__main__': suite = unittest.TestLoader().loadTestsFromTestCase(testPxrUsdMayaGL) results = unittest.TextTestRunner(stream=sys.stdout).run(suite)