Exemplo n.º 1
0
    def setUpClass(cls):
        fixturesUtils.setUpClass(__file__)

        # Deprecated since version 3.2: assertRegexpMatches and assertRaisesRegexp
        # have been renamed to assertRegex() and assertRaisesRegex()
        if sys.version_info.major < 3 or sys.version_info.minor < 2:
            cls.assertRegex = cls.assertRegexpMatches
            cls.assertRaisesRegex = cls.assertRaisesRegexp
Exemplo n.º 2
0
 def setUpClass(cls):
     cls.input_dir = fixturesUtils.setUpClass(__file__)
     cls.temp_dir = os.path.abspath('.')
     cls.scene_path = os.path.join(cls.input_dir,
                                   "UsdExportBlendShapesTest",
                                   "blendShapesExport.ma").replace(
                                       "\\", "/")
Exemplo n.º 3
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        cls._clsTestName = 'UsdExportMayaInstancerTest'

        cls.mayaFile = os.path.join(inputPath, cls._clsTestName,
                                    "%s.ma" % cls._clsTestName)
    def setUpClass(cls):
        input_path = fixturesUtils.setUpClass(__file__)

        cls.test_dir = os.path.join(input_path,
                                    "UsdImportPreviewSurface")

        cmds.workspace(cls.test_dir, o=True)
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
            initializeStandalone=False, loadPlugin=False)

        cls._testDir = os.path.abspath('.')

        cls._testName = 'ProxyShapeDrawLightingTest'
        cls._testSceneName = '%s.ma' % cls._testName
        cls._testSceneFullPath = os.path.join(inputPath, cls._testName,
            cls._testSceneName)

        cls._nativeNodePathName = '|%s|Native' % cls._testName
        cls._nativeTorusPathName = '%s|Torus' % cls._nativeNodePathName
        cls._nativePlanePathName = '%s|Plane' % cls._nativeNodePathName

        cls._hydraNodePathName = '|%s|Hydra' % cls._testName
        cls._hydraTorusPathName = '%s|Torus' % cls._hydraNodePathName
        cls._hydraPlanePathName = '%s|Plane' % cls._hydraNodePathName

        cls._spotLightNameFormat = 'SpotLight_%d'
        cls._directionalLightNameFormat = 'DirectionalLight_%d'
        cls._numberOfLights = 4

        cls._cameraName = 'MainCamera'
Exemplo n.º 6
0
    def setUpClass(cls):
        cls.inputPath = fixturesUtils.setUpClass(__file__)
        cls.temp_dir = os.path.abspath('.')

        cls.meshTestFile = os.path.join(cls.inputPath, "UsdExportMeshTest",
                                        "UsdExportMeshTest.ma")
        cmds.file(cls.meshTestFile, force=True, open=True)
Exemplo n.º 7
0
    def setUpClass(cls):
        asFloat2 = mayaUsdLib.WriteUtil.WriteUVAsFloat2()
        suffix = ""
        if asFloat2:
            suffix += "Float"
        if mayaUsdLib.WriteUtil.WriteMap1AsST():
            suffix += "ST"

        inputPath = fixturesUtils.setUpClass(__file__, suffix)

        if asFloat2:
            filePath = os.path.join(inputPath, 'UsdExportUVSetsFloatTest',
                                    'UsdExportUVSetsTest_Float.ma')
        else:
            filePath = os.path.join(inputPath, 'UsdExportUVSetsTest',
                                    'UsdExportUVSetsTest.ma')

        cmds.file(filePath, open=True, force=True)

        # Make some live edits to the box with weird UVs for the
        # testExportUvVersusUvIndexFromIterator test.
        cmds.select("box.map[0:299]", r=True)
        cmds.polyEditUV(u=1.0, v=1.0)

        usdFilePath = os.path.abspath('UsdExportUVSetsTest.usda')
        cmds.usdExport(mergeTransformAndShape=True,
                       file=usdFilePath,
                       shadingMode='none',
                       exportColorSets=False,
                       exportDisplayColor=False,
                       exportUVs=True)

        cls._stage = Usd.Stage.Open(usdFilePath)
Exemplo n.º 8
0
    def setUpClass(cls):
        cls.input_dir = fixturesUtils.setUpClass(__file__)
        standalone.initialize('usd')

        cmds.workspace(os.path.join(cls.input_dir,
                                    "PxrUsdPreviewSurfaceExportTest"),
                       o=True)

        cmds.file('PxrUsdPreviewSurfaceExportTest.ma', open=True, force=True)

        defaultExtSetting = cmds.file(q=True, defaultExtensions=True)
        cmds.file(defaultExtensions=False)

        # Export to USD.
        usdFilePath = os.path.abspath('PxrUsdPreviewSurfaceExportTest.usda')

        cmds.loadPlugin('mayaUsdPlugin', quiet=True)
        cmds.file(usdFilePath,
                  force=True,
                  options="shadingMode=useRegistry;mergeTransformAndShape=1",
                  typ="USD Export",
                  pr=True,
                  ea=True)

        cmds.file(defaultExtensions=defaultExtSetting)

        cls.stage = Usd.Stage.Open(usdFilePath)
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        test_dir = os.path.join(inputPath,
                                "UsdExportImportRoundtripPreviewSurface")

        cmds.workspace(test_dir, o=True)
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        mayaSceneFilePath = os.path.join(inputPath, 'HdImagingShapeTest',
                                         'HdImagingShapeTest.ma')

        cmds.file(mayaSceneFilePath, open=True, force=True)
Exemplo n.º 11
0
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
                                             initializeStandalone=False,
                                             loadPlugin=False)

        cls._baselineDir = os.path.join(
            inputPath, 'VP2RenderDelegatePointInstancesPickModeTest',
            'baseline')

        cls._testDir = os.path.abspath('.')

        # Store the previous USD point instances pick mode and selection kind
        # (or None if unset) so we can restore the state later.
        cls._pointInstancesPickModeOptionVarName = mayaUsdLib.OptionVarTokens.PointInstancesPickMode
        cls._prevPointInstancesPickMode = cmds.optionVar(
            query=cls._pointInstancesPickModeOptionVarName) or None

        cls._selectionKindOptionVarName = mayaUsdLib.OptionVarTokens.SelectionKind
        cls._prevSelectionKind = cmds.optionVar(
            query=cls._selectionKindOptionVarName) or None

        mayaUtils.openPointInstancesGrid14Scene()
Exemplo n.º 12
0
 def setUpClass(cls):
     cls.input_dir = fixturesUtils.setUpClass(__file__)
     cls.temp_dir = os.path.abspath('.')
     cls.usd_file = os.path.join(cls.input_dir,
                                 "UsdImportFramerates/framerate.usda")
     cls.stage = Usd.Stage.Open(cls.usd_file)
     cls.base_rate = cls.stage.GetTimeCodesPerSecond()
Exemplo n.º 13
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        filePath = os.path.join(inputPath,
                                "UsdExportGeomSubsetTest",
                                "UsdExportGeomSubsetTest.ma")
        cmds.file(filePath, force=True, open=True)
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
            initializeStandalone=False, loadPlugin=False)

        cls._inputDir = os.path.join(inputPath,
            'ProxyShapeSelectionPerformanceTest')

        cls._testDir = os.path.abspath('.')

        cls._profileScopeMetrics = dict()

        cls._cameraName = 'SelectionCamera'

        # These are the dimensions we want for the viewport we're drawing into.
        cls._viewportWidth = 960
        cls._viewportHeight = 540

        # To get those viewport dimensions, we add padding to the window size
        # to account for the window frame and toolbar.
        cls._viewWindowWidth = cls._viewportWidth + 4
        cls._viewWindowHeight = cls._viewportHeight + 23

        # Store the previous USD selection kind (or None if there wasn't one)
        # so we can restore the state later.
        cls._selKindOptionVarName = mayaUsdLib.OptionVarTokens.SelectionKind
        cls._prevSelKind = cmds.optionVar(query=cls._selKindOptionVarName) or None

        # Set the USD selection kind to "assembly" so that we select entire
        # "assets" during the test.
        cmds.optionVar(stringValue=(cls._selKindOptionVarName, 'assembly'))
Exemplo n.º 15
0
    def setUpClass(cls):
        input_path = fixturesUtils.setUpClass(__file__)

        cls.test_dir = os.path.join(input_path,
                                    "UsdImportDisplacementTest")

        cmds.workspace(cls.test_dir, o=True)
Exemplo n.º 16
0
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
                                             initializeStandalone=False,
                                             loadPlugin=False)

        cls._baselineDir = os.path.join(
            inputPath, 'VP2RenderDelegatePointInstanceSelectionTest',
            'baseline')

        cls._testDir = os.path.abspath('.')

        # Store the previous USD point instances pick mode and selection kind
        # (or None if unset) so we can restore the state later.
        cls._pointInstancesPickModeOptionVarName = mayaUsdLib.OptionVarTokens.PointInstancesPickMode
        cls._prevPointInstancesPickMode = cmds.optionVar(
            query=cls._pointInstancesPickModeOptionVarName) or None

        cls._selectionKindOptionVarName = mayaUsdLib.OptionVarTokens.SelectionKind
        cls._prevSelectionKind = cmds.optionVar(
            query=cls._selectionKindOptionVarName) or None

        # Set the USD point instances pick mode to "Instances" so that we pick
        # individual point instances during the test.
        cmds.optionVar(stringValue=(cls._pointInstancesPickModeOptionVarName,
                                    'Instances'))

        # Clear any setting for selection kind.
        cmds.optionVar(remove=cls._selectionKindOptionVarName)
Exemplo n.º 17
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__,
            initializeStandalone=False, loadPlugin=False)

        cls._baselineDir = os.path.join(inputPath,
            'VP2RenderDelegateInteractiveWorkflowsTest', 'baseline')

        cls._testDir = os.path.abspath('.')
    def setUpClass(cls):
        cls.inputPath = fixturesUtils.setUpClass(__file__)

        usdFile = os.path.join(cls.inputPath, 'UsdMayaAdaptorGeomTest',
                               'UsdAttrs.usda')
        cmds.usdImport(file=usdFile, shadingMode=[
            ["none", "default"],
        ])
Exemplo n.º 19
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        srcFile = os.path.join(inputPath, "UsdExportOverImportTest", "CubeModel.usda")

        # Copy source file to working directory, as we'll be overwriting it.
        shutil.copy(srcFile, os.getcwd())

        cls.USD_FILE = os.path.join(os.getcwd(), 'CubeModel.usda')
 def setUpClass(cls):
     inputPath = fixturesUtils.setUpClass(__file__,
                                          initializeStandalone=False,
                                          loadPlugin=False)
     cls._baselineDir = os.path.join(inputPath,
                                     'VP2RenderDelegatePrimPathTest',
                                     'baseline')
     cls._testDir = os.path.abspath('.')
     cmds.loadPlugin('mayaUsdPlugin')
     mel.eval('mayaUsdLayerEditorWindow mayaUsdLayerEditor')
Exemplo n.º 21
0
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
            initializeStandalone=False, loadPlugin=False)

        cls._testName = 'ProxyShapeRendererSceneMessagesTest'
        cls._inputDir = os.path.join(inputPath, cls._testName)
    def setUpClass(cls):
        # In case tests are run in parallel, make sure we export to separate
        # directories:
        plugin_path = os.getenv("@PXR_OVERRIDE_PLUGINPATH_NAME@")
        maya_path = [
            i for i in plugin_path.split(os.pathsep) if i.endswith("Maya")
        ]
        if maya_path:
            suffix = "Maya"
        else:
            suffix = "USD"

        fixturesUtils.setUpClass(__file__, suffix)

        cls.input_path = os.path.abspath(os.getenv("INPUT_PATH"))

        test_dir = os.path.join(cls.input_path, "UsdExportCustomConverterTest")

        cmds.workspace(test_dir, o=True)
    def setUpClass(cls):
        input_path = fixturesUtils.setUpClass(
            __file__, initializeStandalone=False, loadPlugin=False
        )

        cls._baseline_dir = os.path.join(
            input_path, "VP2RenderDelegateUSDPreviewSurface", "baseline"
        )

        cls._test_dir = os.path.abspath(".")
Exemplo n.º 24
0
    def setUpClass(cls):
        cls.input_path = fixturesUtils.setUpClass(__file__)

        cls.test_dir = os.path.join(cls.input_path,
                                    "UsdImportCustomConverterTest")

        cls.usd_path = os.path.join(cls.test_dir,
                                    'UsdImportCustomConverterTest.usda')

        cmds.workspace(cls.test_dir, o=True)
Exemplo n.º 25
0
    def setUpClass(cls):
        cls.inputPath = fixturesUtils.setUpClass(__file__)

        typeName = Usd.SchemaRegistry.GetTypeFromSchemaTypeName(
            "CustomRig").typeName

        mayaUsdLib.PrimReader.Register(customRigPrimReader, typeName)
        mayaUsdLib.PrimUpdater.Register(
            customRigPrimUpdater, typeName, "transform",
            customRigPrimUpdater.Supports.All.value +
            customRigPrimUpdater.Supports.AutoPull.value)
Exemplo n.º 26
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        mayaFile = os.path.join(inputPath, 'UsdExportLightTest', 'UsdExportLightTest.ma')
        cmds.file(mayaFile, open=True, force=True)

        # Export to USD.
        cls._usdFilePath = os.path.abspath('UsdExportLightTest.usda')
        cmds.usdExport(mergeTransformAndShape=True, file=cls._usdFilePath,
            frameRange=(cls.START_TIMECODE, cls.END_TIMECODE))

        cls._stage = Usd.Stage.Open(cls._usdFilePath)
    def setUpClass(cls):
        # The test USD data is authored Z-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='z')

        inputPath = fixturesUtils.setUpClass(__file__,
            initializeStandalone=False)

        cls._testName = 'ProxyShapeDrawColorsTest'
        cls._inputDir = os.path.join(inputPath, cls._testName)

        cls._testDir = os.path.abspath('.')
    def setUpClass(cls):
        # The test USD data is authored Y-up, so make sure Maya is configured
        # that way too.
        cmds.upAxis(axis='y')

        inputPath = fixturesUtils.setUpClass(__file__,
                                             initializeStandalone=False,
                                             loadPlugin=False)
        cls._baselineDir = os.path.join(inputPath,
                                        'VP2RenderDelegatePrimPathTest',
                                        'baseline')
        cls._testDir = os.path.abspath('.')
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        mayaFile = os.path.join(inputPath, "UsdExportShadingModePxrRis", "MarbleCube.ma")
        cmds.file(mayaFile, force=True, open=True)

        # Export to USD.
        usdFilePath = os.path.abspath('MarbleCube.usda')
        cmds.usdExport(mergeTransformAndShape=True, file=usdFilePath,
            shadingMode='pxrRis', materialsScopeName='Materials')

        cls._stage = Usd.Stage.Open(usdFilePath)
Exemplo n.º 30
0
    def setUpClass(cls):
        inputPath = fixturesUtils.setUpClass(__file__)

        filePath = os.path.join(inputPath, "UsdExportLocatorTest", "SingleLocator.ma")
        cmds.file(filePath, force=True, open=True)

        cls._singleLocatorUsdFilePathMerged = os.path.abspath(
            'SingleLocator_MERGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathMerged,
            mergeTransformAndShape=True, shadingMode="none")

        cls._singleLocatorUsdFilePathUnmerged = os.path.abspath(
            'SingleLocator_UNMERGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathUnmerged,
            mergeTransformAndShape=False, shadingMode="none")

        cls._singleLocatorUsdFilePathMergedRanged = os.path.abspath(
            'SingleLocator_MERGED_RANGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathMergedRanged,
            mergeTransformAndShape=True, shadingMode="none",
            frameRange=(1, 1))

        cls._singleLocatorUsdFilePathUnmergedRanged = os.path.abspath(
            'SingleLocator_UNMERGED_RANGED.usda')
        cmds.usdExport(file=cls._singleLocatorUsdFilePathUnmergedRanged,
            mergeTransformAndShape=False, shadingMode="none",
            frameRange=(1, 1))

        filePath = os.path.join(inputPath, "UsdExportLocatorTest", "CubeUnderLocator.ma")
        cmds.file(filePath, force=True, open=True)

        cls._locatorParentUsdFilePathMerged = os.path.abspath(
            'CubeUnderLocator_MERGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathMerged,
            mergeTransformAndShape=True, shadingMode="none")

        cls._locatorParentUsdFilePathUnmerged = os.path.abspath(
            'CubeUnderLocator_UNMERGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathUnmerged,
            mergeTransformAndShape=False, shadingMode="none")

        cls._locatorParentUsdFilePathMergedRanged = os.path.abspath(
            'CubeUnderLocator_MERGED_RANGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathMergedRanged,
            mergeTransformAndShape=True, shadingMode="none",
            frameRange=(1, 1))

        cls._locatorParentUsdFilePathUnmergedRanged = os.path.abspath(
            'CubeUnderLocator_UNMERGED_RANGED.usda')
        cmds.usdExport(file=cls._locatorParentUsdFilePathUnmergedRanged,
            mergeTransformAndShape=False, shadingMode="none",
            frameRange=(1, 1))