diff --git a/test/lib/usd/translators/testUsdMayaAdaptor.py b/test/lib/usd/translators/testUsdMayaAdaptor.py index 6ca9bedc72..bafb31f227 100644 --- a/test/lib/usd/translators/testUsdMayaAdaptor.py +++ b/test/lib/usd/translators/testUsdMayaAdaptor.py @@ -27,6 +27,8 @@ import unittest +import fixturesUtils + class testUsdMayaAdaptor(unittest.TestCase): @classmethod @@ -35,7 +37,7 @@ def setUpClass(cls): # We are testing that the Plug-based lookup mechanism correctly # identifies and loads the necessary libraries when a schema adapter is # requested. - standalone.initialize('usd') + cls.inputPath = fixturesUtils.setUpClass(__file__, loadPlugin=False) @classmethod def tearDownClass(cls): diff --git a/test/lib/usd/translators/testUsdMayaAdaptorGeom.py b/test/lib/usd/translators/testUsdMayaAdaptorGeom.py index 8c08152033..ed0f6fedc4 100644 --- a/test/lib/usd/translators/testUsdMayaAdaptorGeom.py +++ b/test/lib/usd/translators/testUsdMayaAdaptorGeom.py @@ -24,6 +24,8 @@ import os import unittest +import fixturesUtils + class testUsdMayaAdaptorGeom(unittest.TestCase): @@ -33,10 +35,10 @@ def tearDownClass(cls): @classmethod def setUpClass(cls): - standalone.initialize('usd') - cmds.loadPlugin('pxrUsd') + cls.inputPath = fixturesUtils.setUpClass(__file__) - usdFile = os.path.abspath('UsdAttrs.usda') + usdFile = os.path.join(cls.inputPath, 'UsdMayaAdaptorGeomTest', + 'UsdAttrs.usda') cmds.usdImport(file=usdFile, shadingMode='none') def testImportImageable(self): diff --git a/test/lib/usd/translators/testUsdMayaAdaptorMetadata.py b/test/lib/usd/translators/testUsdMayaAdaptorMetadata.py index a140809879..d317664773 100644 --- a/test/lib/usd/translators/testUsdMayaAdaptorMetadata.py +++ b/test/lib/usd/translators/testUsdMayaAdaptorMetadata.py @@ -26,6 +26,8 @@ import os import unittest +import fixturesUtils + class testUsdMayaAdaptorMetadata(unittest.TestCase): @@ -35,8 +37,10 @@ def tearDownClass(cls): @classmethod def setUpClass(cls): - standalone.initialize('usd') - cmds.loadPlugin('pxrUsd') + cls.inputPath = fixturesUtils.setUpClass(__file__) + + cls.inputUsdFile = os.path.join(cls.inputPath, + 'UsdMayaAdaptorMetadataTest', 'UsdAttrs.usda') def testImport_HiddenInstanceableKind(self): """ @@ -44,8 +48,7 @@ def testImport_HiddenInstanceableKind(self): hidden, instanceable, and kind metadata properly. """ cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none') + cmds.usdImport(file=self.inputUsdFile, shadingMode='none') # pCube1 and pCube2 have USD_kind. self.assertEqual(cmds.getAttr('pCube1.USD_kind'), 'potato') @@ -74,8 +77,7 @@ def testImport_HiddenInstanceableKind(self): def testImport_HiddenInstanceable(self): """Tests import with only hidden, instanceable metadata and not kind.""" cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none', + cmds.usdImport(file=self.inputUsdFile, shadingMode='none', metadata=['hidden', 'instanceable']) # pCube1 and pCube2 have USD_kind, but that shouldn't be imported. @@ -97,8 +99,7 @@ def testImport_HiddenInstanceable(self): def testImport_TypeName(self): """Tests import with metadata=typeName manually specified.""" cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none', + cmds.usdImport(file=self.inputUsdFile, shadingMode='none', metadata=["typeName"]) # typeName metadata should come through. @@ -120,8 +121,7 @@ def testImport_TypeName(self): def testImport_GeomModelAPI(self): """Tests importing UsdGeomModelAPI attributes.""" cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none', + cmds.usdImport(file=self.inputUsdFile, shadingMode='none', apiSchema=['GeomModelAPI']) worldProxy = mayaUsdLib.Adaptor('World') @@ -154,8 +154,7 @@ def testExport(self): the correct metadata in the output USD file. """ cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none') + cmds.usdImport(file=self.inputUsdFile, shadingMode='none') newUsdFilePath = os.path.abspath('UsdAttrsNew.usda') cmds.usdExport(file=newUsdFilePath, shadingMode='none') @@ -185,8 +184,7 @@ def testExport(self): def testExport_GeomModelAPI(self): """Tests export with the GeomModelAPI.""" cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none', + cmds.usdImport(file=self.inputUsdFile, shadingMode='none', apiSchema=['GeomModelAPI']) newUsdFilePath = os.path.abspath('UsdAttrsNew_GeomModelAPI.usda') @@ -203,8 +201,7 @@ def testExport_GeomModelAPI(self): def testExport_GeomModelAPI_MotionAPI(self): """Tests export with both the GeomModelAPI and MotionAPI.""" cmds.file(new=True, force=True) - usdFile = os.path.abspath('UsdAttrs.usda') - cmds.usdImport(file=usdFile, shadingMode='none', + cmds.usdImport(file=self.inputUsdFile, shadingMode='none', apiSchema=['GeomModelAPI', 'MotionAPI']) newUsdFilePath = os.path.abspath('UsdAttrsNew_TwoAPIs.usda') diff --git a/test/lib/usd/translators/testUsdMayaAdaptorUndoRedo.py b/test/lib/usd/translators/testUsdMayaAdaptorUndoRedo.py index a4ab7c6122..30aaa33d50 100644 --- a/test/lib/usd/translators/testUsdMayaAdaptorUndoRedo.py +++ b/test/lib/usd/translators/testUsdMayaAdaptorUndoRedo.py @@ -24,16 +24,15 @@ import unittest +import fixturesUtils + class testUsdMayaAdaptorUndoRedo(unittest.TestCase): @classmethod def setUpClass(cls): - standalone.initialize('usd') - - # We load the pxrUsd plugin here to ensure that the usdUndoHelperCmd - # has been registered. See the documentation on UsdMayaAdaptor for more - # detail. - cmds.loadPlugin('pxrUsd') + # We load the plugin here to ensure that the usdUndoHelperCmd has been + # registered. See the documentation on UsdMayaAdaptor for more detail. + cls.inputPath = fixturesUtils.setUpClass(__file__, loadPlugin=True) @classmethod def tearDownClass(cls):