mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
add headless abstraction into command.py
This commit is contained in:
parent
5c399cbc17
commit
22ee8e1f93
3 changed files with 12 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
"""Host API required Work Files tool"""
|
||||
import os
|
||||
import nuke
|
||||
from qtpy import QtWidgets
|
||||
from .command import is_headless
|
||||
|
||||
|
||||
def file_extensions():
|
||||
|
|
@ -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 = QtWidgets.QApplication.instance() is None
|
||||
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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue