meta_Nerd
04-07-2006, 01:09 AM
I am sure this question has been asked before, but I couldn't find anything. I am not new to programming or 3D scripting, but am very new to maya and mel. so here it goes...
I have got my view camera's position and rotation and I am doing some calculations and moving it to a new position and rotation. The problem is that as soon as I move that view in my viewport it snaps back to the original position. It seems as though a keyframe is not being made?
to get the current view camera I am using :string $editor=modelPanel ("-q", "-me", `getPanel -wf`);
string $currentCam=modelPanel ("-q", "-cam", `getPanel -wf`);
to get the camera pos and rot:float $myVec[] = `xform -q -t $currentCam`;// pos
$myVec = `xform -q -ro $currentCam`;// rot
to set the viewCamera pos and rot:xform -t -4.901924019 6.973366794 -5.247494302 $currentCam;
I even tried this to set the keyframe:setKeyframe -t 4 -v 1.5 ($currentCam+".translateX");
setKeyframe -t 4 -v 2.5 ($currentCam+".translatey");
setKeyframe -t 4 -v 3.5 ($currentCam+".translatez");
Can someone point me in the right direction please....
Chris Reid
maya 7.0
winXP
I have got my view camera's position and rotation and I am doing some calculations and moving it to a new position and rotation. The problem is that as soon as I move that view in my viewport it snaps back to the original position. It seems as though a keyframe is not being made?
to get the current view camera I am using :string $editor=modelPanel ("-q", "-me", `getPanel -wf`);
string $currentCam=modelPanel ("-q", "-cam", `getPanel -wf`);
to get the camera pos and rot:float $myVec[] = `xform -q -t $currentCam`;// pos
$myVec = `xform -q -ro $currentCam`;// rot
to set the viewCamera pos and rot:xform -t -4.901924019 6.973366794 -5.247494302 $currentCam;
I even tried this to set the keyframe:setKeyframe -t 4 -v 1.5 ($currentCam+".translateX");
setKeyframe -t 4 -v 2.5 ($currentCam+".translatey");
setKeyframe -t 4 -v 3.5 ($currentCam+".translatez");
Can someone point me in the right direction please....
Chris Reid
maya 7.0
winXP
