older versions of maya get fps from string <-> fps mapping

This commit is contained in:
antirotor 2018-12-15 12:24:29 +01:00
parent 83224fa85c
commit 928b516ad7
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7

View file

@ -1704,6 +1704,14 @@ def set_scene_fps(fps, update=True):
"""
fps_mapping = {'15': 'game',
'24': 'film',
'25': 'pal',
'30': 'ntsc',
'48': 'show',
'50': 'palf',
'60': 'ntscf'}
if fps in FLOAT_FPS:
unit = "{}fps".format(fps)
@ -1713,6 +1721,14 @@ def set_scene_fps(fps, update=True):
else:
raise ValueError("Unsupported FPS value: `%s`" % fps)
# get maya version
version = int(cmds.about(version=True))
if version < 2018:
# pull from mapping
unit = fps_mapping.get(str(int(fps)), None)
if unit is None:
raise ValueError("Unsupported FPS value: `%s`" % fps)
# Get time slider current state
start_frame = cmds.playbackOptions(query=True, minTime=True)
end_frame = cmds.playbackOptions(query=True, maxTime=True)