From 5c399cbc1781428f099e43ee648fedbc81b2773e Mon Sep 17 00:00:00 2001 From: Kayla Man Date: Thu, 22 Jun 2023 23:13:24 +0800 Subject: [PATCH] revert the headless function --- openpype/hosts/nuke/api/workio.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/nuke/api/workio.py b/openpype/hosts/nuke/api/workio.py index 4ec0766599..032a9fdda8 100644 --- a/openpype/hosts/nuke/api/workio.py +++ b/openpype/hosts/nuke/api/workio.py @@ -1,7 +1,7 @@ """Host API required Work Files tool""" import os import nuke -from openpype.hosts.nuke.api.lib import is_headless +from qtpy import QtWidgets def file_extensions(): @@ -26,7 +26,8 @@ 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() - if not is_headless(): + headless = QtWidgets.QApplication.instance() is None + if not 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):