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-121450 - Error when attempting to add a Maya reference to a variant #2091

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

seando-adsk
Copy link
Collaborator

MAYA-121450 - Error when attempting to add a Maya reference to a variant when the Layer edits are locked

  • Update error messages.
  • Added error message/test for Variant Set creation error.

…ant when the Layer edits are locked

* Update error messages.
* Added error message/test for Variant Set creation error.
@seando-adsk seando-adsk added enhancement New feature or request unit test Related to unit tests (both python or c++) labels Feb 10, 2022
@seando-adsk seando-adsk requested a review from ppt-adsk February 10, 2022 21:10
@seando-adsk seando-adsk changed the title MAYA-121450 - Error when attempting to add a Maya reference to a vari… MAYA-121450 - Error when attempting to add a Maya reference to a variant Feb 10, 2022
Comment on lines +34 to +39
register('kErrorGroupPrimExists', 'Group prim "^1s" already exists under "^2s". Choose prim name other than "^1s" to proceed.')
register('kErrorCannotAddToProxyShape', 'Cannot add Maya Reference node to ProxyShape with Variant Set unless grouped. Enable Group checkbox to proceed.')
register('kErrorMayaRefPrimExists', 'Maya Reference prim "^1s" already exists under "^2s". Choose Maya Reference prim name other than "^1s" to proceed.')
register('kErrorCreatingGroupPrim', 'Cannot create group prim under "^1s". Ensure target layer is editable and "^2s" can be added to "^1s".')
register('kErrorCreatingMayaRefPrim', 'Cannot create MayaReference prim under "^1s". Ensure target layer is editable and "^2s" can be added to "^1s".')
register('kErrorCreateVariantSet', 'Cannot create Variant Set on prim at path "^1s". Ensure target layer is editable and "^2s" can be added to "^3s".')
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

All error messages (plus new variant one) updated from doc.

Comment on lines +181 to +190
try:
vset = variantPrim.GetVariantSet(validatedVariantSetName)
vset.AddVariant(validatedVariantName)
vset.SetVariantSelection(validatedVariantName)
except (Tf.ErrorException):
errorMsgFormat = getMayaUsdLibString('kErrorCreateVariantSet')
errorMsg = cmds.format(errorMsgFormat,
stringArg=(str(variantPrim.GetPrimPath()), validatedVariantName, str(variantPrim.GetName())))
om.MGlobal.displayError(errorMsg)
return Usd.Prim()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Trap Usd exceptions while trying to create Variant set and Variant. Issue our own error message.

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 10, 2022
@kxl-adsk kxl-adsk merged commit 8998427 into dev Feb 10, 2022
@kxl-adsk kxl-adsk deleted the donnels/MAYA-121450/add_maya_reference_error_strings branch February 10, 2022 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready-for-merge Development process is finished, PR is ready for merge unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants