Good tip on the way it moves points. I thought there must be another offset value stored in the shape. I guess the "apply" flag makes it move points. It could be slow, hence having a specific flag.
So an issue I've run into is that even when I run makeIdentity only on translation, it still resets shear values, which means that subsequent attempts to move the local rotation or scale pivots get messed up. I'm not sure why it behaves like that. It works fine on non-uniform scale only with multiples of 90 degree rotations, since those don't cause shear. On Wednesday, 13 February 2019 16:12:30 UTC+11, simon.a...@wingnutar.com wrote: > > Hi Micheal, > > I was just having a read over what the method does, and trying it out on a > few different type of objects. > > on an group, it just seems get the world matrix and apply it to the groups > pivot. > > on geo, it offsets all the points by the world position of that object and > then sets the pivot to be the world position, making it look as if the > object has stayed in the same place, and has the same pivot point, but in > actual fact the pivot point has been moved to match the previous transform > and the points have been moved. > > It also does this resursivley, for any object that is a child of the > object you are performing the identity of. > > This is very doable in OM or OM2, you will have to update the points using > > mesh = om2.MFnMesh('shape object here') > > # gets all the points in the mesh > points = mesh.getPoints() > > # loop over every point and perform your math on the point here > > # sets the points of the mesh > mesh.setPoints('your point array') > > Updating a pivot of an object: > > trans = om2.MFnTransform() > trans.setRotatePivot() > > I hope that helps, > Cheers Si -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7b03d249-58bb-40b5-b4d4-9e828fda4574%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.