mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +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
|
|
@ -2,6 +2,8 @@ import logging
|
|||
import contextlib
|
||||
import nuke
|
||||
|
||||
from qtpy import QtWidgets
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
|
|
@ -19,3 +21,11 @@ def viewer_update_and_undo_stop():
|
|||
yield
|
||||
finally:
|
||||
nuke.Undo.enable()
|
||||
|
||||
|
||||
def is_headless():
|
||||
"""
|
||||
Returns:
|
||||
bool: headless
|
||||
"""
|
||||
return QtWidgets.QApplication.instance() is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue