Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix context change on save #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/tk_nuke/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ def __sgtk_on_save_callback():
logger.debug("New context computed to be: %r" % new_ctx)

# now restart the engine with the new context
__engine_refresh(new_ctx)
if curr_ctx != new_ctx:
__engine_refresh(new_ctx)

except Exception:
logger.exception("An exception was raised during addOnScriptSave callback.")
Expand Down Expand Up @@ -200,7 +201,8 @@ def sgtk_on_load_callback():
logger.debug("Current context: %r" % (curr_ctx,))
logger.debug("New context: %r" % (new_ctx,))
# Now switch to the context appropriate for the file
__engine_refresh(new_ctx)
if curr_ctx != new_ctx:
__engine_refresh(new_ctx)

elif file_name != "Root" and engine is None:
# we have no engine, this maybe because the integration disabled itself,
Expand Down