-
Notifications
You must be signed in to change notification settings - Fork 203
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-112608: add grouping with absolute, relative, world flags. #1600
Changes from 3 commits
3f8ff19
c3a7b46
cd60e89
c6ce8e0
7e578fb
7705f64
f42f483
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,26 +34,35 @@ namespace MAYAUSD_NS_DEF { | |
namespace ufe { | ||
|
||
UsdUndoCreateGroupCommand::UsdUndoCreateGroupCommand( | ||
const UsdSceneItem::Ptr& parentItem, | ||
const Ufe::Selection& selection, | ||
const UsdSceneItem::Ptr& parentItem, | ||
#if (UFE_PREVIEW_VERSION_NUM < 3005) | ||
const Ufe::Selection& selection, | ||
#endif | ||
const Ufe::PathComponent& name) | ||
: Ufe::InsertChildCommand() | ||
, _parentItem(parentItem) | ||
, _name(name) | ||
#if (UFE_PREVIEW_VERSION_NUM < 3005) | ||
, _selection(selection) | ||
#endif | ||
, _groupCompositeCmd(std::make_shared<Ufe::CompositeUndoableCommand>()) | ||
|
||
{ | ||
} | ||
|
||
UsdUndoCreateGroupCommand::~UsdUndoCreateGroupCommand() { } | ||
|
||
UsdUndoCreateGroupCommand::Ptr UsdUndoCreateGroupCommand::create( | ||
const UsdSceneItem::Ptr& parentItem, | ||
const Ufe::Selection& selection, | ||
const UsdSceneItem::Ptr& parentItem, | ||
#if (UFE_PREVIEW_VERSION_NUM < 3005) | ||
const Ufe::Selection& selection, | ||
#endif | ||
const Ufe::PathComponent& name) | ||
{ | ||
#if (UFE_PREVIEW_VERSION_NUM >= 3005) | ||
return std::make_shared<UsdUndoCreateGroupCommand>(parentItem, name); | ||
#else | ||
return std::make_shared<UsdUndoCreateGroupCommand>(parentItem, selection, name); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these UFE V3 guards should be cleaned up after switching to UFE V3. |
||
} | ||
|
||
Ufe::SceneItem::Ptr UsdUndoCreateGroupCommand::insertedChild() const { return _groupItem; } | ||
|
@@ -76,7 +85,7 @@ void UsdUndoCreateGroupCommand::execute() | |
_groupCompositeCmd->append(setKindCmd); | ||
setKindCmd->execute(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the plugin side, we only need to create the groupItem and set its Kind. On the Maya side, the insertion (a.k.a move ) happens with support for different flag options. |
||
|
||
#if (UFE_PREVIEW_VERSION_NUM < 3005) | ||
// Make sure to handle the exception if the parenting operation fails. | ||
// This scenario happens if a user tries to group prim(s) in a layer | ||
// other than the one where they were defined. In this case, the group creation itself | ||
|
@@ -107,6 +116,7 @@ void UsdUndoCreateGroupCommand::execute() | |
|
||
throw; // re-throw the same exception | ||
} | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. groupItem selection is now handled on the Maya side. |
||
} | ||
|
||
void UsdUndoCreateGroupCommand::undo() { _groupCompositeCmd->undo(); } | ||
|
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.
adding guards against UFE v0.3.5 since selection is no longer passed to group command.