Hi. I am trying to read one of the plugs on Custom node in postConstructor.
But seems like I am not getting Object handle properly. And I read the old Alias web
site which says…
Issue:
I’m writing a custom MPxNode and want to make certain connections between it
and a scene node once its created. Can I make these connections in the
postConstructor? Has a node been fully created (with its plugs) at this point?
Solution:
It is safe to access and modify the node’s plug values within the
postConstructor() method. But it is not safe to connect plugs at this point.
This is because when the postConstructor is called, the node has not been added
to the dependency graph but the node itself and all its plugs have been created
and initialized. That’s why its safe to access and modify the plugs but you
can’t do any connections on the node.
Here is my code.
void ctNode :: PostConstructor(){
MObject thisNode=thisMObject();
MString lpath;
MPlug fpplug(thisNode,m_aFilePath);
fpplug.getValue(lpath);
MGlobal::displayInfo(lpath);
}
I am not sure what the problem is.I also tryed to use MFnDependencyNode to find a plug.
But it did not work neither.
Any Help would be appreciated.
Hiro