-
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-121450 - Error when attempting to add a Maya reference to a variant #2091
MAYA-121450 - Error when attempting to add a Maya reference to a variant #2091
Conversation
…ant when the Layer edits are locked * Update error messages. * Added error message/test for Variant Set creation error.
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".') |
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.
All error messages (plus new variant one) updated from doc.
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() |
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.
Trap Usd exceptions while trying to create Variant set and Variant. Issue our own error message.
MAYA-121450 - Error when attempting to add a Maya reference to a variant when the Layer edits are locked