My current node tree:
MpXTransform (MT)
|------- MyNodeBase (NB)
|------- Subclassed Again (SA)
I am having issues performing any “normal” operations on a node via the virtual overrides.
The (NB) node defines a bunch of attributes. I want to manage it’s layer within it’s class (who wouldn’t!)
So say I have a name attribute in the NB node. The SA node gets the name attribute via the inheritance and all is well. I can see it in Maya, I can manipulate it via connections, set, get, etc…
Now, when I connect it, I have the virtual “connectionMade” overridden in the base (NB) class.
SA has no connectionMade virtual – so! it rightly flows up from SA–>NB and does indeed use the virtual defined there.
Now the problem:
MStatus NB::connectionBroken( const MPlug& plug, const MPlug& otherPlug, bool asSrc )
{
MObject thisNode = this->thisMObject();
MPlug controlPlug( thisNode, control );
if (plug == control)
{
MSG_INFO( "Disconnection made from Control input" );
}
return MS::kUnknownParameter;
}
Does not seem to work when in fact I connect the control plug of any node inherited from the NB node.
I threw some prints in there to make sure it is calling the virtual, and it does, however the plug address is no where close to the defined address of the static MObject control attribute defined in the base class.
I am thinking that the bottom class (SA) “attributes” defined in the upper class (NB) are somehow not referring to the baseClass attributes.
If anyone has experience trying the same thing (with inheritance and discovering the attributes, etc…) or can see that I am just doing something completely broken =) help is very appreciated.
Cheers.