Skip to content

Commit

Permalink
Merge pull request #3752 from Autodesk/bailp/EMSUSD-1046/mixed-mode-p…
Browse files Browse the repository at this point in the history
…ivot

EMSUSD-1046 manip pivot position
  • Loading branch information
seando-adsk authored May 7, 2024
2 parents 8ad4817 + 3babff8 commit 08537bb
Showing 1 changed file with 17 additions and 1 deletion.
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

0 comments on commit 08537bb

Please sign in to comment.