-
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
Support EditRouter in delete command #3695
Merged
seando-adsk
merged 2 commits into
Autodesk:dev
from
AnimalLogic:NickWu/undoableDeleteCommand
Apr 29, 2024
Merged
Support EditRouter in delete command #3695
seando-adsk
merged 2 commits into
Autodesk:dev
from
AnimalLogic:NickWu/undoableDeleteCommand
Apr 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NickWu
changed the title
[al] Support EditRouter for delete command
[al] Support EditRouter in delete command
Apr 4, 2024
NickWu
changed the title
[al] Support EditRouter in delete command
Support EditRouter in delete command
Apr 4, 2024
pierrebai-adsk
requested changes
Apr 10, 2024
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.
Need to fix teh edit context and add a few comments in the code to help us underatdn what is going on in the future.
Hi @pierrebai-adsk , I have added some comments as requested. |
pierrebai-adsk
approved these changes
Apr 26, 2024
Ran internal preflight #1847 and it passed. |
pierrebai-adsk
added
the
ready-for-merge
Development process is finished, PR is ready for merge
label
Apr 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ready-for-merge
Development process is finished, PR is ready for merge
ufe-usd
Related to UFE-USD plugin in Maya-Usd
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, in our pipeline, we have a tool in Maya to delete prims from a specified layer using USD's native API, and we are using the
delete
key as the hotkey to run the tool. In order the make the prim deletion behaviour consistent between our tool and in Maya viewport (so that users could hit thedelete
key either with the tool or viewport in focus and get the same result), we'd like to map thedelete
key in Maya to our prim deletion tool, but we learned that thedelete
key executed in viewport cannot be remapped and it has been reserved to Maya'scmds.delete()
command which has its own logic to delete the selected prims from the layers retrieved based on its own logic.cmds.delete()
callsUsdUndoDeleteCommand
internally and it doesn't supportEditRouter
to get an edit target layer from users.We made these changes in our pipeline to be able to send an
UsdEditTarget
toUsdUndoDeleteCommand
viaEditRouter
so that a prim can be deleted in a layer we specify. By sending aUsdEditTarget
object instead of aSdfLayer
, clients have full control on how to construct aUsdEditTarget
; if it's constructed with a pcp node, it can delete prims defined in non-local layers, which is one of the main intentions of this update.The changes are:
getEditRouterEditTarget
function inEditRouter
to retrieveUsdEditTarget
.allowStronger
inUsdUfe::applyCommandRestrictionNoThrow
to pass the check.EditRouter
tokens for registering newEditRouter
callback for deletion and retrievingUsdEditTarget
from callbacks.wrapEditRouter
to be able to retrieveUsdEditTarget
object from Python.