Get frame rate of the scene - python

Get frame rate of the scene - python

stepan.kment7WW22
Participant Participant
1,818 Views
2 Replies
Message 1 of 3

Get frame rate of the scene - python

stepan.kment7WW22
Participant
Participant

Hi,

 

is it possible to retrieve framerate of the FBX scene as set in MotionBuilder's transport window - I mean 30/120/PAL... etc. when the FBX file is loaded to FBX SDK (python)?

FbxTime object requires (obviously) this information when setting the time from number of frames.
Generally, curves are plotted (baken) at the scene's framerate and I'd like to use this identical framerate in the SDK at later pipeline stages (to step over frames when evaluating).

 

Thanks so much in advance,

Stepan

 

stepankment7WW22_0-1667386299585.png

 

0 Likes
Accepted solutions (1)
1,819 Views
2 Replies
Replies (2)
Message 2 of 3

stepan.kment7WW22
Participant
Participant
Accepted solution

Found it. the scene root object has a 'GlobalSettings' object bound to it (use root.GetSrcObject(..) to get reference to it).
This GlobalSettings object has properties, and among them, there is "TimeMode", and also "CustomFrameRate". The TimeMode is integer, one of fbx.FbxTime.eFrames120 and other items of the enum (so for FBX set to 120fps, the property is int(1) as fbx.FbxTime.eFrames120==1
When if it is fbx.FbxTime.eCustom, then I expect CustomFrameRate to hold actual user defined fps.

Aside of this, there is orientation of a reference frame's axes defined here and some other data.

0 Likes
Message 3 of 3

ilan.keshet
Enthusiast
Enthusiast

Funny enough.. 


@stepan.kment7WW22 wrote:

Found it. the scene root object has a 'GlobalSettings' object bound to it (use root.GetSrcObject(..) to get reference to it).
This GlobalSettings object has properties, and among them, there is "TimeMode", and also "CustomFrameRate". The TimeMode is integer, one of fbx.FbxTime.eFrames120 and other items of the enum (so for FBX set to 120fps, the property is int(1) as fbx.FbxTime.eFrames120==1
When if it is fbx.FbxTime.eCustom, then I expect CustomFrameRate to hold actual user defined fps.

Aside of this, there is orientation of a reference frame's axes defined here and some other data.


You'd certainly expect CustomFrameRate to hold actual user defined fps...   But When I've tried exporting out of Maya with wacky fps --   it does not get saved into the fbx, and comes out as eFrames30

0 Likes