-
Notifications
You must be signed in to change notification settings - Fork 203
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-105977: Update restriction error reports based on latest design. #687
MAYA-105977: Update restriction error reports based on latest design. #687
Conversation
@@ -53,6 +53,10 @@ namespace MayaUsdUtils { | |||
MAYA_USD_UTILS_PUBLIC | |||
bool hasSpecs(const UsdPrim&); | |||
|
|||
//! Returns the layer in composition arc where HasSpecs is set to true | |||
MAYA_USD_UTILS_PUBLIC | |||
std::vector<SdfLayerHandle> layerInCompositionArcsWithSpec(const UsdPrim& 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.
@ppt-adsk added this new utility function since the new design for the first restriction rule requires the layer's name to be displayed in the message.
Please see the new string for first rule:
Error Message: Cannot [reparent/rename] [prim_name]. It does not make any contributions in the current layer because its specs are in an external composition arc. Please open [filename.usd] to make direct edits.
UFE_LOG(err.c_str()); | ||
throw; | ||
} | ||
} |
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.
Please ignore the tab conversion to dot changes by enabling "Hide whitespace changes" on github.
@@ -158,8 +166,7 @@ void applyCommandRestriction(const UsdPrim& prim, const std::string& commandName | |||
layerDisplayNames.append("[" + layer->GetDisplayName() + "]" + ","); | |||
} | |||
layerDisplayNames.pop_back(); | |||
std::string err = TfStringPrintf("Cannot %s [%s] with definitions or opinions on other layers. " | |||
"Opinions exist in %s", | |||
std::string err = TfStringPrintf("Cannot %s [%s]. It has definitions or opinions on other layers. Opinions exist in %s", | |||
commandName.c_str(), | |||
prim.GetName().GetString().c_str(), | |||
layerDisplayNames.c_str()); |
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.
@ppt-adsk Updating all the strings inside applyCommandRestriction routine.
Updated the strings for re-parent/rename restriction rules. There are currently 3 rules in place:
1. Check if a particular node has any specs to contribute to the final composed prim.
Error Message: Cannot [reparent/rename] [prim_name]. It does not make any contributions in the current layer because its specs are in an external composition arc. Please open [filename.usd] to make direct edits.
2. Check if we are in the correct edit target to make an edit.
Error Message: Cannot [reparent/rename] [prim_name]. It is defined on another layer. Please set [layername] as the target layer to proceed.
3. Check if we have more than 2 layers that contribute to the final composed prim.
Error Message: Cannot [reparent/rename] [prim_name]. It has definitions or opinions on other layers. Opinions exist in [layer name 1], [layer name 2], [layer name 3], [layer name 4].