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

EMSUSD-647 fix copying the proxy shape node #3489

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

@pierrebai-adsk pierrebai-adsk commented Nov 30, 2023

When Maya copies a Maya node, it actually export the selected nodes into a temporary file. When the node is a MayaUSD node, this export automatically prompt the user to save the dirty USD files. To avoid this, we now detect that we are exporting due to a copy operation and force saving the USD layer into the temporary Maya scene file.

When Maya copies a Maya node, it actually export the selected nodes into a temporary file. When the node is a MayaUSD node, this export automatically prompt the user to save the dirty USD files. To avoid this, we now detect that we are exporting due to a copy operation and force saving the USD layer into the Maya scene file.
// When Maya is crashing or copying/cutting scene nodes, we don't want to
// save the the USD file to avoid overwriting them with possibly unwanted
// data. Instead, we will save the USD data inside the temporary crash recovery Maya file.
if (isCrashing() || isCopyingSceneNodes()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Am I understanding correctly from the PR info
"we now detect that we are exporting due to a copy operation and force saving the USD layer into the Maya scene file."

that we are saving the layer into the Maya file without user knowing about it?
I thought the intention was to do nothing when that shortcut is called.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Doing nothing would be hard because we are not in control. Hitting ctrl-C does a "selected export" in Maya in a hidden temp file.

My fix make copy/paste of shape node work.

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 asked David Santos about it on slack, and he said that my fix is OK and is probably what we want anyway.

Copy link
Collaborator

@AramAzhari-adsk AramAzhari-adsk left a comment

Choose a reason for hiding this comment

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

LGTM. To avoid any confusion, I recommend updating the description to include the word temp in the following:

" To avoid this, we now detect that we are exporting due to a copy operation and force saving the USD layer into the temporary crash recovery Maya scene file."

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Nov 30, 2023
@pierrebai-adsk
Copy link
Collaborator Author

The first sentence of the description said that Maya saves the scene in a temporary file, I could repeat it again after to make it more clear. The scene is not a crash scene, it's just a hidden temp scene file used as the copy/paste data holder.

@seando-adsk seando-adsk added import-export Related to Import and/or Export and removed adsk Related to Autodesk plugin labels Dec 1, 2023
@seando-adsk seando-adsk merged commit f0b70f3 into dev Dec 1, 2023
@seando-adsk seando-adsk deleted the bailp/EMSUSD-647/copy-shape-node branch December 1, 2023 14:52
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