Skip to content
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

EMSUSD-1046 manip pivot position #3752

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/mayaUsd/ufe/UsdTransform3dMayaXformStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,24 @@ UsdTransform3dMayaXformStack::translateRotatePivotCmd(double x, double y, double

Ufe::Vector3d UsdTransform3dMayaXformStack::rotatePivotTranslation() const
{
return getVector3d<GfVec3f>(UsdGeomXformOp::GetOpName(
// Note: USD and Maya use different pivots: USD has a single pivot that is used
// for both translation and scale, while Maya has separate ones. When working
// in this Maya transform stack mode, the USD pivot is only used to move the
// position of the manipulators, by returning it as part of this function.
//
// Interestingly, this is correct and enough to both display the manip at the
// correct position in the viewport *and* give the correct results. That's
// because USD internally will apply its pivot and the manip will give the
// correct value when manipulating.
Ufe::Vector3d commonPivot = getVector3d<GfVec3f>(
UsdGeomXformOp::GetOpName(UsdGeomXformOp::TypeTranslate, UsdGeomTokens->pivot));
Ufe::Vector3d mayaPivot = getVector3d<GfVec3f>(UsdGeomXformOp::GetOpName(
UsdGeomXformOp::TypeTranslate, getOpSuffix(NdxRotatePivotTranslate)));
mayaPivot.set(
mayaPivot.x() + commonPivot.x(),
mayaPivot.y() + commonPivot.y(),
mayaPivot.z() + commonPivot.z());
return mayaPivot;
}

Ufe::TranslateUndoableCommand::Ptr
Expand Down