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

Implement pivot accessors for wrapped matrix ops. #2319

Merged
merged 1 commit into from
Apr 29, 2022

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Apr 28, 2022

Setting the rotate or scale pivot on a prim with a matrix (a.k.a. transform) transform op immediately creates a Maya fallback matrix stack, because pivot values are not supported by the single matrix data model. When this occurs, a UsdTransform3dSetObjectMatrix wrapper Ufe::Transform3d interface is created to wrap the Maya fallback matrix stack. This wrapper did not forward the pivot accessors to the wrapped Maya fallback stack, now fixed.

@@ -64,6 +64,20 @@ Ufe::Vector3d UsdTransform3dSetObjectMatrix::scale() const
return getScale(UsdTransform3dBase::matrix());
}

Ufe::Vector3d UsdTransform3dSetObjectMatrix::rotatePivot() const { return _wrapped->rotatePivot(); }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forward pivot accessors to the wrapped Transform3d.

@@ -228,6 +232,37 @@ def testRotatePivotCmd(self):
sphereMatrix = om.MMatrix(t3d.inclusiveMatrix().matrix)
self.checkPos(sphereMatrix, [20, 10, 0])

def testRotatePivotMatrixOp(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test driven development: test written first, failed, implemented fix, test passes.

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Apr 28, 2022
@seando-adsk seando-adsk added the ufe-usd Related to UFE-USD plugin in Maya-Usd label Apr 29, 2022
@seando-adsk seando-adsk merged commit 3bd6703 into dev Apr 29, 2022
@seando-adsk seando-adsk deleted the tremblp/MAYA-114719/edit_pivot_xformOpMatrix branch April 29, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants