verbatimline
02-08-2010, 09:24 AM
Hi, I am writing a custom locator and want to access its worlPosition attribute. This attr is native to the MPxLocatorNode class. It is listed in the class's memberList. When I load my locator node in the connection editor the worldPosition attr is listed.
I wouls like to access this attribute within the locator's compute function. I am not able to access any of the attrs listed in the docs' member list, only the attrs I create.
I've tried using MPlugs:
MObject thisNode = thisMObject();
MFnDagNode dagFn( thisNode );
MPlug worldPosMPlug = dagFn.findPlug( worldPosition, &stat);
MPlug wpxPlug;
double xPos;
wpxPlug = worldPosMPlug.child(worldPositionX, &stat);
wpxPlug.getValue(xPos);
_PRINT_(xPos)
//I do this for every axis
//and all I get is zeros
Does anyone know why this is happening?
I wouls like to access this attribute within the locator's compute function. I am not able to access any of the attrs listed in the docs' member list, only the attrs I create.
I've tried using MPlugs:
MObject thisNode = thisMObject();
MFnDagNode dagFn( thisNode );
MPlug worldPosMPlug = dagFn.findPlug( worldPosition, &stat);
MPlug wpxPlug;
double xPos;
wpxPlug = worldPosMPlug.child(worldPositionX, &stat);
wpxPlug.getValue(xPos);
_PRINT_(xPos)
//I do this for every axis
//and all I get is zeros
Does anyone know why this is happening?
