Hi
I am writing a script to animate some gears and want to generate a continously rotating driver. There is no problem with generating this but I would like to set the frequency to an exact speed of rotation which is independant of Maya's framerate.
i.e. when generating the cycle a set a value of rotaation then adjsut time and set a keyfrmae, using a loop I generate the cycle and set it to post infinity and works OK.
But what I want is to set the time based on actual time not frames and to do this I want to query Maya's settings or preferences to find the user's frame rate and use this as a unit of time to index for each set rotation.
Maya's help files say to use the playbackOptions in query mode but this does not give me an answer as it keeps coming back 0.
Example of code from script.
// float $FpS = 60; // is commented out at the moment
float $FpS = playbackOptions -q -framesPerSecond;
print ("$FpS is " + $FpS + "\n");
result printed is $FpS is 0
rest of loop is below;
for ($k=0; $k<9; $k++)
{
$r = ($k * -45);
setAttr ($Drivers[0] + ".rotateX") $r;
setKeyframe -attribute "rotateX" -t ($k * $FpS) $Drivers[0];
float $Time = ($k * $FpS);
// print ("Current Time is " + $Time + " and ");
// print ( "Rotation is " + getAttr ($Drivers[0] + ".rotateX") + "..