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

Test if visibility edit is valid before returning command. #2725

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

ppt-adsk
Copy link
Collaborator

No description provided.


UsdGeomImageable primImageable(prim);

EditTargetGuard guard(prim, layer);

std::string errMsg;
if (!MayaUsd::ufe::isAttributeEditAllowed(primImageable.GetVisibilityAttr(), &errMsg)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Perform the edit check on command creation, rather than execution. Failure on execution should be reported through an exception, but here the check really belongs to command creation: we communicate to the caller that the operation is not possible by returning a nullptr.

Furthermore, the edit guard must be set before performing the check, otherwise the check will be done on the current target, then the edit guard changes that target. In the case of an existing visibility edit in the session layer, this would mean that the check would be done on the current edit target layer, which typically is lower priority than the session layer, and the edit would fail. If the check is done when the edit target guard is set, the check properly occurs on the session layer. This accounts for many of the failures described in

#2549

@seando-adsk seando-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Nov 15, 2022
@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 16, 2022
@seando-adsk seando-adsk merged commit 1c96ce2 into dev Nov 16, 2022
@seando-adsk seando-adsk deleted the visibility_edit_routing_fixes branch November 16, 2022 18:54
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.

3 participants