-
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
Ufe manipulation #962
Merged
+4,000
−56
Merged
Ufe manipulation #962
Changes from 52 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
beb4977
Proof of concept for USD matrix transform op editing.
ppt-adsk 26eb26b
UFE commands must read initial value from proxy shape time.
ppt-adsk a46a9db
Made read vs write time explicit in TRS commands.
ppt-adsk 37249f8
Merge pull request #729 from Autodesk/adsk_matrixOp_proof_of_concept
20f1b92
Merge branch 'dev' into merge_dev_to_ufe-manipulation
ppt-adsk cd29d82
Merge pull request #767 from Autodesk/merge_dev_to_ufe-manipulation
ppt-adsk cdddf38
Merge branch 'dev' into merge_dev_to_ufe-manipulation_01
ppt-adsk ae53705
Update to latest Ufe::Transform3d interface.
ppt-adsk cb124c6
Merge pull request #770 from Autodesk/merge_dev_to_ufe-manipulation_01
ppt-adsk 16ef109
Merge branch 'dev' into ufe-manipulation
ppt-adsk ce15747
Merge branch 'dev' into ufe-manipulation
ppt-adsk f1faa20
Merge branch 'dev' into ufe-manipulation
ppt-adsk d9a4239
Compilation fixes to update to latest dev.
ppt-adsk 765ab86
Implementation of Maya transform stack Transform3d interface.
ppt-adsk 8c9e076
Address internal code review feedback.
ppt-adsk c2307b7
Minor bug fixes.
ppt-adsk fccaafb
Merge branch 'dev' into ufe-manipulation
ppt-adsk 02be11f
Merge pull request #872 from Autodesk/tremblp/MAYA-106087/maya_xform_…
c54aed6
Merge branch 'ufe-manipulation' of https://github.com/Autodesk/maya-u…
ppt-adsk f513d94
Enable initialization order warning on Windows, fix compilation.
ppt-adsk c5c801b
Merge pull request #887 from Autodesk/tremblp/MAYA-106087/maya_xform_…
ppt-adsk 0d0983b
Merge commit '0fe90bcce893dfbd4422f70bda84435f5721dd43' into kxl-adsk…
2487c4a
Merge commit '7c64b5df1f1cdbf879aaef12ed64b7fdd77a3af1' into kxl-adsk…
6a7548c
Merge remote-tracking branch 'origin/dev' into kxl-adsk/merge_dev_wit…
8529e8d
Merge pull request #894 from Autodesk/kxl-adsk/merge_dev_with_clang_f…
ppt-adsk 45d69f8
First working fallback transform op handling.
ppt-adsk 5e1e7c4
Removed Maya and Maya fallback code duplication.
ppt-adsk 25fefe1
Command state machine and lifescope fixes.
ppt-adsk 0780f8a
Added common transform API to chain of responsibility, with test.
ppt-adsk 9af738c
Ran clang-format on changed files.
ppt-adsk 182c71e
Merge branch 'ufe-manipulation' into tremblp/MAYA-106088/arbitrary_st…
ppt-adsk 8224093
Addressed review feedback.
ppt-adsk d73ad7e
Merge pull request #945 from Autodesk/tremblp/MAYA-106088/arbitrary_s…
ppt-adsk b9f0330
Integrate Ufe::Transform3d::editTransform3d() hint support.
ppt-adsk 4255dbd
Merge branch 'dev' into ufe-manipulation
5df6b3c
Add Undo/Redo support for 3dMayaXformStack.
8e32ac4
Replace c-style function pointer in favor of the std::function + lambda.
625c337
Merge pull request #956 from Autodesk/sabrih/MAYA-106089/support_undo…
HamedSabri-adsk e39340b
Adapt to changes in UFE editTransform3d hint.
ppt-adsk 813d266
Ensure compilation with previous Maya preview release.
ppt-adsk 0ff936a
Added Maya command to toggle Transform3d handler back to legacy.
ppt-adsk 25a0ffe
Applied clang-format.
ppt-adsk 8221079
Merge branch 'ufe-manipulation' into tremblp/MAYA-106088/arbitrary_st…
ppt-adsk 4d8d5ac
Merge pull request #948 from Autodesk/tremblp/MAYA-106088/arbitrary_s…
ppt-adsk 3f99a2a
- Adjust UndoBlock to capture the opFunc functor that sets/adds to th…
4e8282c
Merge pull request #959 from Autodesk/sabrih/fix_undo_redo_transforma…
ppt-adsk d9e93e8
Fixed parent test undo / redo failures.
ppt-adsk 38eb698
Merge pull request #960 from Autodesk/tremblp/MAYA-106088/fix_parent_…
ppt-adsk 120ae47
Fix undo/redo crash when switching between layers.
6df223f
MAYA-108545: Prevent the crash when authoring edits to instance proxi…
cf67adf
Merge pull request #969 from Autodesk/sabrih/MAYA-108545/authoring_to…
3cbd472
Compilation fixes for Maya 2020.
ppt-adsk ba205a1
Merge pull request #971 from Autodesk/tremblp/MAYA-106088/preflight_m…
ppt-adsk 2981cca
Revert "Fix undo/redo crash when switching between layers."
a87fc0b
Make sure the USD state delegate is registered for current existing PR.
677db40
Address feedback. Use a dynamic_cast to determine if a layer is alrea…
4e393cb
Fixes for pre-flight tests and clang-format.
ppt-adsk 5f331cb
Merge pull request #975 from Autodesk/tremblp/MAYA-106088/preflight_f…
ppt-adsk 49c5882
Merge pull request #965 from Autodesk/sabrih/MAYA-108549/fix_undo_cra…
HamedSabri-adsk 416df80
Fix unused variables and clang-format errors.
ppt-adsk 84c3b12
Merge pull request #976 from Autodesk/tremblp/MAYA-106088/more-prefli…
ppt-adsk edde5d5
Disable failing test on Linux.
ppt-adsk 332e169
Merge pull request #977 from Autodesk/tremblp/MAYA-106088/disable-fai…
ppt-adsk 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Copyright 2020 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 "RotationUtils.h" | ||
|
||
namespace { | ||
|
||
inline double TO_DEG(double a) { return a * 180.0 / 3.141592654; } | ||
inline double TO_RAD(double a) { return a * 3.141592654 / 180.0; } | ||
|
||
} | ||
|
||
namespace MAYAUSD_NS_DEF { | ||
namespace ufe { | ||
|
||
template <MEulerRotation::RotationOrder SRC_ROT_ORDER> Ufe::Vector3d fromRot(const VtValue& value) | ||
{ | ||
auto v = value.Get<GfVec3f>(); | ||
|
||
MEulerRotation eulerRot(TO_RAD(v[0]), TO_RAD(v[1]), TO_RAD(v[2]), SRC_ROT_ORDER); | ||
eulerRot.reorderIt(MEulerRotation::kXYZ); | ||
return Ufe::Vector3d(TO_DEG(eulerRot.x), TO_DEG(eulerRot.y), TO_DEG(eulerRot.z)); | ||
} | ||
|
||
template <MEulerRotation::RotationOrder DST_ROT_ORDER> VtValue toRot(double x, double y, double z) | ||
{ | ||
MEulerRotation eulerRot(TO_RAD(x), TO_RAD(y), TO_RAD(z), MEulerRotation::kXYZ); | ||
eulerRot.reorderIt(DST_ROT_ORDER); | ||
VtValue v; | ||
v = GfVec3f(TO_DEG(eulerRot.x), TO_DEG(eulerRot.y), TO_DEG(eulerRot.z)); | ||
return v; | ||
} | ||
|
||
template Ufe::Vector3d fromRot<MEulerRotation::kXZY>(const VtValue&); | ||
template Ufe::Vector3d fromRot<MEulerRotation::kYXZ>(const VtValue&); | ||
template Ufe::Vector3d fromRot<MEulerRotation::kYZX>(const VtValue&); | ||
template Ufe::Vector3d fromRot<MEulerRotation::kZXY>(const VtValue&); | ||
template Ufe::Vector3d fromRot<MEulerRotation::kZYX>(const VtValue&); | ||
|
||
template VtValue toRot<MEulerRotation::kXZY>(double, double, double); | ||
template VtValue toRot<MEulerRotation::kYXZ>(double, double, double); | ||
template VtValue toRot<MEulerRotation::kYZX>(double, double, double); | ||
template VtValue toRot<MEulerRotation::kZXY>(double, double, double); | ||
template VtValue toRot<MEulerRotation::kZYX>(double, double, double); | ||
|
||
} // 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,100 @@ | ||
// | ||
// Copyright 2020 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. | ||
// | ||
#pragma once | ||
|
||
#include <mayaUsd/mayaUsd.h> | ||
|
||
#include <pxr/base/gf/vec3d.h> | ||
#include <pxr/base/vt/value.h> | ||
|
||
#include <maya/MEulerRotation.h> | ||
#include <ufe/types.h> | ||
|
||
PXR_NAMESPACE_USING_DIRECTIVE | ||
|
||
namespace MAYAUSD_NS_DEF { | ||
namespace ufe { | ||
|
||
//---------------------------------------------------------------------- | ||
// Conversion functions from RotXYZ to all supported rotation attributes. | ||
//---------------------------------------------------------------------- | ||
|
||
inline VtValue toXYZ(double x, double y, double z) | ||
{ | ||
// No rotation order conversion | ||
VtValue v; | ||
v = GfVec3f(x, y, z); | ||
return v; | ||
} | ||
|
||
// Reorder argument RotXYZ rotation. | ||
template <MEulerRotation::RotationOrder DST_ROT_ORDER> VtValue toRot(double x, double y, double z); | ||
|
||
constexpr auto toXZY = toRot<MEulerRotation::kXZY>; | ||
constexpr auto toYXZ = toRot<MEulerRotation::kYXZ>; | ||
constexpr auto toYZX = toRot<MEulerRotation::kYZX>; | ||
constexpr auto toZXY = toRot<MEulerRotation::kZXY>; | ||
constexpr auto toZYX = toRot<MEulerRotation::kZYX>; | ||
|
||
// Scalar float is the proper type for single-axis rotations. | ||
inline VtValue toX(double x, double, double) | ||
{ | ||
VtValue v; | ||
v = float(x); | ||
return v; | ||
} | ||
|
||
inline VtValue toY(double, double y, double) | ||
{ | ||
VtValue v; | ||
v = float(y); | ||
return v; | ||
} | ||
|
||
inline VtValue toZ(double, double, double z) | ||
{ | ||
VtValue v; | ||
v = float(z); | ||
return v; | ||
} | ||
|
||
//---------------------------------------------------------------------- | ||
// Conversion functions from all supported rotation attributes to RotXYZ. | ||
//---------------------------------------------------------------------- | ||
|
||
inline Ufe::Vector3d fromXYZ(const VtValue& value) | ||
{ | ||
// No rotation order conversion | ||
auto v = value.Get<GfVec3f>(); | ||
return Ufe::Vector3d(v[0], v[1], v[2]); | ||
} | ||
|
||
template <MEulerRotation::RotationOrder SRC_ROT_ORDER> Ufe::Vector3d fromRot(const VtValue& value); | ||
|
||
constexpr auto fromXZY = fromRot<MEulerRotation::kXZY>; | ||
constexpr auto fromYXZ = fromRot<MEulerRotation::kYXZ>; | ||
constexpr auto fromYZX = fromRot<MEulerRotation::kYZX>; | ||
constexpr auto fromZXY = fromRot<MEulerRotation::kZXY>; | ||
constexpr auto fromZYX = fromRot<MEulerRotation::kZYX>; | ||
|
||
inline Ufe::Vector3d fromX(const VtValue& value) { return Ufe::Vector3d(value.Get<float>(), 0, 0); } | ||
|
||
inline Ufe::Vector3d fromY(const VtValue& value) { return Ufe::Vector3d(0, value.Get<float>(), 0); } | ||
|
||
inline Ufe::Vector3d fromZ(const VtValue& value) { return Ufe::Vector3d(0, 0, value.Get<float>()); } | ||
|
||
} // 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
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
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.
@ppt-adsk Nit-pick: use include guard instead based on our coding guideline. Same thing in other files.