I am new to maya API , im trying to create a simple DGNode in C++ .. but i am not able to get the inputMesh from datablock
here is my code.. it compiled and loaded in maya succesfully .. after connecting pSphereShape1.worldMesh to myNode.inMesh[0] attr to myNode.inMesh[0]...
i am getting feeback form first 3 print command .my im trying to debug it using MGlobal::executeCommand
command.to print stuffs from maya. in my code third if condition fails.. ofcourse my 1st and 2nd if condition is ture
MStatus myNode::compute(const MPlug& plug, MDataBlock& data)
{
MStatus status;
if ((plug.parent() == aArray) || (plug == aArray))
{
MGlobal::executeCommand( "print \"\\nConnected to plug.\"" );
MObject thisNode = this->thisMObject();
//getting InMesh
MDataHandle inMeshHld = data.inputValue(aInMesh, &status);
CHECK_MSTATUS_AND_RETURN_IT(status);
MObject inMesh = inMeshHld.asMesh();
// condition 1
if (inMeshHld.type() != MFnData::kMesh)
{
MGlobal::executeCommand( "print \"\\nBad Geomentry type.\"" );
}
// condition 2
if ( inMesh.isNull() )
{
MGlobal::executeCommand( "print \"\\ninMesh is null.\"" );
}
// condition 3
if ((inMesh != MObject::kNullObj))
{
MGlobal::executeCommand( "print \"\\got inMeshGeo.\"" );
}
}
else
return MS::kUnknownParameter;
data.setClean( plug );
return MS::kSuccess;
}