-
Notifications
You must be signed in to change notification settings - Fork 202
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-125378 Implementation batched duplication #2687
Merged
seando-adsk
merged 12 commits into
dev
from
gamaj/MAYA-125378/fix_relationships_and_connections_on_batched_duplication
Nov 10, 2022
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a54fb06
MAYA-125378 Implementation of a duplication guard
JGamache-autodesk f1b8cd4
Reimplementd using duplicateSelection call
JGamache-autodesk ac62c4a
Coding standard fixes.
JGamache-autodesk b524492
Adressing review comment and spec change.
JGamache-autodesk 0cc1d0b
Fix issue discovered while testing.
JGamache-autodesk ed11890
Fix build when batchOps are absent.
JGamache-autodesk f0799ad
More elegant CMake feature detection.
JGamache-autodesk 419275e
Fix doc.
JGamache-autodesk 8da1e6c
Updated to latest BatchOps API.
JGamache-autodesk 0e0e9f5
Merge branch 'dev' into gamaj/MAYA-125378/fix_relationships_and_conne…
JGamache-autodesk ac850c1
Merge branch 'dev' into gamaj/MAYA-125378/fix_relationships_and_conne…
JGamache-autodesk acd172c
Remove using directive
JGamache-autodesk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// Copyright 2022 Autodesk | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
#include "UsdBatchOpsHandler.h" | ||
|
||
#include <mayaUsd/ufe/UsdUndoDuplicateSelectionCommand.h> | ||
|
||
PXR_NAMESPACE_USING_DIRECTIVE | ||
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. Do you need this? All new code should use the fully qualified namespace name. But I don't see any USD code here. |
||
|
||
namespace MAYAUSD_NS_DEF { | ||
namespace ufe { | ||
|
||
UsdBatchOpsHandler::UsdBatchOpsHandler() | ||
: Ufe::BatchOpsHandler() | ||
{ | ||
} | ||
|
||
UsdBatchOpsHandler::~UsdBatchOpsHandler() { } | ||
|
||
/*static*/ | ||
UsdBatchOpsHandler::Ptr UsdBatchOpsHandler::create() | ||
{ | ||
return std::make_shared<UsdBatchOpsHandler>(); | ||
} | ||
|
||
//------------------------------------------------------------------------------ | ||
// Ufe::BatchOpsHandler overrides | ||
//------------------------------------------------------------------------------ | ||
|
||
Ufe::SelectionUndoableCommand::Ptr UsdBatchOpsHandler::duplicateSelectionCmd_( | ||
const Ufe::Selection& selection, | ||
const Ufe::ValueDictionary& duplicateOptions) | ||
{ | ||
return UsdUndoDuplicateSelectionCommand::create(selection, duplicateOptions); | ||
} | ||
|
||
} // namespace ufe | ||
} // namespace MAYAUSD_NS_DEF |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef USDBATCHOPSHANDLER_H | ||
#define USDBATCHOPSHANDLER_H | ||
|
||
// | ||
// Copyright 2022 Autodesk | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
#include <mayaUsd/base/api.h> | ||
|
||
#include <pxr/usd/sdf/path.h> | ||
#include <pxr/usd/sdf/types.h> | ||
#include <pxr/usd/usd/stage.h> | ||
|
||
#include <ufe/batchOpsHandler.h> | ||
|
||
namespace MAYAUSD_NS_DEF { | ||
namespace ufe { | ||
|
||
//! \brief Interface to create a UsdBatchOpsHandler interface object. | ||
class MAYAUSD_CORE_PUBLIC UsdBatchOpsHandler : public Ufe::BatchOpsHandler | ||
{ | ||
public: | ||
typedef std::shared_ptr<UsdBatchOpsHandler> Ptr; | ||
|
||
UsdBatchOpsHandler(); | ||
~UsdBatchOpsHandler() override; | ||
|
||
// Delete the copy/move constructors assignment operators. | ||
UsdBatchOpsHandler(const UsdBatchOpsHandler&) = delete; | ||
UsdBatchOpsHandler& operator=(const UsdBatchOpsHandler&) = delete; | ||
UsdBatchOpsHandler(UsdBatchOpsHandler&&) = delete; | ||
UsdBatchOpsHandler& operator=(UsdBatchOpsHandler&&) = delete; | ||
|
||
//! Create a UsdBatchOpsHandler. | ||
static UsdBatchOpsHandler::Ptr create(); | ||
|
||
// Ufe::BatchOpsHandler overrides. | ||
Ufe::SelectionUndoableCommand::Ptr duplicateSelectionCmd_( | ||
const Ufe::Selection& selection, | ||
const Ufe::ValueDictionary& duplicateOptions) override; | ||
}; // UsdBatchOpsHandler | ||
|
||
} // namespace ufe | ||
} // namespace MAYAUSD_NS_DEF | ||
|
||
#endif // USDBATCHOPSHANDLER_H |
Oops, something went wrong.
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.
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.
Using a list to store keys looks like a viable solution to handle progressively added features.
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.
I like it, but I'm not a CMake expert.
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.
I think each feature added to UFE_PREVIEW_FEATURES should be tagged with the version first. So "v4_BatchOps". This would make them easier to find and remove/modify to normal ufe ifdef once Ufe v4 is released.
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.
What happens when we backport v5_WorkflowX into v4 for an hypothetical Maya dot release?
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.
Once Ufe v4 is released we remove all these "preview" checks and replace them with just "ufe v4" check.