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-127758 add edit routing for attributes #2951

Merged
merged 4 commits into from
Mar 28, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

  • Add a helper funtion to restore all edit routers to their default.
  • Add a getAttrEditRouterLayer helper function to route attribute editions.
  • The routing operation for attribute is named... 'attribute'
  • It receives the attribute name in the routing context under the 'attribute' key.
  • Add the routing operation name in the routing context under the 'operation' key.
  • Declare tokens used in edit routing globally.
  • This avoid typos and avoid creating them on each call.
  • Use attribute routing in UFE Object3d setVisibility implementation.
  • Use attribute routing in UFE attribute holder inplementation for setMetadata, set, clearMetadata.
  • Use routed layer when checking editability.
  • Allow cancelling routed operations by throwing an exception.
  • Add unit tests for attribute routing.
  • Add a unit test for canceling a command from within an edit router

- Add a helper funtion to restore all edit routers to their default.
- Add a getAttrEditRouterLayer helper function to route attribute editions.
- The routing operation for attribute is named... 'attribute'
- It receives the attribute name in the routing context under the 'attribute' key.
- Add the routing operation name in the routing context under the 'operation' key.
- Declare tokens used in edit routing globally.
- This avoid typos and avoid creating them on each call.
- Use attribute routing in UFE Object3d setVisibility implementation.
- Use attribute routing in UFE attribute holder inplementation for setMetadata, set, clearMetadata.
- Use routed layer when checking editability.
- Allow cancelling routed operations by throwing an exception.
- Add unit tests for attribute routing.
- Add a unit test for canceling a command from within an edit router
@pierrebai-adsk pierrebai-adsk added adsk Related to Autodesk plugin enhancement New feature or request labels Mar 17, 2023
//
// clang-format off
#define MAYA_USD_EDIT_ROUTING_TOKENS \
/* Tokens shared by multiple edit routers */ \
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I took the time to declare the edit routing tokens to avoid typos in the future. This means some existing code changed to use these new declaration, related to cache-to-USD for example. That is why there are more file changed then just the new router.

@@ -26,6 +27,22 @@ using namespace boost::python;

namespace {

std::string handlePythonException()
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This extract the exception text to be able to log it in Maya.

vlasovi
vlasovi previously approved these changes Mar 20, 2023
Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

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

Looks good

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 22, 2023
seando-adsk
seando-adsk previously approved these changes Mar 23, 2023
Copy link
Collaborator

@seando-adsk seando-adsk left a comment

Choose a reason for hiding this comment

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

Good work. Thanks for putting all those hard-coded values into tokens.

vlasovi
vlasovi previously approved these changes Mar 23, 2023
@pierrebai-adsk pierrebai-adsk removed the ready-for-merge Development process is finished, PR is ready for merge label Mar 25, 2023
@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 27, 2023
@seando-adsk seando-adsk merged commit 6e6a9de into dev Mar 28, 2023
@seando-adsk seando-adsk deleted the bailp/MAYA-127758/visibility-edit-routing branch March 28, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin enhancement New feature or request ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants