I’m having a frustrating little issue trying to get the frame rate of my scene. The documentation is a little confusing since it doesn’t specify a type for the return for playbackSpeed(). Someone from Autodesk told me that it’s supposed to return an MTime. But when I try it with the code below I only get a return of 0. I’m hoping someone can help me out. Thanks!
https://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=__cpp_ref_class_m_anim_control_html
MTime sceneStartFrame = MAnimControl::minTime();
MTime sceneEndFrame = MAnimControl::maxTime();
MTime frameRate = MAnimControl::playbackSpeed();
double fSceneStartFrame = (int)sceneStartFrame.as(MTime::uiUnit());
double fSceneEndFrame = (int)sceneEndFrame.as(MTime::uiUnit());
double fFrameRate = (int)frameRate.as(MTime::uiUnit());
MGlobal::displayInfo( "Start Frame: " );
MGlobal::displayInfo(MString() + fSceneStartFrame);
MGlobal::displayInfo( "End Frame: " );
MGlobal::displayInfo(MString() + fSceneEndFrame);
MGlobal::displayInfo( "Frame Rate: " );
MGlobal::displayInfo(MString() + fFrameRate);