mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
🐛 don't call cmds.ogs() if in headless mode
This commit is contained in:
parent
b1c4e0d505
commit
971164cd7f
1 changed files with 5 additions and 3 deletions
|
|
@ -146,13 +146,15 @@ def suspended_refresh(suspend=True):
|
|||
|
||||
cmds.ogs(pause=True) is a toggle so we cant pass False.
|
||||
"""
|
||||
original_state = cmds.ogs(query=True, pause=True)
|
||||
original_state = None
|
||||
if not IS_HEADLESS:
|
||||
original_state = cmds.ogs(query=True, pause=True)
|
||||
try:
|
||||
if suspend and not original_state:
|
||||
if suspend and not original_state and not IS_HEADLESS:
|
||||
cmds.ogs(pause=True)
|
||||
yield
|
||||
finally:
|
||||
if suspend and not original_state:
|
||||
if suspend and not original_state and not IS_HEADLESS:
|
||||
cmds.ogs(pause=True)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue