that's because you're looking for something that doesn't exist ![]()
This may be of some use to you: (especially the camera and transform sections)
http://nccastaff.bournemouth.ac.uk/jmacey/...earch/index.htm
Cameras are shape nodes, and don't have a direction vector you can query. Instead, you need to grab the parent matrix of the camera's transform node, and then grab the Z axis of that matrix (using the y axis of the matrix as your up vector). You can either get this by attaching an MFnTransform function set to it's parent (which can give you the local space transform components - eg scale, translate, pivots etc), like so....
CODE
MItDependencyNodes it(MFn::kCamera);
for(;!it.isDone();it.next())
{
MFnCamera fn(it.item());
MFnTransform fnX(fn.parent(0));
// now grab stuff from the fnX function set
}
or, you can grab the dag path for the node (which gives you a way to evaluate the world space matrices of that object). i.e.
CODE
MItDependencyNodes it(MFn::kCamera);
for(;!it.isDone();it.next())
{
MFnCamera fn(it.item());
MDagPath path;
fn.getPath(path);
// now grab matrix from the dag path
MMatrix worldSpace = path.inclusiveMatrix();
MVector upVector( worldSpace[1][0], worldSpace[1][1], worldSpace[1][2] );
MVector direction( worldSpace[2][0], worldSpace[2][1], worldSpace[2][2] );
MVector position( worldSpace[3][0], worldSpace[3][1], worldSpace[3][2] );
// or the local space TM if you prefer
MMatrix localSpace = path.exclusiveMatrix();
}