PDA

View Full Version : API getFilmFrustum


katisss
01-20-2008, 10:28 PM
I want to use
MStatus MFnCamera:: getFilmFrustum ( double distance, double& hSize, double& vSize, double& hOffset, double& vOffset ) const in python but i cant fins an examples and it's not working.
# TypeError: in method 'MFnCamera_getFilmFrustum', argument 3 of type 'double &' //
Do i need to send pointers really?


MStatus MFnCamera:: getFilmFrustum ( double distance, MPointArray clipPlanes ) const
would do but i get errors here when trying to extract data from MPointArray.
Please help

Gravedigger
01-20-2008, 10:51 PM
MStatus MFnCamera:: getFilmFrustum ( double distance, double& hSize, double& vSize, double& hOffset, double& vOffset )


yes you do need pointers because you want to get the values and they have to be stored somewhere. to do this you send the addresses of the variables in which you wan't to store the values.

what errors do you get with the MPointArray? how do you read it?

katisss
01-20-2008, 10:54 PM
There are no pointers in python except for c_types. I tried those but little difference.

For the MPointArray
fnCamera.getFilmFrustum(f1, cam_clipPlanes)
cam_clipPlanPoint= OpenMaya.MPoint()
cam_clipPlanPoint=cam_clipPlanes[0] # this causes an error

Then i looked into MFnPointArrayData and MDataHandle but it's a bit of overdone for extracing 4 points from an array, or is this the way?

katisss
01-21-2008, 03:24 PM
I found in c++ that getViewingFrustum seems to be in worldspace and is closer to what i want.
But it is also unhappy with the datype of the arguments:
# TypeError: in method 'MFnCamera_getViewingFrustum', argument 3 of type 'double &' //

CGTalk Moderation
01-21-2008, 03:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.