Пример #1
0
    def _execute_within_exception_trap(self):
        """
        Execute the callback and log any exception that gets raised which may 
        otherwise have been swallowed by the deferred execution of the callback
        """

        try:
            ix.application.check_for_events()
            ix.application.disable()

            self.callback()
            from sgtk.platform.qt import QtGui

            qt_app = QtGui.QApplication.instance()
            import pyqt_clarisse
            pyqt_clarisse.exec_(qt_app)

        except Exception:
            (exc_type, exc_value, exc_traceback) = sys.exc_info()
            message = (
                "Message: Shotgun encountered a problem excutin an action from"
                " the Clarisse engine")
            message += "Exception: %s - %s\n" % (exc_type, exc_value)
            message += "Traceback (most recent call last):\n"
            message += "\n".join(traceback.format_tb(exc_traceback))

            current_engine = tank.platform.current_engine()
            current_engine.logger.exception(message)
        finally:
            ix.application.enable()
            ix.application.check_for_events()
Пример #2
0
def main(*args):
    global vfx_asset_manager

    try:
        vfx_asset_manager.close()
    except:
        pass

    if HostApp.in_clarisse():
        import pyqt_clarisse

        try:
            app = QtGui.QApplication(["Clarisse"])
        except:
            app = QtGui.QApplication.instance()

        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

        pyqt_clarisse.exec_(app)

    if HostApp.in_nuke():
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

    if HostApp.in_maya():
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

    if HostApp.in_shell():
        app = QtGui.QApplication(sys.argv)
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()
        sys.exit(app.exec_())
Пример #3
0
def main(*args):
    global vfx_asset_manager

    try:
        vfx_asset_manager.close()
    except:
        pass

    if HostApp.in_clarisse():
        import pyqt_clarisse

        try:
            app = QtGui.QApplication(["Clarisse"])
        except:
            app = QtGui.QApplication.instance()

        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

        pyqt_clarisse.exec_(app)

    if HostApp.in_nuke():
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

    if HostApp.in_maya():
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()

    if HostApp.in_shell():
        app = QtGui.QApplication(sys.argv)
        vfx_asset_manager = VFXAssetManager()
        vfx_asset_manager.show()
        sys.exit(app.exec_())
Пример #4
0
    def start_QApp(self):
        """Create the QApplication."""
        import pyqt_clarisse

        try:
            app = QtGui.QApplication(["Clarisse"])
        except:
            app = QtGui.QApplication.instance()

        pyqt_clarisse.exec_(app)
Пример #5
0
    def runUi(self):
        '''
        Launch the UI
        '''
        self.app = QtWidgets.QApplication(["Clarisse"])
        self.ui = uic.loadUi(os.path.join(RESOURCES_DIRPATH, 'clarisse.ui'))

        self.initializeUi()

        self.ui.show()
        pyqt_clarisse.exec_(self.app)
Пример #6
0
    def _initialise_qapplication(self):
        """
        Ensure the QApplication is initialized
        """
        from sgtk.platform.qt import QtGui

        qt_app = QtGui.QApplication.instance()
        if qt_app is None:

            self.log_debug("Initialising main QApplication...")
            qt_app = QtGui.QApplication([])
            qt_app.setWindowIcon(QtGui.QIcon(self.icon_256))
            qt_app.setQuitOnLastWindowClosed(False)

            # set up the dark style
            self._initialize_dark_look_and_feel()

        pyqt_clarisse.exec_(qt_app)
Пример #7
0
        enableJobSendDelayed()
    else:
        if Fields['archive_save'].isChecked():
            print('AF: Removing render archive.')
            os.remove( Archive)
        displayInfo('Unable send job to afserver.')

def genCommand():
    cmd = Fields['engine'].currentText()
    cmd += ' "%s"' % Archive
    cmd += ' -image "%s"' % Fields['image'].currentText()
    cmd += ' -start_frame @#@ -end_frame @#@ -frame_step %d' % Fields['frame_step'].value()
    cmd += ' -output "%s"' % Fields['output'].text()
    if len( Fields['format'].text()):
        cmd += ' -format "%s"' % Fields['format'].text()
    cmd += ' -log_width 0'
        # Zero log width disables output truncation at all.
        # This needed for correct output parsing.
    return cmd


# Create dialog:
Dialog = createDialog()
App.aboutToQuit.connect( Dialog.close)
displayInfo('CGRU Version: %s' % cgruconfig.VARS['CGRU_VERSION'])

# instead of calling app.exec_() like you would do normally in PyQt,
# you call pyqt_clarisse.exec_(app).
pyqt_clarisse.exec_(App)

    else:
        if Fields['archive_save'].isChecked():
            print('AF: Removing render archive.')
            os.remove(Archive)
        displayInfo('Unable send job to afserver.')


def genCommand():
    cmd = Fields['engine'].currentText()
    cmd += ' "%s"' % Archive
    cmd += ' -image "%s"' % Fields['image'].currentText()
    cmd += ' -start_frame @#@ -end_frame @#@ -frame_step %d' % Fields[
        'frame_step'].value()
    cmd += ' -output "%s"' % Fields['output'].text()
    if len(Fields['format'].text()):
        cmd += ' -format "%s"' % Fields['format'].text()
    cmd += ' -log_width 0'
    # Zero log width disables output truncation at all.
    # This needed for correct output parsing.
    return cmd


# Create dialog:
Dialog = createDialog()
App.aboutToQuit.connect(Dialog.close)
displayInfo('CGRU Version: %s' % cgruconfig.VARS['CGRU_VERSION'])

# instead of calling app.exec_() like you would do normally in PyQt,
# you call pyqt_clarisse.exec_(app).
pyqt_clarisse.exec_(App)