-
Notifications
You must be signed in to change notification settings - Fork 202
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
migrate more pxrUsdMayaGL tests from plugin/pxr/... to test/... #761
migrate more pxrUsdMayaGL tests from plugin/pxr/... to test/... #761
Conversation
…s testProxyShapeRendererSceneMessages Usage of Pixar's USD reference assembly and proxy shape were removed in favor of using just mayaUsdProxyShape nodes.
…st/lib/mayaUsd/render/pxrUsdMayaGL/...
…/mayaUsd/render/pxrUsdMayaGL/...
…t/lib/mayaUsd/render/pxrUsdMayaGL/...
…. to test/lib/mayaUsd/render/pxrUsdMayaGL/...
…est/lib/mayaUsd/render/pxrUsdMayaGL/... Note that because making variant set selections from Maya is not supported until later versions of UFE (i.e. not in Maya 2019), the proxy shape was set to reference a USD file that makes the shading variant set selection.
…/lib/mayaUsd/render/pxrUsdMayaGL/... Note that because making variant set selections from Maya is not supported until later versions of UFE (i.e. not in Maya 2019), the proxy shapes were set to reference USD files that makes the shading variant set selections.
…b/mayaUsd/render/pxrUsdMayaGL/...
…t/lib/mayaUsd/render/pxrUsdMayaGL/...
…o test/lib/mayaUsd/render/pxrUsdMayaGL/...
…o test/lib/mayaUsd/render/pxrUsdMayaGL/...
def _LoadAssemblies(self): | ||
loadStartTime = cmds.timerX() | ||
|
||
UsdMaya.LoadReferenceAssemblies() | ||
|
||
loadElapsedTime = cmds.timerX(startTime=loadStartTime) | ||
|
||
Tf.Status("Load Elapsed Time: %f" % loadElapsedTime) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No assemblies anymore, so assembly-related code was removed.
@classmethod | ||
def setUpClass(cls): | ||
# The test USD data is authored Z-up, so make sure Maya is configured | ||
# that way too. | ||
cmds.upAxis(axis='z') | ||
|
||
cmds.loadPlugin('pxrUsd') | ||
cmds.loadPlugin('mayaUsdPlugin') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still explicitly load mayaUsdPlugin
here because the Maya scene doesn't have a requires
line for it, and because we use mayaUSDExport()
and mayaUSDImport()
below.
@@ -15,10 +15,6 @@ | |||
# limitations under the License. | |||
# | |||
|
|||
from future.utils import iteritems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dropped this from all of the tests to remove this dependency.
for profileScopeName, elapsedTime in iteritems(cls._profileScopeMetrics): | ||
for profileScopeName in cls._profileScopeMetrics.keys(): | ||
elapsedTime = cls._profileScopeMetrics[profileScopeName] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty straightforward tweak to remove iteritems
.
statsOutput = '\n'.join(statsOutputLines) | ||
perfStatsFilePath = '%s/perfStats.raw' % cls._testDir | ||
statsOutput = os.linesep.join(statsOutputLines) | ||
perfStatsFilePath = os.path.join(cls._testDir, 'perfStats.raw') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few other tweaks like these to make sure all platforms are supported.
def testUsdChangeProcessingAssembly(self): | ||
""" | ||
Tests that authoring on a USD stage that is referenced by an assembly | ||
node (in "Collapsed" representation with a proxy shape underneath) | ||
invokes drawing refreshes in Maya correctly. | ||
""" | ||
self._testName = 'UsdChangeProcessingTest_Assembly' | ||
|
||
mayaSceneFile = '%s.ma' % self._testName | ||
mayaSceneFullPath = os.path.abspath(mayaSceneFile) | ||
cmds.file(mayaSceneFullPath, open=True, force=True) | ||
|
||
UsdMaya.LoadReferenceAssemblies() | ||
|
||
assemblyDagPathName = '|UsdChangeProcessingTest|Primitive' | ||
self._RunTest(assemblyDagPathName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assembly case was removed, so everything was collapsed from _RunTest()
into testUsdChangeProcessingProxy()
.
# Maya 2017 and later use PyQt5/PySide2 while Maya 2016 and earlier use | ||
# PyQt4/PySide. We test whether we're running in Maya 2017+ by trying to import | ||
# PySide2, which should only be available there. If that succeeds, we import | ||
# the rest of the modules from PySide2. Otherwise, we assume we're in 2016 or | ||
# earlier and we import everything from PySide. | ||
try: | ||
import PySide2 | ||
usePySide2 = True | ||
except ImportError: | ||
usePySide2 = False | ||
|
||
if usePySide2: | ||
from PySide2 import QtCore | ||
from PySide2.QtTest import QTest | ||
from PySide2.QtWidgets import QWidget | ||
|
||
from shiboken2 import wrapInstance | ||
else: | ||
from PySide import QtCore | ||
from PySide.QtTest import QTest | ||
from PySide.QtGui import QWidget | ||
|
||
from shiboken import wrapInstance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all the support for PySide, dropping Maya 2016 and earlier.
The pxrUsdReferenceAssembly workflow never really supported significant authoring on the root prim that is referenced by the assembly. This means that for the purposes of the testProxyShapeLiveSurface test, the existing authoring that attempts to translate the root prim is actually being ignored when the USD is referenced by a USD reference assembly or proxy shape. The test was authored taking that into account. However, that is only the case when using Pixar's batch renderer. This issue has been fixed when using UFE and the Viewport 2.0 render delegate. In that case, using the same Maya scene and USD, the referenced geometry ends up being transformed correctly, but differently as compared to the Pixar batch renderer. To keep the test results consistent (and correct) between the Pixar batch renderer and the VP2.0 render delegate, we simply remove the root prim xformOps. (Internal change: 2094559)
One small addition here with 17f789a. The Pixar batch renderer actually represents the USD in the |
…s.zip This removes usage of future.utils.iteritems from the usdMaya and translators tests to make it easier to test for currently released versions of Maya and Python 2. testUsdImportXforms required some additional surgery to remove the use of builtins.zip which may also not be available in certain installs of Python 2. Outside of this commit, there are three remaining pxrUsdMayaGL tests that still use future.utils.iteritems, but those are addressed in PR Autodesk#761 which migrates those tests from plugin/pxr/... to test/... Combining the changes here with those in Autodesk#761 removes all usage of the future Python module, so the instructions on how to install it were removed from build.md.
@@ -14,6 +14,7 @@ set(TEST_SCRIPT_FILES | |||
testProxyShapeDuplicatePerformance.py | |||
testProxyShapeLiveSurface.py | |||
testProxyShapeRendererSceneMessages.py | |||
testProxyShapeSelectionPerformance.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a FYI, I noticed that both testProxyShapeLiveSurface and testProxyShapeSelectionPerformance fail on my Windows after syncing to the latest dev changes.
@kxl-adsk I believe you mentioned the same failure on your side. I don't think I notice these failures when I originally reviewed this PR but they show up now.
Requires more investigation.
98% tests passed, 2 tests failed out of 127
Label Time Summary:
interactive = 847.06 sec*proc (14 tests)
pxrUsdMayaGL = 847.06 sec*proc (14 tests)
translators = 643.22 sec*proc (52 tests)
ufe = 264.30 sec*proc (21 tests)
usdPreviewSurface = 20.88 sec*proc (2 tests)
Total Test time (real) = 212.37 sec
The following tests FAILED:
15 - testProxyShapeLiveSurface (Failed)
17 - testProxyShapeSelectionPerformance (Failed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry about that @HamedSabri-adsk. They've been passing for me on Linux. I briefly had access to a Windows machine before we left the studio, but I've since lost that. :/
Do you have any logs handy from failed runs of either of those tests? And I assume all of the other pxrUsdMayaGL
tests are passing?
Just a wild guess without any more detail for the moment, but the one thing common to these two tests and absent from all the others is the shenanigans they pull dealing with PySide2 and shiboken2 so that they can emulate clicking in the viewports. Maybe there's something there that's problematic on Windows?
Let me know what I can do to help get to the bottom of that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I saw these when validating your change @mattyjams and before merging. I was confused because @HamedSabri-adsk run the tests and they were passing. The explanation I found is that we can be using builds of Maya with asserts enabled. When we do, these tests will cause Maya to assert when the application is exiting. This then causes the test to fail. You won't get it with the official build of Maya.
The assert seems to be complaining that there are still some shared GL widgets alive when we are releasing resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…performance tests This is an attempt to drop all handles the testProxyShapeLiveSurface and testProxyShapeSelectionPerformance tests are holding to UI and viewport elements in hopes that their resources can be fully freed when Maya exits. This was raised as an issue in PR Autodesk#761 with debug builds of Maya that assert when resources are not freed at exit.
These commits move a whole bunch more interactive tests previously in the
plugin/pxr/...
area over to the project-leveltest/...
area.All of the tests were "sanitized" to remove usage of the
pxrUsd
plugin and thepxrUsdProxyShape
andpxrUsdReferenceAssembly
nodes. They are now all authored in terms of themayaUsdPlugin
andmayaUsdProxyShape
.I realized that I forgot to do this sanitization in #741, so I'll put up a separate PR that cleans up
testProxyShapeDrawLighting
andtestProxyShapeDrawPurpose
.One thing to note about
testProxyShapeDrawColorAccuracy
andtestProxyShapeDrawVisibility
: These tests previously took advantage of the feature withpxrUsdProxyShape
to set variants directly on the proxy shape. This doesn't exist onmayaUsdProxyShape
, since the expectation is that you would make those selections directly in USD through UFE. For those two, I added a new "wrapper" USD file that makes the shadingVariant selection and pointed the proxies at those instead of the originals.Sorry this ended up being fairly large, but it's mostly just file moves. Each test was migrated in its own commit. There were touch-ups to the Python test scripts, and then probably the bulk of the actual diffs are in the Maya scenes where I had to replace
pxrUsdProxyShape
withmayaUsdProxyShape
.