Ejemplo n.º 1
0
    def populateUI(self, widget, exportItems, editMode=None):
        """
        Create Settings UI.
        """
        # create a layout with custom top and bottom widgets
        master_layout = QtGui.QVBoxLayout(widget)
        master_layout.setContentsMargins(0, 0, 0, 0)

        # add group box for shotgun stuff
        shotgun_groupbox = QtGui.QGroupBox(
            "Shotgun Shot and Sequence Creation Settings")
        master_layout.addWidget(shotgun_groupbox)
        shotgun_layout = QtGui.QVBoxLayout(shotgun_groupbox)

        # create some helpful text
        header_text = QtGui.QLabel()
        header_text.setText("""<big>Welcome to the Shotgun Shot Export!</big>
                      <p>When you are using the Shotgun Shot Processor, Shots and Sequences in<br>
                      Shotgun will be created based on your Hiero Project. Existing Shots will<br>
                      be updated with the latest cut lengths. Quicktimes for each shot will be <br>
                      sent to Screening Room for review when you use the special Shotgun <br>
                      Transcode plugin - all included and ready to go in the default preset.<br>&nbsp;
                      </p>
                      """)
        shotgun_layout.addWidget(header_text)

        # make space for the spreadsheet
        spreadsheet_widget = QtGui.QWidget()
        shotgun_layout.addWidget(spreadsheet_widget)
        layout = QtGui.QHBoxLayout(spreadsheet_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        properties = self._preset.properties().get(
            'shotgunShotCreateProperties', {})
        layout.addWidget(
            self._build_tag_selector_widget(exportItems, properties))
        layout.addStretch(1)

        footer_text = QtGui.QLabel()
        default_task_template = self.app.get_setting('default_task_template')
        footer_text.setText(
            "<p>Shots without any tags will be assigned the '%s' task template.</p>"
            % default_task_template)
        shotgun_layout.addWidget(footer_text)

        # add collate options
        collating_widget = QtGui.QWidget()
        shotgun_layout.addWidget(collating_widget)
        CollatingExporterUI.populateUI(self,
                                       collating_widget,
                                       properties,
                                       cut_support=self._cutsSupported())

        if self._cutsSupported():
            cut_type_layout = self._build_cut_type_layout(properties)
            shotgun_layout.addLayout(cut_type_layout)

        # add default settings from baseclass below
        default = QtGui.QWidget()
        master_layout.addWidget(default)
        ShotProcessorUI.populateUI(self, default, exportItems, editMode)
Ejemplo n.º 2
0
    def __init__(self, preset):
        ShotProcessorUI.__init__(self, preset)
        CollatingExporterUI.__init__(self)

        # Register an event handler for if/when the project is saved
        hiero.core.events.registerInterest('kAfterProjectSave',
                                           self.afterProjectSavedCallback)
Ejemplo n.º 3
0
    def populateUI(self, widget, exportItems, editMode=None):
        """
        Create Settings UI.
        """
        # create a layout with custom top and bottom widgets
        master_layout = QtGui.QVBoxLayout(widget)
        master_layout.setContentsMargins(0, 0, 0, 0)

        # add group box for shotgun stuff
        shotgun_groupbox = QtGui.QGroupBox("Shotgun Shot and Sequence Creation Settings")
        master_layout.addWidget(shotgun_groupbox)
        shotgun_layout = QtGui.QVBoxLayout(shotgun_groupbox)

        # create some helpful text
        header_text = QtGui.QLabel()
        header_text.setText("""<big>Welcome to the Shotgun Shot Export!</big>
                      <p>When you are using the Shotgun Shot Processor, Shots and Sequences in<br>
                      Shotgun will be created based on your Hiero Project. Existing Shots will<br>
                      be updated with the latest cut lengths. Quicktimes for each shot will be <br>
                      sent to Screening Room for review when you use the special Shotgun <br>
                      Transcode plugin - all included and ready to go in the default preset.<br>&nbsp;
                      </p>
                      """)
        shotgun_layout.addWidget(header_text)

        # make space for the spreadsheet
        spreadsheet_widget = QtGui.QWidget()
        shotgun_layout.addWidget(spreadsheet_widget)
        layout = QtGui.QHBoxLayout(spreadsheet_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        properties = self._preset.properties().get('shotgunShotCreateProperties', {})
        layout.addWidget(self._build_tag_selector_widget(exportItems, properties))
        layout.addStretch(1)

        footer_text = QtGui.QLabel()
        default_task_template = self.app.get_setting('default_task_template')
        footer_text.setText("<p>Shots without any tags will be assigned the '%s' task template.</p>" % default_task_template )
        shotgun_layout.addWidget(footer_text)

        # add collate options
        collating_widget = QtGui.QWidget()
        shotgun_layout.addWidget(collating_widget)
        CollatingExporterUI.populateUI(self, collating_widget, properties,
            cut_support=self._cutsSupported())

        if self._cutsSupported():
            cut_type_layout = self._build_cut_type_layout(properties)
            shotgun_layout.addLayout(cut_type_layout)

        # add default settings from baseclass below
        default = QtGui.QWidget()
        master_layout.addWidget(default)
        ShotProcessorUI.populateUI(self, default, exportItems, editMode)
Ejemplo n.º 4
0
 def __init__(self, preset):
     ShotProcessorUI.__init__(self, preset)
     self.auto_detect = True
     self.session = None
     self.selectedRow = -1
     self.selectedData = None
     self.kitsu_supported_files = ('png', 'jpg', 'mp4', 'mov', 'obj', 'pdf',
                                   'ma', 'mb', 'zip', 'rar', 'jpeg', 'svg',
                                   'blend', 'wmv', 'm4v', 'ai', 'comp',
                                   'exr', 'psd', 'hip', 'gif', 'ae', 'fla',
                                   'flv', 'swf')
     self.session = None
     events.registerInterest(events.EventType.kLoadedKitsuSession,
                             self.getSession)
     events.sendEvent(events.EventType.kRequestKitsuSession, None)
 def validate(self, exportItems):
     if self.newProject.isChecked() and self.uploadFull.isChecked():
         if self.prjNameEdit.text() == '':
             nuke.message('trnla project name cannot be empty')
             return False
         else:
             self.preset().properties(
             )["trnla_project_name"] = self.prjNameEdit.text()
             self.preset().properties()["trnla_project_id"] = False
     return ShotProcessorUI.validate(self, exportItems)
Ejemplo n.º 6
0
    def validate(self, exportItems):
        if self.session == -1:
            nuke.message("Please login to kitsu.")
            return False
        elif self.session == -2:
            nuke.message(
                "Your kitsu account does not have the permission to create shots."
            )
            return False
        elif self.session:
            if self.projectsC.currentRow() > 0:
                self.preset().properties(
                )["kitsuProjectID"] = self.projectsC.currentItem().data(
                    Qt.UserRole)
                self.preset().properties(
                )["kitsuTaskTypeName"] = self.tasksC.currentText()
                self.preset().properties(
                )["kitsuTaskStatusName"] = self.statusC.currentText()

                foundKitsuPrev = False
                for (exportPath, preset) in self._exportTemplate.flatten():
                    if "kitsuProjectID" in preset.properties():
                        foundKitsuPrev = True
                        if preset.properties()["file_type"] != "mov":
                            nuke.message(
                                "kitsu uploader current only supports mov file type. "
                            )
                            return False
                if foundKitsuPrev:
                    return ShotProcessorUI.validate(self, exportItems)
                else:
                    nuke.message(
                        "Did not find a KitsuPreviewExporter in the export structure."
                    )
                    return False
            else:
                nuke.message("Please select a kitsu project.")
                return False
        else:
            nuke.message("Unknown kitsu error.")
            return False
 def __init__(self, preset):
     ShotProcessorUI.__init__(self, preset)
    def populateUI(self, *args, **kwargs):
        (widget, taskUIWidget, exportItems) = args

        self.api_key = self.get_api_key()
        main_layout = QtWidgets.QVBoxLayout(widget)
        main_layout.setContentsMargins(0, 0, 0, 0)

        default = QtWidgets.QWidget()
        main_layout.addWidget(default)

        # Call Base Function
        ShotProcessorUI.populateUI(self, default, taskUIWidget, exportItems)

        self.trnla_layout = QVBoxLayout(widget)
        self.sectionFont = QFont("Tahoma", 14, QFont.Bold)

        # LOGO
        logo_png = path.abspath(
            path.dirname(path.relpath(__file__)).replace('\\', '/') +
            "/tarantula.png").replace('\\', '/')
        if logo_png:
            logo = QPixmap(logo_png)
        else:
            logo = QPixmap()
        self.logoLabel = QLabel(widget)
        self.logoLabel.setPixmap(
            logo.scaled(100, 50, Qt.KeepAspectRatio, Qt.SmoothTransformation))
        self.line = QFrame(widget)
        self.line.setFrameShape(QFrame.HLine)
        self.line.setFrameShadow(QFrame.Sunken)
        self.trnla_layout.addWidget(self.line)
        self.trnla_layout.addWidget(self.logoLabel)

        # Begin Make Rest of UI-------------------------------
        self.newProject = QCheckBox("New Project", widget)
        self.existProject = QCheckBox("Existing Project", widget)
        self.projectModesHBox = QHBoxLayout(widget)
        self.prjSelect = QComboBox(widget)
        self.prjNameEdit = QLineEdit(widget)
        self.prjSetupLayout = QVBoxLayout(widget)

        self.logout = QHBoxLayout()
        self.logoutBtn = QPushButton('Log Out')
        self.logoutBtn.clicked.connect(self.onLogOut)
        self.logout.addWidget(self.logoutBtn)
        self.logout.addStretch()

        self.message = QLabel(
            "<b><font color=\"#ff3030\">Not logged into Trn.la on this machine.</font></b>",
            widget)
        self.loginBtn = QPushButton('login')
        self.loginBtn.clicked.connect(lambda: self.showLogin(widget))
        self.login = QHBoxLayout()
        self.login.addWidget(self.loginBtn)
        self.login.addStretch()
        self.trnla_layout.addWidget(self.message)
        self.trnla_layout.addLayout(self.login)

        self.newProject.stateChanged.connect(self.onNewProjectChecked)
        self.existProject.stateChanged.connect(self.onExistProjectChecked)

        self.projectModesHBox.addWidget(self.newProject)
        self.projectModesHBox.addWidget(self.existProject)
        self.projectModesHBox.addStretch()

        # PROJECT NAME
        self.prjNameLabel = QLabel('project', widget)
        self.prjNameLabel.setFont(self.sectionFont)

        self.prjNameEdit.setPlaceholderText("enter a new project name")

        # PROJECT LIST
        self.prjSelect.setEditable(False)
        self.prjSelect.hide()
        self.prjSelect.currentTextChanged.connect(self.onProjectSelected)

        self.nam = QNetworkAccessManager()
        self.nam.finished.connect(self.readyRead)
        if self.api_key:
            self.requestProjects()

        # PROJECT SETUP LAYOUT
        self.prjSetupLayout.addWidget(self.prjNameLabel)
        self.prjSetupLayout.addWidget(self.prjNameEdit)
        self.prjSetupLayout.addWidget(self.prjSelect)

        # UPLOAD
        self.uploadLabel = QLabel('upload', widget)
        self.uploadFull = QCheckBox('upload full quality media', widget)
        self.uploadFull.stateChanged.connect(self.onUploadFullChecked)

        self.uploadLabel.setFont(self.sectionFont)
        self.upload_layout = QVBoxLayout(widget)
        self.upload_layout.addWidget(self.uploadLabel)
        self.upload_layout.addWidget(self.uploadFull)

        self.bot_row_layout = QHBoxLayout(widget)
        self.bot_row_layout.addLayout(self.upload_layout)

        # SETUP TRNLA LAYOUT
        self.trnla_layout.addLayout(self.projectModesHBox)
        self.trnla_layout.addLayout(self.prjSetupLayout)
        self.trnla_layout.addLayout(self.bot_row_layout)
        self.trnla_layout.addLayout(self.logout)
        self.newProject.setCheckState(Qt.Checked)
        # --------------------------------------------

        if self.api_key:
            # logged in ui
            QTimer.singleShot(0, lambda: self.loggedInMode(onStart=True))
        else:
            # logged out ui
            QTimer.singleShot(0, self.loggedOutMode)

        main_layout.addLayout(self.trnla_layout)
Ejemplo n.º 9
0
 def populateUI(self, processorUIWidget, taskUIWidget, exportItems):
     '''Populate processor ui with *exportItems*, with parent widget *processorUIWidget* or *taskUIWidget*.'''
     ShotProcessorUI.populateUI(self, processorUIWidget, taskUIWidget,
                                exportItems)
     FtrackProcessorUI.addFtrackProcessorUI(self, processorUIWidget,
                                            exportItems)
Ejemplo n.º 10
0
 def __init__(self, preset):
     '''Initialise processor ui with *preset*.'''
     ShotProcessorUI.__init__(self, preset)
     FtrackProcessorUI.__init__(self, preset)
Ejemplo n.º 11
0
    def populateUI(self, *args, **kwargs):
        """
        Create Settings UI.
        """

        # Update the preset version info based on the user hook
        self.updateVersionInfo()

        # NOTE:
        # This method's signature changed in NukeStudio/Hiero 10.5v1. So
        # we account for it by parsing the args.
        if self.app.get_nuke_version_tuple() >= (10, 5, 1):
            (widget, taskUIWidget, exportItems) = args
        else:
            (widget, exportItems, editMode) = args

        # create a layout with custom top and bottom widgets
        master_layout = QtGui.QHBoxLayout(widget)
        master_layout.setContentsMargins(0, 0, 0, 0)

        # add group box for shotgun stuff
        shotgun_groupbox = QtGui.QGroupBox(
            "Shotgun Shot and Sequence Creation Settings")
        master_layout.addWidget(shotgun_groupbox)
        shotgun_layout = QtGui.QVBoxLayout(shotgun_groupbox)

        # create some helpful text
        header_text = QtGui.QLabel()
        header_text.setWordWrap(True)
        header_text.setText("""
            <big>Welcome to the Shotgun Shot Exporter!</big>
            <p>When you are using the Shotgun Shot Processor, Shots and
            Sequences in Shotgun will be created based on the curent timeline.
            Existing Shots will be updated with the latest cut lengths.
            Quicktimes for each shot will be reviewable in the Media app when
            you use the special Shotgun Transcode plugin - all included and
            ready to go in the default preset.
            </p>
            """)
        shotgun_layout.addWidget(header_text)
        shotgun_layout.addSpacing(8)

        # make space for the spreadsheet
        spreadsheet_widget = QtGui.QWidget()
        shotgun_layout.addWidget(spreadsheet_widget)
        layout = QtGui.QHBoxLayout(spreadsheet_widget)
        layout.setContentsMargins(0, 0, 0, 0)
        properties = self._preset.properties().get(
            'shotgunShotCreateProperties', {})
        layout.addWidget(
            self._build_tag_selector_widget(exportItems, properties))
        layout.addStretch(1)

        footer_text = QtGui.QLabel()
        default_task_template = self.app.get_setting('default_task_template')
        footer_text.setText(
            "<p>Shots without any tags will be assigned the '%s' task template.</p>"
            % default_task_template)
        shotgun_layout.addWidget(footer_text)

        # add collate options
        collating_widget = QtGui.QWidget()
        shotgun_layout.addWidget(collating_widget)
        CollatingExporterUI.populateUI(self,
                                       collating_widget,
                                       properties,
                                       cut_support=self._cutsSupported())

        if self._cutsSupported():
            cut_type_layout = self._build_cut_type_layout(properties)
            shotgun_layout.addLayout(cut_type_layout)

        shotgun_layout.setSizeConstraint(QtGui.QLayout.SetFixedSize)

        # add default settings from baseclass below
        default = QtGui.QWidget()
        master_layout.addWidget(default)

        # As noted above, the signature for this method changed in 10.5v1 so we
        # must account for it when calling the base class.
        if self.app.get_nuke_version_tuple() >= (10, 5, 1):
            ShotProcessorUI.populateUI(self, default, taskUIWidget,
                                       exportItems)
        else:
            ShotProcessorUI.populateUI(self, default, exportItems, editMode)

        # Handle any custom widget work the user did via the custom_export_ui
        # hook.
        custom_widget = self._get_custom_widget(
            parent=widget,
            create_method="create_shot_processor_widget",
            get_method="get_shot_processor_ui_properties",
            set_method="set_shot_processor_ui_properties",
            properties=self._preset.properties()
            ["shotgunShotCreateProperties"],
        )

        if custom_widget is not None:
            layout.addWidget(custom_widget)
Ejemplo n.º 12
0
 def __init__(self, preset):
     ShotProcessorUI.__init__(self, preset)
     CollatingExporterUI.__init__(self)
Ejemplo n.º 13
0
 def __init__(self, preset):
     ShotProcessorUI.__init__(self, preset)
     CollatingExporterUI.__init__(self)