-
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
Changes from 8 commits
a54fb06
f1b8cd4
ac62c4a
b524492
0cc1d0b
ed11890
f0799ad
419275e
8da1e6c
0e0e9f5
ac850c1
acd172c
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
# UFE_VERSION UFE version (major.minor.patch) from ufe.h | ||
# UFE_LIGHTS_SUPPORT Presence of UFE lights support | ||
# UFE_SCENE_SEGMENT_SUPPORT Presence of UFE scene segment support | ||
# UFE_PREVIEW_FEATURES List of all features introduced gradually in the UFE preview version | ||
# | ||
|
||
find_path(UFE_INCLUDE_DIR | ||
|
@@ -82,6 +83,13 @@ find_library(UFE_LIBRARY | |
NO_DEFAULT_PATH | ||
) | ||
|
||
# Gather all preview features that might be there or not into a single list: | ||
list(APPEND UFE_PREVIEW_FEATURES v4) | ||
|
||
if (UFE_INCLUDE_DIR AND EXISTS "${UFE_INCLUDE_DIR}/ufe/batchOpsHandler.h") | ||
list(APPEND UFE_PREVIEW_FEATURES BatchOps) | ||
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. 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 commentThe 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 commentThe 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 commentThe 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 commentThe 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. |
||
|
||
# Handle the QUIETLY and REQUIRED arguments and set UFE_FOUND to TRUE if | ||
# all listed variables are TRUE. | ||
include(FindPackageHandleStandardArgs) | ||
|
@@ -90,6 +98,7 @@ find_package_handle_standard_args(UFE | |
REQUIRED_VARS | ||
UFE_INCLUDE_DIR | ||
UFE_LIBRARY | ||
UFE_PREVIEW_FEATURES | ||
VERSION_VAR | ||
UFE_VERSION | ||
) | ||
|
@@ -98,6 +107,7 @@ if(UFE_FOUND) | |
message(STATUS "UFE include dir: ${UFE_INCLUDE_DIR}") | ||
message(STATUS "UFE library: ${UFE_LIBRARY}") | ||
message(STATUS "UFE version: ${UFE_VERSION}") | ||
message(STATUS "UFE preview features: ${UFE_PREVIEW_FEATURES}") | ||
endif() | ||
|
||
set(UFE_LIGHTS_SUPPORT FALSE CACHE INTERNAL "ufeLights") | ||
|
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::duplicateSelection_( | ||
const Ufe::Selection& selection, | ||
const Ufe::ValueDictionary& duplicateOptions) | ||
{ | ||
return UsdUndoDuplicateSelectionCommand::create(selection, duplicateOptions); | ||
} | ||
|
||
} // namespace ufe | ||
} // namespace MAYAUSD_NS_DEF |
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 duplicateSelection_( | ||
const Ufe::Selection& selection, | ||
const Ufe::ValueDictionary& duplicateOptions) override; | ||
}; // UsdBatchOpsHandler | ||
|
||
} // namespace ufe | ||
} // namespace MAYAUSD_NS_DEF | ||
|
||
#endif // USDBATCHOPSHANDLER_H |
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.
We can't just say that it includes v4, because when compiling with older versions of Maya we aren't using Ufe v4.
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.
Isn't this rather saying that UFE_PREVIEW_FEATURES is a list that pertains to UFE v4? Not sure what we're getting by placing this "v4" string into the list, because it will always be the case that preview features will pertain to the up-coming UFE version.
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.
In fact, I would push one step further and say that maybe even "preview" is too specific. If we imagine this being only a list of Ufe features, then it enable them as soon as Ufe supports them in Maya, which becomes very interesteing from a feature backporting scenario. I do remember the MAYA_LIGHT_API_VERSION kicking in when I backported the light API fixes for 2020.3 without having to update MayaUSD.
Might be potential discussion subject for the UFE interest meeting.
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.
Better initializer, since list can not be empty, would be "ufe".