Exemplo 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)
Exemplo n.º 2
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)
    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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)