View Full Version : Connecting a MPxLocatorNode to a transform node

03-13-2010, 03:19 AM
My MPxLocatorNode needs to access/modify a shape's transformation matrix, as well as access the points on the mesh itself for calculations.

To do this, I'm trying to feed a transform node (I think that's what its called...the node that holds the transform matrix for each shape object) as an input to a MPxLocatorNode, but I'm having trouble. (What type should the plug be, and what output on the transform node do I want?)

The reason why I'm grabbing the transform node and not the shape itself is, in the case of instanced geometry, I'd want a unique locator node for every shape, and each shape has its own transform node. I'm assuming I'm going the right direction here.

Any help is greatly appreciated. Thanks.

03-13-2010, 05:16 AM
a locator shape is a DAG node and so will have a transform node created for you automatically. By deriving from an MPxLocatorNode class you inherit all of the locator's basic qualities and functionality so the shape will automatically inherit the transform's matrices.

If you access the MPxLocatorNode's doc page, click on the member list link and you will see all inherent attrs, among them: worldMatrix and inverse, parentMatrix and inverse

These attrs are read only BTW

03-13-2010, 10:24 AM
I guess I didn't make myself too clear.
I want to make one locator node connect to each transform node of each polygon mesh shape in the scene.

03-13-2010, 11:46 AM
You want to use a MFnMatrixAttribute and make it isArray(true) to connect more than one matrix

CGTalk Moderation
03-13-2010, 11:46 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.