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-121532 push/pull: usdeditAsMaya set should be a locked node #2290

Merged
merged 2 commits into from
Apr 14, 2022

Conversation

boudrey
Copy link
Contributor

@boudrey boudrey commented Apr 13, 2022

No description provided.

@@ -365,8 +365,8 @@ PullImportPaths pullImport(
MStatus status = UsdMayaUtil::GetMObjectByName(kPullSetName, pullSetObj);
if (status != MStatus::kSuccess) {
MString createSetCmd;
createSetCmd.format("sets -em -name \"^1s\";", kPullSetName.asChar());
MDGModifier& dgMod = MDGModifierUndoItem::create("Pull import pull set creation");
createSetCmd.format("sets -em -name \"^1s\";lockNode \"^1s\";", kPullSetName.asChar());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to be working with the tests I did, but is it ok for the undo/rebo?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It depends if the command itself is undoable. The docs for MDGModifier says:

The command should be fully undoable, otherwise unpredictable behaviour
may result. For example, assume that the command is a MEL procedure
which contains some undoable commands and some non-undoable commands.
When doIt() is first called, the procedure will be executed and all of
its commands will take effect. If undoIt() is subsequently called, only
the undoable portions of the script will be undone, which may leave Maya
in an unstable or inconsistent state. Any subsequent calls to doIt() will
only redo the commands which were undone, the non-undoable portions
will not be re-executed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be hard to test it anyway, since the undo will delete the set, so you cannot check if it unlocked properly, but then it does not matter since the set is gone, so it should be fine. If the units tests about undo/redo of editAsMaya pass, then it should be fine.

pierrebai-adsk
pierrebai-adsk previously approved these changes Apr 13, 2022
@boudrey
Copy link
Contributor Author

boudrey commented Apr 14, 2022

Only PF failure is known: MayaUsd - Maya Master [USD max, Python 3, Interactive] - Branch Preflight (Linux) - Build #1068 - FAILURE:

@boudrey boudrey added the ready-for-merge Development process is finished, PR is ready for merge label Apr 14, 2022
@seando-adsk seando-adsk added the import-export Related to Import and/or Export label Apr 14, 2022
@seando-adsk seando-adsk merged commit ffc4018 into dev Apr 14, 2022
@seando-adsk seando-adsk deleted the boudrey/MAYA-121532/lockset branch April 14, 2022 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export 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