mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #467 from ynput/enhancement/enhancement_on_reset_frame_range_function
Maya: Enhancement on reset frame range based on fps
This commit is contained in:
commit
90a90109c5
1 changed files with 23 additions and 11 deletions
|
|
@ -2520,7 +2520,16 @@ def set_scene_fps(fps, update=True):
|
|||
"""
|
||||
|
||||
fps_mapping = {
|
||||
'2': '2fps',
|
||||
'3': '3fps',
|
||||
'4': '4fps',
|
||||
'5': '5fps',
|
||||
'6': '6fps',
|
||||
'8': '8fps',
|
||||
'10': '10fps',
|
||||
'12': '12fps',
|
||||
'15': 'game',
|
||||
'16': '16fps',
|
||||
'24': 'film',
|
||||
'25': 'pal',
|
||||
'30': 'ntsc',
|
||||
|
|
@ -2612,21 +2621,24 @@ def get_fps_for_current_context():
|
|||
Returns:
|
||||
Union[int, float]: FPS value.
|
||||
"""
|
||||
|
||||
project_name = get_current_project_name()
|
||||
folder_path = get_current_folder_path()
|
||||
folder_entity = ayon_api.get_folder_by_path(
|
||||
project_name, folder_path, fields={"attrib.fps"}
|
||||
) or {}
|
||||
fps = folder_entity.get("attrib", {}).get("fps")
|
||||
task_entity = get_current_task_entity(fields={"attrib"})
|
||||
fps = task_entity.get("attrib", {}).get("fps")
|
||||
if not fps:
|
||||
project_entity = ayon_api.get_project(
|
||||
project_name, fields=["attrib.fps"]
|
||||
project_name = get_current_project_name()
|
||||
folder_path = get_current_folder_path()
|
||||
folder_entity = ayon_api.get_folder_by_path(
|
||||
project_name, folder_path, fields={"attrib.fps"}
|
||||
) or {}
|
||||
fps = project_entity.get("attrib", {}).get("fps")
|
||||
|
||||
fps = folder_entity.get("attrib", {}).get("fps")
|
||||
if not fps:
|
||||
fps = 25
|
||||
project_entity = ayon_api.get_project(
|
||||
project_name, fields=["attrib.fps"]
|
||||
) or {}
|
||||
fps = project_entity.get("attrib", {}).get("fps")
|
||||
|
||||
if not fps:
|
||||
fps = 25
|
||||
|
||||
return convert_to_maya_fps(fps)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue