-
Notifications
You must be signed in to change notification settings - Fork 5
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
Include context switching during regular File->Open operation #17
base: master
Are you sure you want to change the base?
Conversation
#if we don't have an engine, we'll need to do some of the legwork ourselves | ||
def showWarningDialog(message, details=None): | ||
|
||
parent=QtGui.QApplication.activeWindow() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
local variable 'parent' is assigned to but never used
missing whitespace around operator
over-indented
|
||
#if we don't have an engine, we'll need to do some of the legwork ourselves | ||
def showWarningDialog(message, details=None): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
indentation contains tabs
self._layout.addWidget(self._text) | ||
|
||
#if we don't have an engine, we'll need to do some of the legwork ourselves | ||
def showWarningDialog(message, details=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
self._layout.addWidget(self._label) | ||
self._layout.addWidget(self._text) | ||
|
||
#if we don't have an engine, we'll need to do some of the legwork ourselves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
self._layout = QtGui.QVBoxLayout(self) | ||
self._layout.addWidget(self._label) | ||
self._layout.addWidget(self._text) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
indentation contains tabs
|
||
self._label = QtGui.QLabel("<h3>"+message+"</h3>") | ||
self._label.setTextFormat(QtCore.Qt.RichText) | ||
self._text = QtGui.QTextEdit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
self.setObjectName("SGTK_WARNING_DIALOG") | ||
|
||
self._label = QtGui.QLabel("<h3>"+message+"</h3>") | ||
self._label.setTextFormat(QtCore.Qt.RichText) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
|
||
self.setObjectName("SGTK_WARNING_DIALOG") | ||
|
||
self._label = QtGui.QLabel("<h3>"+message+"</h3>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
missing whitespace around arithmetic operator
|
||
super(WarningDialog, self).__init__(*args, **kwargs) | ||
|
||
self.setObjectName("SGTK_WARNING_DIALOG") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
def __init__(self, message, details=None, *args, **kwargs): | ||
|
||
super(WarningDialog, self).__init__(*args, **kwargs) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
indentation contains tabs
|
||
def __init__(self, message, details=None, *args, **kwargs): | ||
|
||
super(WarningDialog, self).__init__(*args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
over-indented
class WarningDialog(QtGui.QWidget): | ||
|
||
def __init__(self, message, details=None, *args, **kwargs): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
indentation contains tabs
#if we have an engine, we can simply use this class | ||
class WarningDialog(QtGui.QWidget): | ||
|
||
def __init__(self, message, details=None, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation contains tabs
over-indented
|
||
#if we have an engine, we can simply use this class | ||
class WarningDialog(QtGui.QWidget): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
indentation contains tabs
from sgtk.platform.qt import QtGui, QtCore #@UnresolvedImport | ||
|
||
#if we have an engine, we can simply use this class | ||
class WarningDialog(QtGui.QWidget): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
#but leave tools that can direct a user back to the correct context (ie Workfiles) | ||
|
||
#engine._remove_shotgun_menu() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
#TODO: replace with command that just remove tools requiring specific context (ie Publish) | ||
#but leave tools that can direct a user back to the correct context (ie Workfiles) | ||
|
||
#engine._remove_shotgun_menu() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
|
||
#TODO: replace with command that just remove tools requiring specific context (ie Publish) | ||
#but leave tools that can direct a user back to the correct context (ie Workfiles) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
logger.exception("Engine could not be started.") | ||
|
||
#TODO: replace with command that just remove tools requiring specific context (ie Publish) | ||
#but leave tools that can direct a user back to the correct context (ie Workfiles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
# context was not sufficient! - disable tank! | ||
logger.exception("Engine could not be started.") | ||
|
||
#TODO: replace with command that just remove tools requiring specific context (ie Publish) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
Switches from using the support email alias to pointing to the support site
except sgtk.TankEngineInitError as e: | ||
# context was not sufficient! - disable tank! | ||
logger.exception("Engine could not be started.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
) | ||
sgtk.platform.start_engine(engine_name, new_context.sgtk, new_context) | ||
|
||
except sgtk.TankEngineInitError as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local variable 'e' is assigned to but never used
) | ||
) | ||
sgtk.platform.start_engine(engine_name, new_context.sgtk, new_context) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
logger.debug( | ||
"Starting new engine: %s, %s, %s" % ( | ||
engine_name, | ||
new_context.sgtk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
try: | ||
logger.debug( | ||
"Starting new engine: %s, %s, %s" % ( | ||
engine_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
logger.debug("SGTK Registering onLoad callback") | ||
MaxPlus.NotificationManager.Register(MaxPlus.NotificationCodes.FilePostOpen, PostOpenProcess) | ||
g_tank_callbacks_registered = True | ||
#else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
logger.debug("Setting up 3dsMax Context Switching callbacks") | ||
|
||
# we'll assume context switching is allowed for now | ||
#if engine.get_setting("automatic_context_switch"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
block comment should start with '# '
""" | ||
|
||
global g_tank_callbacks_registered | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
there is no current script open in your Nuke session. If there is a script currently open then this will spawn a | ||
new Nuke instance and the callback won't be called. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace
details=error) | ||
return | ||
|
||
def tank_ensure_callbacks_registered(engine=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected 2 blank lines, found 1
Pulled mostly from similar code in the tk-nuke engine, adapted to 3dsMax. I wasn't able to do testing in the environment without an "engine", since I don't understand how that could occur in our standard environment.