-
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-125038 serialization of pull variant info into JSON #2682
MAYA-125038 serialization of pull variant info into JSON #2682
Conversation
pierrebai-adsk
commented
Oct 26, 2022
- 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
{ | ||
return Memento(deepCopy(pulledPrims())); | ||
} | ||
|
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.
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) |
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.
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. |
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.
Had to make the data structure public so that the code that save and restore the state can access them.
cmds.file(filename, open=True) | ||
|
||
def testHideOnNestedVariantSwitchOnReload(self): | ||
# Pull on C and E. |
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.
This new test tests the JSON code at the same time since it saves and reload the orphaned nodes manager using them.