-
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
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri… #1189
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5ce3def
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 17f4d0f
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 7d7a32f
Merge branch 'dev_public' into spinell/MAYA-107276/ae_primpath
spinell-adsk 93574d5
Merge branch 'dev_public' into spinell/MAYA-107276/ae_primpath
spinell-adsk 5df68ca
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk f5aa78a
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 3e684d9
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 16d497d
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 7689335
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk 21d260f
MAYA-107276 - As a user, on the stage AE template I'd like to use Pri…
spinell-adsk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+7.26 KB
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.37 KB
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube1_moved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.8 KB
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.04 KB
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube2_moved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.47 KB
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.78 KB
...render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/Cube3_moved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.44 KB
...yaUsd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.93 KB
...Usd/render/vp2RenderDelegate/VP2RenderDelegatePrimPathTest/baseline/initial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions
101
test/lib/mayaUsd/render/vp2RenderDelegate/testVP2RenderDelegatePrimPath.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#!/usr/bin/env mayapy | ||
# | ||
# Copyright 2021 Autodesk | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
import fixturesUtils | ||
import imageUtils | ||
import mayaUtils | ||
import usdUtils | ||
|
||
from mayaUsd import lib as mayaUsdLib | ||
from mayaUsd import ufe as mayaUsdUfe | ||
|
||
from maya import cmds | ||
|
||
import ufe | ||
|
||
import os | ||
|
||
|
||
class testVP2RenderDelegatePrimPath(imageUtils.ImageDiffingTestCase): | ||
""" | ||
Tests imaging using the Viewport 2.0 render delegate when using a primPath. | ||
""" | ||
|
||
@classmethod | ||
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 assertSnapshotClose(self, imageName): | ||
baselineImage = os.path.join(self._baselineDir, imageName) | ||
snapshotImage = os.path.join(self._testDir, imageName) | ||
imageUtils.snapshot(snapshotImage, width=960, height=540) | ||
return self.assertImagesClose(baselineImage, snapshotImage) | ||
|
||
@staticmethod | ||
def _GetUfePath(name): | ||
mayaSegment = mayaUtils.createUfePathSegment('|stage1|stageShape1') | ||
usdSegmentString = mayaUsdUfe.usdPathToUfePathSegment(name, -1) | ||
usdSegment = usdUtils.createUfePathSegment(usdSegmentString) | ||
ufePath = ufe.Path([mayaSegment, usdSegment]) | ||
return ufePath | ||
|
||
@staticmethod | ||
def _GetSceneItem(name): | ||
ufePath = testVP2RenderDelegatePrimPath._GetUfePath(name) | ||
ufeItem = ufe.Hierarchy.createItem(ufePath) | ||
return ufeItem | ||
|
||
def testPrimPath(self): | ||
|
||
def testSinglePrim(primPath, imageName): | ||
cmds.setAttr( 'stageShape1.primPath', primPath, type="string") | ||
self.assertSnapshotClose('%s.png' % imageName) | ||
|
||
globalSelection = ufe.GlobalSelection.get() | ||
sceneItem = testVP2RenderDelegatePrimPath._GetSceneItem(primPath) | ||
globalSelection.append(sceneItem) | ||
|
||
cmds.move(-5,0,0, relative=True) | ||
self.assertSnapshotClose('%s_moved.png' % imageName) | ||
|
||
mayaUtils.openPrimPathScene() | ||
|
||
globalSelection = ufe.GlobalSelection.get() | ||
globalSelection.clear() | ||
self.assertSnapshotClose('initial.png') | ||
|
||
testSinglePrim("/Cube1", "Cube1") | ||
testSinglePrim("/Cube1/Cube2", "Cube2") | ||
testSinglePrim("/Cube1/Cube2/Cube3", "Cube3") | ||
|
||
cmds.setAttr( 'stageShape1.primPath', "", type="string") | ||
self.assertSnapshotClose('final.png') | ||
|
||
# Test with a invalid prime path | ||
# Nothing should change in the viewport | ||
cmds.setAttr( 'stageShape1.primPath', "/invalidPrim", type="string") | ||
self.assertSnapshotClose('final.png') | ||
|
||
|
||
if __name__ == '__main__': | ||
fixturesUtils.runTests(globals()) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Moved the dependency in subclass ProxyShape.
Having this dependency in proxyShapeBase cause issue when using a primPath with a stage that is created in memory.
When computing the inStageDataCachedAttr, when the stage is create in memory, a new stage is created and everything is lost.
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.
It's worth mentioning why this dependency doesn't belong to the base class - when computing inStageDataCachedAttr, there is nothing that reads primPathAttr unless we are calling into computeSessionLayer implementation of pxr proxy shape - https://github.com/Autodesk/maya-usd/blob/dev/plugin/pxr/maya/lib/usdMaya/proxyShape.cpp#L189
There is still the unwanted effect of clearing the stage on a change to the prim path with pxr proxy shape, but assembly workflows were not working with in-memory stages.