mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
use other popup, pass toggle to function
This commit is contained in:
parent
5cfc41c451
commit
85a320392e
1 changed files with 9 additions and 5 deletions
|
|
@ -1313,9 +1313,12 @@ def get_id_from_history(node):
|
|||
return _id
|
||||
|
||||
|
||||
def set_project_fps():
|
||||
def set_project_fps(update=True):
|
||||
"""Set FPS from project configuration
|
||||
|
||||
Args:
|
||||
update(bool): toggle update animation, default is True
|
||||
|
||||
Returns:
|
||||
None
|
||||
|
||||
|
|
@ -1336,7 +1339,7 @@ def set_project_fps():
|
|||
raise ("Unsupported FPS value: `%s`" % fps)
|
||||
|
||||
log.info("Updating FPS to '{}'".format(unit))
|
||||
cmds.currentUnit(time=unit)
|
||||
cmds.currentUnit(time=unit, updateAnimation=update)
|
||||
|
||||
# Force file stated to 'modified'
|
||||
cmds.file(modified=True)
|
||||
|
|
@ -1366,14 +1369,15 @@ def validate_fps():
|
|||
if parent is None:
|
||||
pass
|
||||
else:
|
||||
dialog = popup.Popup(parent=parent)
|
||||
dialog = popup.Popup2(parent=parent)
|
||||
dialog.setModal(True)
|
||||
dialog.setWindowTitle("Maya scene not in line with project")
|
||||
dialog.setMessage("The FPS is out of sync, please fix")
|
||||
|
||||
# Set new text for button (add optional argument for the popup?)
|
||||
dialog.widgets["show"].setText("Fix")
|
||||
dialog.on_show.connect(set_project_fps)
|
||||
toggle = dialog.widgets["toggle"]
|
||||
update = toggle.isChecked()
|
||||
dialog.on_show.connect(lambda: set_project_fps(update))
|
||||
|
||||
dialog.show()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue