jakub's comment

This commit is contained in:
Kayla Man 2023-06-22 21:51:58 +08:00
parent bb269ccb7d
commit 31f76563b8
2 changed files with 2 additions and 4 deletions

View file

@ -3162,5 +3162,4 @@ def is_headless():
Returns:
bool: headless
"""
headless = QtWidgets.QApplication.instance() is None
return headless
return QtWidgets.QApplication.instance() is None

View file

@ -26,8 +26,7 @@ def open_file(filepath):
# To remain in the same window, we have to clear the script and read
# in the contents of the workfile.
nuke.scriptClear()
headless = is_headless()
if not headless:
if not is_headless():
autosave = nuke.toNode("preferences")["AutoSaveName"].evaluate()
autosave_prmpt = "Autosave detected.\nWould you like to load the autosave file?" # noqa
if os.path.isfile(autosave) and nuke.ask(autosave_prmpt):