mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
commit
45f9c14666
1 changed files with 20 additions and 0 deletions
|
|
@ -1404,9 +1404,29 @@ def set_scene_fps(fps, update=True):
|
|||
else:
|
||||
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)
|
||||
|
||||
# Get animation data
|
||||
animation_start = cmds.playbackOptions(query=True, animationStartTime=True)
|
||||
animation_end = cmds.playbackOptions(query=True, animationEndTime=True)
|
||||
|
||||
current_frame = cmds.currentTime(query=True)
|
||||
|
||||
log.info("Updating FPS to '{}'".format(unit))
|
||||
cmds.currentUnit(time=unit, updateAnimation=update)
|
||||
|
||||
# Set time slider data back to previous state
|
||||
cmds.playbackOptions(edit=True, minTime=start_frame)
|
||||
cmds.playbackOptions(edit=True, maxTime=end_frame)
|
||||
|
||||
# Set animation data
|
||||
cmds.playbackOptions(edit=True, animationStartTime=animation_start)
|
||||
cmds.playbackOptions(edit=True, animationEndTime=animation_end)
|
||||
|
||||
cmds.currentTime(current_frame, edit=True, update=True)
|
||||
|
||||
# Force file stated to 'modified'
|
||||
cmds.file(modified=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue