-
Notifications
You must be signed in to change notification settings - Fork 201
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-125039 handle rename and reparent in the orphaned nodes manager #2690
Conversation
pierrebai-adsk
commented
Oct 28, 2022
- Handle the reparent and rename UFE notifications.
- Rename the orphan manager trie nodes.
- Rename the variant descriptors.
- Rewrite the pull info on the USD node to reflect the new UFE paths.
- Added util code to print the orphan pulled info, useful when debugging.
- Add two unit tests
- Handle the reparent and rename UFE notifications. - Rename the orphan manager trie nodes. - Rename the variant decriptors. - Rewrite the pull info on the USD node to reflect the new UFE paths. - Added util code to print the orphan pulled info, useful when debugging. - Add two unit tests
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.
Overall looks pretty good to me! Thanks for the great work. Just not too sure about the additional information passed around into the Trie methods in the orphaned nodes manager. Perhaps something to discuss live.
lib/mayaUsd/fileio/pullInformation.h
Outdated
|
||
UFE_NS_DEF { class Path; } | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE |
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.
Since this is a brand new file, can we try not putting the new code in the Pixar namespace, and put it into the MAYAUSD_NS_DEF namespace instead? Don't think it would be too much work, right? This is what I did for the orphaned nodes manager.
|
||
namespace MAYAUSD_NS_DEF { | ||
|
||
void OrphanedNodesManagerPullInfoToText( |
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.
Function name should not be capitalized.
lib/mayaUsd/utils/json.h
Outdated
@@ -0,0 +1,57 @@ | |||
// |
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.
Is this code used or tested in this pull request?
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.
It is part of this #2684 PR, on which this is baed. The order the PR will go in is:
#2682
#2684
and this one last.
The code is tested (somewhat indirectly) by the tests named testHideOnNestedVariantSwitchOnReload, which verifies that the orphan nodes manager state is correct when Maya scene is cleared and then a scene with an edited object is reloaded.
MGlobal::executeCommand(cmd, result, display, undoable); | ||
|
||
return result != 0; | ||
return depNode.hasAttribute(attrName); |
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.
Thanks for these changes. Might have been nice to put them up as a separate pull request, just to make this one lighter.
if (!trieNode) | ||
return; | ||
|
||
Ufe::TrieNode<PullVariantInfo>& node = *trieNode; |
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.
Nit-pick: should be const ref. And could be const auto& if you like :)
|
||
namespace { | ||
|
||
Ufe::Path trieNodeToPullePrimUfePath(Ufe::TrieNode<PullVariantInfo>::Ptr trieNode) |
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.
Typo in function name: should be "trieNodeToPulledPrimUfePath".
Also should pass the trie node ptr by const ref, to avoid needless inc / dec ref count of temporary object.
bool visibility) | ||
namespace ufe { | ||
|
||
extern Ufe::Rtid g_MayaRtid; |
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.
Awkward, this is an implementation detail. Should use functions from Global.h.
with mayaUsd.lib.OpUndoItemList(): | ||
aMayaItem = ufe.GlobalSelection.get().front() | ||
aMayaPath = aMayaItem.path() | ||
self.assertTrue(mayaUsd.lib.PrimUpdaterManager.mergeToUsd(ufe.PathString.string(aMayaPath))) |
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.
Excellent.
|
||
validateEditAsMayaMetadata() | ||
|
||
# Note: the parent command changes the selection, to preserve and restore it. |
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.
"to preserve" --> "so preserve".
Ah, I had 3 PR, each one built on top of the previous, and this one was the last of the three. So, it contains the code of all three. I understand that by reviewing this one you review all three at the same time, which saves time, but should I still do 3 PR or just this massive one? |
@pierrebai-adsk Different JIRA items each require their own PR. We should not mix work from different tasks together. |
Half the review comments have been addressed in #2684 since the code was introduced in that PR. The other half were about code that is only in this PR and will be updated once I merge that PR into this one (and fix any conflict.) |
…lp/MAYA-125039/rename-vs-orphaned-nodes
- Fix typos. - Make a trie node ref constant.
…lp/MAYA-125039/rename-vs-orphaned-nodes
…lp/MAYA-125039/rename-vs-orphaned-nodes