Merge pull request #2987 from BigRoy/houdini_batch_no_hdefereval

Houdini: Avoid ImportError on `hdefereval` when Houdini runs without UI
This commit is contained in:
Ondřej Samohel 2022-04-11 11:41:06 +02:00 committed by GitHub
commit 1aab632005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,6 @@ import logging
import contextlib
import hou
import hdefereval
import pyblish.api
import avalon.api
@ -305,7 +304,13 @@ def on_new():
start = hou.playbar.playbackRange()[0]
hou.setFrame(start)
hdefereval.executeDeferred(_enforce_start_frame)
if hou.isUIAvailable():
import hdefereval
hdefereval.executeDeferred(_enforce_start_frame)
else:
# Run without execute deferred when no UI is available because
# without UI `hdefereval` is not available to import
_enforce_start_frame()
def _set_context_settings():