API: getting DAG path for input mesh
I'm writing a node where I've got a MFnData::kMesh attribute as input (called inputMesh). My trouble is I can't seem to get a DAG path to this input mesh.
In the compute method I do this:
MDagPath dagPath
MDataHandle inMeshDataHandle = data.inputValue(inputMesh);
MObject meshObj = inMeshDataHandle.asMesh();
MFnMesh meshFn(meshObj);
meshFn.getPath(&dagPath);
but getPath fails, telling me the object does not exist! The function set can read it fine, i.e. tell me how many edges the mesh has got etc, so why can't I get the path!? Please, does someone know what I'm doing wrong? This is driving me crazy!!