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

Maya fallback + additional op no longer crashes. #1105

Merged
merged 2 commits into from
Jan 27, 2021

Conversation

ppt-adsk
Copy link
Collaborator

No description provided.

auto opNdx = gOpNameToNdx.at(op.GetOpName());
auto found = gOpNameToNdx.find(op.GetOpName());
if (found == gOpNameToNdx.end()) {
// Found an op that doesn't match a Maya fallback stack op.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Maya fallback transform stack must be the last set of transform ops in a prim's transform stack. If there is already a Maya fallback transform stack at the tail of a prim's transform stack, any op that does not match means the Maya fallback transform stack has been "corrupted" in some way by adding or inserting an op that shouldn't be there.

If that happens, we don't create a fallback to the fallback: we detect the erroneous transform op, and return a nullptr Transform3d interface.

@@ -612,6 +612,67 @@ def testFallbackCases(self):
"xformOp:rotateZ", "!invert!xformOp:translate:pivot",
"xformOp:rotateXYZ:maya_fallback")))

def testBrokenFallback(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Written in TDD style: test written first, failed, code fixed, test passes.

proxyShapeContextOps = ufe.ContextOps.contextOps(proxyShapeItem)
proxyShapeContextOps.doOp(['Add New Prim', 'Capsule'])

capsulePath = ufe.PathString.path('|stage1|stageShape1,/Capsule1')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Steps in test taken from ADSK JIRA bug description, and adapted.

"xformOp:rotateXYZ:maya_fallback", "xformOp:rotateZ")))

# Do any transform editing with Maya.
cmds.rotate(0, 0, 30, r=True, os=True, fo=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will crash if we don't have a Maya with the fix to MAYA-109343, which is fairly recent. Will need to figure out how to identify this version of Maya and skip the test if necessary; this needs to work across Maya branches. Suggestions welcome.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppt-adsk Let's have a chat offline today.

@kxl-adsk kxl-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Jan 23, 2021
@HamedSabri-adsk HamedSabri-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 26, 2021
@ppt-adsk
Copy link
Collaborator Author

Only pre-flight failure is macOS Python 2, so indeed ready for merge.

@kxl-adsk kxl-adsk merged commit 676255e into dev Jan 27, 2021
@kxl-adsk kxl-adsk deleted the tremblp/MAYA-108765/maya_fallback_must_be_final branch January 27, 2021 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants