Skip to content

LOOKDEVX-4775 - Implement dstParentPath duplicate option of BatchOpsHandler. - #4296

Merged
seando-adsk merged 2 commits into
devfrom
frohnej/LOOKDEVX-4775/duplicateToTarget
Aug 21, 2025
Merged

LOOKDEVX-4775 - Implement dstParentPath duplicate option of BatchOpsHandler.#4296
seando-adsk merged 2 commits into
devfrom
frohnej/LOOKDEVX-4775/duplicateToTarget

Conversation

@frohnej-adsk

@frohnej-adsk frohnej-adsk commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

Implements a new option of Ufe::BatchOpsHandler::duplicateSelectionCmd() to duplicate items to the specified location.

@frohnej-adsk frohnej-adsk self-assigned this Aug 12, 2025
return nullptr;
}

return Ufe::Hierarchy::createItem(it->second->path());

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Recreate the item in case it went stale.

I tried changing _duplicatedItemsMap to just store paths to prevent items from going stale in the first place, but that caused issues with the clipboard. If this command is used to duplicate |stage1|stageShape1,/mtl/add1 to the clipboard, the UFE path of the duplicated item will just be /add1 -- it's at the root of the clipboard stage.

Ufe::Hierarchy::createItem() is not able to create an item from /add1, so the clipboard relies on the actual item being stored and returned by UsdUndoDuplicateSelectionCommand::getDuplicatedItemsMap().


#include "UsdUndoDuplicateSelectionCommand.h"

#include "ufe/hierarchy.h"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ufe headers come after the block of headers.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See aa95fef.

seando-adsk
seando-adsk previously approved these changes Aug 12, 2025
@frohnej-adsk frohnej-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Aug 21, 2025
@seando-adsk seando-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Aug 21, 2025
@seando-adsk
seando-adsk merged commit 2013b30 into dev Aug 21, 2025
11 checks passed
@seando-adsk
seando-adsk deleted the frohnej/LOOKDEVX-4775/duplicateToTarget branch August 21, 2025 15:46
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants