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-105977: Update restriction error reports based on latest design. #687

Merged
merged 1 commit into from
Jul 30, 2020

Conversation

HamedSabri-adsk
Copy link
Contributor

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].

@HamedSabri-adsk HamedSabri-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows labels Jul 28, 2020
@HamedSabri-adsk HamedSabri-adsk requested a review from ppt-adsk July 28, 2020 20:08
@@ -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);
Copy link
Contributor Author

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;
}
}
Copy link
Contributor Author

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());
Copy link
Contributor Author

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.

@HamedSabri-adsk HamedSabri-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jul 30, 2020
@kxl-adsk kxl-adsk merged commit 5bb8b59 into dev Jul 30, 2020
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-105977/update_strings_restriction_errors branch July 30, 2020 23:29
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 workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants