Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / SDK / Translating MfnCamera?
  RSS 2.0 ATOM  

Translating MfnCamera?
Rate this thread
 
39549
 
Permlink of this thread  
avatar
  • edubois
  • Posted: 08 February 2010 04:11 AM
  • Total Posts: 1
  • Joined: 08 February 2010 12:07 PM

Hi all,

I use maya 2009 and I have made a code that need to move a camera inside a callback (postRenderMsgCallback). 
I would like to know how to tell a MfnCamera to translate itself by a given vector.

Anybody know how to do so ?

I tried this, but it doesn’t work…

MFnDagNode dagFn(_camera.dagPath().node())
    MDagPath path
;
    
stat dagFn.getPath(path)
    MFnTransform transformFn(path)

    
static int i 0;
    
i++;
    
MVector v(i00)
    stat 
transformFn.translateBy(vMSpace::kWorld)

Thank you by advance.



Replies: 0
avatar
  • oodini
  • Posted: 16 February 2010 09:26 PM

You created a tranform object from the camera’s tranform, you updated it, but you didn’t apply it to the scene.



Replies: 0