Maya Freeze transformations on custom MPxLocatorNode

Hey guys, I’m exploring some custom locator nodes in Maya API and have ran into the issue of not being able to freeze transformations on the transform node that has the custom locator shape attached to it. It ends up sending the shape to the origin of the scene, but maintains the pivot of the transform of the shape at the correct location. I realize this is because locators don’t have components like a mesh or curve, is there a way around that with the MPxLocatorNode class, or are you supposed to use MPxSurfaceShape or Mesh for an instance where you would like to be able to freeze transformations?


When you freeze transformations on a node in Maya, it saves the transformations to the shape node. In the case of locators (MPxLocatorNode included), it saves transformations on the shape in the localPostion and localScale attributes. So you need to read these attributes and apply the transformation in your locator node yourself.

Though I’m not sure how to store rotations with an MPxLocatorNode, since there is no localRotation attribute and I’m not sure how the freeze transforms operation is conveyed to the node. I’d love to hear if anyone else knows how to do that.

Thanks Assumption, I was able to manually tie in the localPosition values into the drawing of the openGL shapes and that solved the translation issues with freeze transforms sending it to the origin.