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-125038 serialization of pull variant info into JSON #2682

Merged

Conversation

pierrebai-adsk
Copy link
Collaborator

  • Conversion to and from JSON
  • Save and restore the orphaned nodes manager state
  • Register unregister callbacks on construction, unregister on destruction of the prim updater manager.
  • Add after new / open callback to load the orphaned nodes manager state.
  • Add before save callback to save the orphnaed nodes manager state.
  • Move generic JSON function to their own file under mayaUsd/utils.
  • Improve the dynamic attribute functions to use C++ API instead of MEL.
  • Add unit test

- Conversion to and from JSON
- Save and restore the orphaned nodes manager state
- Register unregister callbacks on construction, unregister on destruction of the prim updater manager.
- Add after new / open callback to load the orphaned nodes manager state.
- Add before save callback to save the orphnaed nodes manager state.
- Move generic JSON function to their own file under mayaUsd/utils.
- Improve the dynamic attribute functions to use C++ API instead of MEL.
- Add unit test
@pierrebai-adsk pierrebai-adsk added the adsk Related to Autodesk plugin label Oct 26, 2022
{
return Memento(deepCopy(pulledPrims()));
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The refactor of the code that create a Memento into a public function is necessary to be able to save and restore the orphaned nodes manager when saving and loading a Maya scene.

PullVariantInfo(const MDagPath& dp, const std::list<VariantSetDescriptor>& vsd)
: dagPath(dp)
PullVariantInfo(const MDagPath& pulledParent, const std::list<VariantSetDescriptor>& vsd)
: pulledParentPath(pulledParent)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rname dagPath to pulledParentPath to make the code easier to understand. It is also necessary because subsequent change in other PR adds other MDagPath and the generic name rapidly became a hindrance.

class OrphanedNodesManager : public Ufe::Observer
{
public:
/// \brief Records a single variant selection of a single variant set.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Had to make the data structure public so that the code that save and restore the state can access them.

@pierrebai-adsk
Copy link
Collaborator Author

@ppt-adsk I read the comment in the other PR and verified in this PR: none of them affect this PR, so I think this one is good to go? All the changes you requested are in #2684 and #2690.

cmds.file(filename, open=True)

def testHideOnNestedVariantSwitchOnReload(self):
# Pull on C and E.
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 new test tests the JSON code at the same time since it saves and reload the orphaned nodes manager using them.

@pierrebai-adsk
Copy link
Collaborator Author

@ppt-adsk None of the comments in #2690 affect the code that is present in this PR, so it shoud be OK to merge this one and move to the next one in the chain?

@ppt-adsk
Copy link
Collaborator

ppt-adsk commented Nov 7, 2022

@ppt-adsk None of the comments in #2690 affect the code that is present in this PR, so it shoud be OK to merge this one and move to the next one in the chain?

I've taken your word for it and have approved.

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 7, 2022
@seando-adsk seando-adsk added the core Related to core library label Nov 9, 2022
@seando-adsk seando-adsk merged commit f92b526 into dev Nov 9, 2022
@seando-adsk seando-adsk deleted the bailp/MAYA-125038/pull-variants-tracking-persistence branch November 9, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin core Related to core library 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