Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove pxr dependencies from pxrUsdMayaGL tests #762

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down
37 changes: 24 additions & 13 deletions test/lib/mayaUsd/render/pxrUsdMayaGL/testPxrUsdMayaGL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down