예제 #1
0
    def setup_ui(self):
        """add tools
        """
        # create the main tab layout
        main_tab_widget = QtWidgets.QTabWidget(self.widget())
        self.addWidget(main_tab_widget)

        # add the General Tab
        general_tab_widget = QtWidgets.QWidget(self.widget())
        general_tab_vertical_layout = QtWidgets.QVBoxLayout()
        general_tab_widget.setLayout(general_tab_vertical_layout)

        main_tab_widget.addTab(general_tab_widget, 'Generic')

        # Create tools for general tab

        from anima.ui.utils import add_button
        # -------------------------------------------------------------------
        # Per Clip Output Generator
        add_button('Per Clip Output Generator', general_tab_vertical_layout,
                   GenericTools.per_clip_output_generator)

        # Clip Output Generator
        # create a new layout
        layout = QtWidgets.QHBoxLayout()
        general_tab_vertical_layout.addLayout(layout)

        clip_index_spinbox = QtWidgets.QSpinBox()
        clip_index_spinbox.setMinimum(1)

        version_spinbox = QtWidgets.QSpinBox()
        version_spinbox.setMinimum(1)

        def clip_output_generator_wrapper():
            clip_index = clip_index_spinbox.value()
            version_number = version_spinbox.value()
            GenericTools.clip_output_generator(clip_index, version_number)

        add_button('Clip Output Generator', layout,
                   clip_output_generator_wrapper)
        layout.addWidget(clip_index_spinbox)
        layout.addWidget(version_spinbox)

        # -------------------------------------------------------------------
        # Add the stretcher
        general_tab_vertical_layout.addStretch()
예제 #2
0
    def _setup_ui(self):
        """create UI elements
        """
        self.resize(517, 545)
        self.verticalLayout = QtWidgets.QVBoxLayout(self)

        self.setWindowTitle("Project Dialog")

        # ----------------------
        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('%s Project' % self.mode)
        self.dialog_label.setStyleSheet(
            "color: rgb(71, 143, 202);\nfont: 18pt;")
        self.verticalLayout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.verticalLayout.addWidget(self.line)

        self.project_info_formLayout = QtWidgets.QFormLayout()
        self.project_info_formLayout.setLabelAlignment(
            QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing
            | QtCore.Qt.AlignVCenter)

        # ----------------------
        # Name Fields
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setText("Name")
        self.project_info_formLayout.setWidget(0,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.name_label)

        self.name_fields_verticalLayout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setText("Validator Message")
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_fields_verticalLayout.addWidget(self.name_validator_label)
        self.project_info_formLayout.setLayout(0,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.name_fields_verticalLayout)

        # add name_lineEdit
        from anima.ui.widgets import ValidatedLineEdit
        self.name_lineEdit = ValidatedLineEdit(
            message_field=self.name_validator_label)
        self.name_fields_verticalLayout.insertWidget(0, self.name_lineEdit)

        # ----------------------
        # Code Fields
        self.code_label = QtWidgets.QLabel(self)
        self.code_label.setText("Code")
        self.project_info_formLayout.setWidget(1,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.code_label)
        self.code_fields_verticalLayout = QtWidgets.QVBoxLayout()
        self.code_validator_label = QtWidgets.QLabel(self)
        self.code_validator_label.setText("Validator Message")
        self.code_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.code_fields_verticalLayout.addWidget(self.code_validator_label)
        self.project_info_formLayout.setLayout(1,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.code_fields_verticalLayout)

        # add code_lineEdit
        self.code_lineEdit = ValidatedLineEdit(
            message_field=self.code_validator_label)
        self.code_fields_verticalLayout.insertWidget(0, self.code_lineEdit)

        # ----------------------
        # Type Fields
        self.type_label = QtWidgets.QLabel(self)
        self.type_label.setText("Type")
        self.project_info_formLayout.setWidget(2,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.type_label)
        self.type_comboBox = QtWidgets.QComboBox(self)
        self.type_comboBox.setEditable(True)
        self.project_info_formLayout.setWidget(2,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.type_comboBox)

        # ----------------------
        # Date Fields
        self.date_label = QtWidgets.QLabel(self)
        self.date_label.setText("Date")
        self.project_info_formLayout.setWidget(3,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.date_label)
        self.date_dateEdit = QtWidgets.QDateEdit(self)
        self.project_info_formLayout.setWidget(3,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.date_dateEdit)

        # ----------------------
        # Image Format Fields
        from anima.ui.widgets.image_format import ImageFormatWidget
        self.image_format = ImageFormatWidget(
            parent=self,
            parent_form_layout=self.project_info_formLayout,
            parent_form_layout_index=4)

        # ----------------------
        # FPS Fields
        self.fps_label = QtWidgets.QLabel(self)
        self.fps_label.setText("FPS")
        self.project_info_formLayout.setWidget(5,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.fps_label)
        self.fps_spinBox = QtWidgets.QSpinBox(self)
        self.fps_spinBox.setMinimum(1)
        self.fps_spinBox.setProperty("value", 25)
        self.project_info_formLayout.setWidget(5,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.fps_spinBox)

        # ----------------------
        # Repository Fields
        self.repository_label = QtWidgets.QLabel(self)
        self.repository_label.setText("Repository")
        self.project_info_formLayout.setWidget(6,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.repository_label)
        self.repository_horizontalLayout = QtWidgets.QHBoxLayout()
        self.repository_comboBox = QtWidgets.QComboBox(self)
        self.repository_horizontalLayout.addWidget(self.repository_comboBox)

        # Update Repository Push Button
        self.update_repository_pushButton = QtWidgets.QPushButton(self)
        self.update_repository_pushButton.setText("Update...")
        self.repository_horizontalLayout.addWidget(
            self.update_repository_pushButton)

        # Create Repository Push Button
        self.create_repository_pushButton = QtWidgets.QPushButton(self)
        self.create_repository_pushButton.setText("New...")
        self.repository_horizontalLayout.addWidget(
            self.create_repository_pushButton)

        self.repository_horizontalLayout.setStretch(0, 1)
        self.project_info_formLayout.setLayout(
            6, QtWidgets.QFormLayout.FieldRole,
            self.repository_horizontalLayout)

        # ----------------------
        self.structure_label = QtWidgets.QLabel(self)
        self.structure_label.setText("Structure")

        self.project_info_formLayout.setWidget(7,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.structure_label)
        self.structure_horizontalLayout = QtWidgets.QHBoxLayout()
        self.structure_comboBox = QtWidgets.QComboBox(self)
        self.structure_horizontalLayout.addWidget(self.structure_comboBox)

        # Update Structure Push Button
        self.update_structure_pushButton = QtWidgets.QPushButton(self)
        self.update_structure_pushButton.setText("Update...")
        self.structure_horizontalLayout.addWidget(
            self.update_structure_pushButton)

        # Create Structure Push Button
        self.create_structure_pushButton = QtWidgets.QPushButton(self)
        self.create_structure_pushButton.setText("New...")
        self.structure_horizontalLayout.addWidget(
            self.create_structure_pushButton)

        self.structure_horizontalLayout.setStretch(0, 1)
        self.project_info_formLayout.setLayout(7,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.structure_horizontalLayout)

        # ----------------------
        # Status Fields
        self.status_label = QtWidgets.QLabel(self)
        self.status_label.setText("Status")
        self.project_info_formLayout.setWidget(8,
                                               QtWidgets.QFormLayout.LabelRole,
                                               self.status_label)
        self.status_comboBox = QtWidgets.QComboBox(self)
        self.project_info_formLayout.setWidget(8,
                                               QtWidgets.QFormLayout.FieldRole,
                                               self.status_comboBox)
        self.verticalLayout.addLayout(self.project_info_formLayout)

        # ----------------------
        # Client Fields
        self.client_info_label = QtWidgets.QLabel(self)
        self.client_info_label.setText("Client Info")
        self.client_info_label.setStyleSheet(
            "color: rgb(71, 143, 202);\nfont: 18pt;")
        self.verticalLayout.addWidget(self.client_info_label)
        self.line_2 = QtWidgets.QFrame(self)
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.verticalLayout.addWidget(self.line_2)
        self.client_info_formLayout = QtWidgets.QFormLayout()
        self.client_info_formLayout.setLabelAlignment(QtCore.Qt.AlignRight
                                                      | QtCore.Qt.AlignTrailing
                                                      | QtCore.Qt.AlignVCenter)

        # Client Fields
        self.client_label = QtWidgets.QLabel(self)
        self.client_label.setText("Client")
        self.client_info_formLayout.setWidget(0,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.client_label)
        self.client_comboBox = QtWidgets.QComboBox(self)
        self.client_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(0,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.client_comboBox)

        # Agency Fields
        self.agency_label = QtWidgets.QLabel(self)
        self.agency_label.setText("Agency")
        self.client_info_formLayout.setWidget(1,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.agency_label)
        self.agency_comboBox = QtWidgets.QComboBox(self)
        self.agency_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(1,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.agency_comboBox)

        # Production Company Fields
        self.production_company_label = QtWidgets.QLabel(self)
        self.production_company_label.setText(
            "<html><head/><body><p align=\"right\">Production<br/>"
            "Company</p></body></html>")

        self.client_info_formLayout.setWidget(2,
                                              QtWidgets.QFormLayout.LabelRole,
                                              self.production_company_label)
        self.production_company_comboBox = QtWidgets.QComboBox(self)
        self.production_company_comboBox.setEditable(True)
        self.client_info_formLayout.setWidget(2,
                                              QtWidgets.QFormLayout.FieldRole,
                                              self.production_company_comboBox)
        self.verticalLayout.addLayout(self.client_info_formLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(self)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Ok)
        self.verticalLayout.addWidget(self.buttonBox)
        self.verticalLayout.setStretch(2, 2)
        self.verticalLayout.setStretch(5, 1)
예제 #3
0
    def create(self, parent=None):
        """Creates the fields under the given layout
        :param parent:
        :return:
        """
        self.parent = parent

        # Main Layout
        self.layout = QtWidgets.QHBoxLayout(parent)
        layout_widget = self.layout.widget()

        # Shot Name Field
        self.shot_name_field = QtWidgets.QLineEdit(layout_widget)
        self.layout.addWidget(self.shot_name_field)

        # FBX file field
        self.fbx_file_field = QtWidgets.QLineEdit(layout_widget)
        self.fbx_file_field.setPlaceholderText("Choose FBX File")
        self.layout.addWidget(self.fbx_file_field)

        # FBX Button
        self.fbx_choose_button = QtWidgets.QPushButton(layout_widget)
        self.fbx_choose_button.setText("...")
        self.layout.addWidget(self.fbx_choose_button)

        # Video file field
        self.video_file_field = QtWidgets.QLineEdit(layout_widget)
        self.video_file_field.setPlaceholderText("Choose Video File")
        self.layout.addWidget(self.video_file_field)

        # FBX Button
        self.video_choose_button = QtWidgets.QPushButton(layout_widget)
        self.video_choose_button.setText("...")
        self.layout.addWidget(self.video_choose_button)

        # Cut in Field
        self.cut_in_field = QtWidgets.QSpinBox()
        self.cut_in_field.setMinimum(0)
        self.cut_in_field.setMaximum(9999999)
        self.layout.addWidget(self.cut_in_field)

        # Cut out Field
        self.cut_out_field = QtWidgets.QSpinBox()
        self.cut_out_field.setMinimum(0)
        self.cut_out_field.setMaximum(9999999)
        self.layout.addWidget(self.cut_out_field)

        # FPS Field
        self.fps_field = QtWidgets.QDoubleSpinBox()
        self.fps_field.setMinimum(0)
        self.fps_field.setMaximum(9999999)
        self.fps_field.setDecimals(2)
        self.layout.addWidget(self.fps_field)

        # Delete Button
        self.delete_push_button = QtWidgets.QPushButton(layout_widget)
        self.delete_push_button.setText("Delete")
        self.layout.addWidget(self.delete_push_button)

        # Signals
        import functools

        # Choose FBX Push Button
        QtCore.QObject.connect(
            self.fbx_choose_button, QtCore.SIGNAL("clicked()"),
            functools.partial(self.fbx_choose_button_clicked))

        # Choose Video Push Button
        QtCore.QObject.connect(
            self.video_choose_button, QtCore.SIGNAL("clicked()"),
            functools.partial(self.video_choose_button_clicked))

        QtCore.QObject.connect(self.delete_push_button,
                               QtCore.SIGNAL("clicked()"),
                               functools.partial(self.delete))

        QtCore.QObject.connect(
            self.video_file_field, QtCore.SIGNAL("editingFinished()"),
            functools.partial(self.video_file_field_changed))
예제 #4
0
    def setup_ui(self):
        self.resize(328, 184)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);\n"
                                        "font: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)
        self.line = QtWidgets.QFrame(self)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(self.line)
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(0, QtWidgets.QFormLayout.FieldRole,
                                   self.name_fields_vertical_layout)
        self.width_height_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                   self.width_height_label)
        self.horizontal_layout = QtWidgets.QHBoxLayout()
        self.width_spin_box = QtWidgets.QSpinBox(self)
        self.width_spin_box.setMaximum(99999)
        self.horizontal_layout.addWidget(self.width_spin_box)
        self.label = QtWidgets.QLabel(self)
        self.horizontal_layout.addWidget(self.label)
        self.height_spin_box = QtWidgets.QSpinBox(self)
        self.height_spin_box.setMaximum(99999)
        self.horizontal_layout.addWidget(self.height_spin_box)
        self.horizontal_layout.setStretch(0, 1)
        self.horizontal_layout.setStretch(2, 1)
        self.form_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole,
                                   self.horizontal_layout)
        self.pixel_aspect_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                   self.pixel_aspect_label)
        self.pixel_aspect_double_spin_box = QtWidgets.QDoubleSpinBox(self)
        self.pixel_aspect_double_spin_box.setProperty("value", 1.0)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                   self.pixel_aspect_double_spin_box)
        self.name_label = QtWidgets.QLabel(self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.vertical_layout.addLayout(self.form_layout)
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                           | QtWidgets.QDialogButtonBox.Ok)
        self.vertical_layout.addWidget(self.button_box)
        self.vertical_layout.setStretch(2, 1)

        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("rejected()"),
                               self.reject)
        QtCore.QMetaObject.connectSlotsByName(self)

        self.setWindowTitle("Image Format Dialog")
        self.dialog_label.setText("Create Image Format")
        self.name_validator_label.setText("Validator Message")
        self.width_height_label.setText("Width x Height")
        self.label.setText("x")
        self.pixel_aspect_label.setText("Pixel Aspect")
        self.name_label.setText("Name")
예제 #5
0
파일: rigging.py 프로젝트: ElonGame/anima
    def _setup_ui(self):
        """the ui
        """
        self.resize(243, 209)

        # from anima.ui.lib import QtWidgets
        # if False:
        #     from PySide2 import QtWidgets
        # assert QtWidgets is QtWidgets
        from PySide2 import QtWidgets

        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(self.vertical_layout)
        self.vertical_layout.setStretch(2, 1)

        self.setWindowTitle(self.dialog_name)

        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setFieldGrowthPolicy(
            QtWidgets.QFormLayout.AllNonFixedFieldsGrow
        )
        self.form_layout.setLabelAlignment(
            QtCore.Qt.AlignRight |
            QtCore.Qt.AlignTrailing |
            QtCore.Qt.AlignVCenter
        )

        label_role = QtWidgets.QFormLayout.LabelRole
        field_role = QtWidgets.QFormLayout.FieldRole

        form_field_index = -1
        # --------------------
        # Number of Joints Field
        form_field_index += 1

        # Label
        self.number_of_joints_label = QtWidgets.QLabel(self)
        self.number_of_joints_label.setText("Number Of Joints")

        self.form_layout.setWidget(
            form_field_index, label_role, self.number_of_joints_label,
        )

        # Field
        self.number_of_joints_spin_box = QtWidgets.QSpinBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.number_of_joints_spin_box
        )
        self.number_of_joints_spin_box.setValue(2)
        self.number_of_joints_spin_box.setMinimum(2)

        # -----------------------
        # Orientation
        form_field_index += 1

        # Label
        self.orientation_label = QtWidgets.QLabel(self)
        self.orientation_label.setText("Orientation")
        self.form_layout.setWidget(
            form_field_index, label_role, self.orientation_label
        )

        # Field
        self.orientation_combo_box = QtWidgets.QComboBox(self)
        self.orientation_combo_box.addItems(
            [
                "xyz",
                "yzx",
                "zxy",
                "xzy",
                "yxz",
                "zyx",
            ]
        )

        self.form_layout.setWidget(
            form_field_index, field_role, self.orientation_combo_box
        )

        # ---------------------------
        # Second Axis World Orientation
        form_field_index += 1

        # Label
        self.second_axis_world_orientation_label = QtWidgets.QLabel(self)
        self.second_axis_world_orientation_label.setText(
            "Second Axis World Orientation"
        )
        self.form_layout.setWidget(
            form_field_index, label_role,
            self.second_axis_world_orientation_label
        )

        # Field
        self.second_axis_world_orientation_combo_box = \
            QtWidgets.QComboBox(self)
        self.second_axis_world_orientation_combo_box.addItems(
            [
                "+x",
                "-x",
                "+y",
                "-y",
                "+z",
                "-z",
            ]
        )
        self.form_layout.setWidget(
            form_field_index, field_role,
            self.second_axis_world_orientation_combo_box
        )

        # --------------------------------
        # Align To World
        form_field_index += 1

        # Label
        self.align_to_world_label = QtWidgets.QLabel(self)
        self.align_to_world_label.setText("Align To World")
        self.form_layout.setWidget(
            form_field_index, label_role, self.align_to_world_label
        )

        # Field
        self.align_to_world_check_box = QtWidgets.QCheckBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.align_to_world_check_box
        )

        # ----------------------------------
        # Reverse Curve
        form_field_index += 1

        # Label
        self.reverse_curve_label = QtWidgets.QLabel(self)
        self.reverse_curve_label.setText("Reverse Curve")
        self.form_layout.setWidget(
            form_field_index, label_role, self.reverse_curve_label
        )

        self.reverse_curve_check_box = QtWidgets.QCheckBox(self)
        self.form_layout.setWidget(
            form_field_index, field_role, self.reverse_curve_check_box
        )

        # -------------------------------
        # Joint Names
        form_field_index += 1

        # Label
        self.joint_names_label = QtWidgets.QLabel(self)
        self.joint_names_label.setText("Joint Names")
        self.form_layout.setWidget(
            form_field_index, label_role, self.joint_names_label
        )

        # Field
        self.joint_names_layout = QtWidgets.QHBoxLayout(self)
        self.joint_names_check_box = QtWidgets.QCheckBox(self)
        self.joint_names_line_edit = QtWidgets.QLineEdit(self)
        self.joint_names_line_edit.setText("joint")
        self.joint_names_line_edit.setEnabled(False)

        self.joint_names_layout.addWidget(self.joint_names_check_box)
        self.joint_names_layout.addWidget(self.joint_names_line_edit)

        self.form_layout.setLayout(
            form_field_index, field_role, self.joint_names_layout
        )

        # setup signals
        QtCore.QObject.connect(
            self.joint_names_check_box,
            QtCore.SIGNAL("stateChanged(int)"),
            self.joint_names_line_edit.setEnabled
        )

        # ------------------------
        # Suffix Joint Names
        form_field_index += 1

        # Label
        self.suffix_joint_names_label = QtWidgets.QLabel(self)
        self.suffix_joint_names_label.setText("Suffix Joint Names")
        self.form_layout.setWidget(
            form_field_index, label_role, self.suffix_joint_names_label
        )

        # Field
        self.suffix_joint_names_layout = QtWidgets.QHBoxLayout(self)
        self.suffix_joint_names_check_box = QtWidgets.QCheckBox(self)
        self.suffix_joint_names_line_edit = QtWidgets.QLineEdit(self)
        self.suffix_joint_names_line_edit.setText("_suffix")
        self.suffix_joint_names_line_edit.setEnabled(False)

        self.suffix_joint_names_layout.addWidget(
            self.suffix_joint_names_check_box
        )
        self.suffix_joint_names_layout.addWidget(
            self.suffix_joint_names_line_edit
        )

        self.form_layout.setLayout(
            form_field_index, field_role, self.suffix_joint_names_layout
        )

        # setup signals
        QtCore.QObject.connect(
            self.suffix_joint_names_check_box,
            QtCore.SIGNAL("stateChanged(int)"),
            self.suffix_joint_names_line_edit.setEnabled
        )

        # ----------------
        self.vertical_layout.addLayout(self.form_layout)

        # ----------------
        # Create Joints Button
        self.create_joints_button = QtWidgets.QPushButton()
        self.create_joints_button.setText("Create Joints")
        self.vertical_layout.addWidget(self.create_joints_button)

        # setup signals
        QtCore.QObject.connect(
            self.create_joints_button,
            QtCore.SIGNAL("clicked()"),
            self.create_joints
        )
예제 #6
0
    def setup_ui(self):
        """add tools
        """
        # create the main tab layout
        main_tab_widget = QtWidgets.QTabWidget(self.widget())
        self.addWidget(main_tab_widget)

        # add the General Tab
        general_tab_widget = QtWidgets.QWidget(self.widget())
        general_tab_vertical_layout = QtWidgets.QVBoxLayout()
        general_tab_widget.setLayout(general_tab_vertical_layout)

        main_tab_widget.addTab(general_tab_widget, 'Generic')

        # Create tools for general tab
        from anima.ui.utils import add_button
        # -------------------------------------------------------------------
        # Template
        template_line_edit = QtWidgets.QLineEdit()
        # template_line_edit.setPlaceHolder("Template")
        template_line_edit.setText(GenericTools.default_output_template)

        general_tab_vertical_layout.addWidget(template_line_edit)

        # -------------------------------------------------------------------
        # Per Clip Output Generator
        # create a new layout
        layout = QtWidgets.QHBoxLayout()
        general_tab_vertical_layout.addLayout(layout)

        per_clip_version_label = QtWidgets.QLabel()
        per_clip_version_label.setText("Version")
        per_clip_version_spinbox = QtWidgets.QSpinBox()
        per_clip_version_spinbox.setMinimum(1)

        def per_clip_output_generator_wrapper():
            version_number = per_clip_version_spinbox.value()
            template = template_line_edit.text()
            GenericTools.per_clip_output_generator(
                version_number=version_number, template=template)

        add_button('Per Clip Output Generator', layout,
                   per_clip_output_generator_wrapper)

        layout.addWidget(per_clip_version_label)
        layout.addWidget(per_clip_version_spinbox)

        # Clip Output Generator
        # create a new layout
        layout = QtWidgets.QHBoxLayout()
        general_tab_vertical_layout.addLayout(layout)

        clip_index_label = QtWidgets.QLabel()
        clip_index_label.setText("Clip Index")
        clip_index_spinbox = QtWidgets.QSpinBox()
        clip_index_spinbox.setMinimum(1)

        version_label = QtWidgets.QLabel()
        version_label.setText("Version")
        version_spinbox = QtWidgets.QSpinBox()
        version_spinbox.setMinimum(1)

        def clip_output_generator_wrapper():
            clip_index = clip_index_spinbox.value()
            version_number = version_spinbox.value()
            GenericTools.clip_output_generator(clip_index, version_number)

        add_button('Clip Output Generator', layout,
                   clip_output_generator_wrapper)
        layout.addWidget(clip_index_label)
        layout.addWidget(clip_index_spinbox)
        layout.addWidget(version_label)
        layout.addWidget(version_spinbox)

        # add_button(
        #     "Get Shot Code",
        #     general_tab_vertical_layout,
        #     GenericTools.get_shot_code,
        #     GenericTools.get_shot_code.__doc__
        # )

        # # -------------------------------------------------------------------
        # # Set Shot Code
        #
        # layout = QtWidgets.QHBoxLayout()
        # general_tab_vertical_layout.addLayout(layout)
        #
        # set_clip_code_label = QtWidgets.QLabel()
        # set_clip_code_label.setText("Code")
        # set_clip_code_line_edit = QtWidgets.QLineEdit()
        #
        # def set_shot_code_wrapper():
        #     shot_code = set_clip_code_line_edit.text()
        #     GenericTools.set_shot_code(shot_code)
        #
        # layout.addWidget(set_clip_code_label)
        # layout.addWidget(set_clip_code_line_edit)
        # add_button(
        #     "Set Shot Code",
        #     layout,
        #     set_shot_code_wrapper,
        #     GenericTools.set_shot_code.__doc__,
        # )

        def parent_ui_callback():
            GenericTools.shot_manager(parent_ui=self.parent())

        add_button("Shot Manager", general_tab_vertical_layout,
                   parent_ui_callback, GenericTools.shot_manager.__doc__)

        # add_button(
        #     "Get Current Thumbnail",
        #     general_tab_vertical_layout,
        #     GenericTools.get_thumbnail,
        #     GenericTools.get_thumbnail.__doc__
        # )

        # -------------------------------------------------------------------
        # Add the stretcher
        general_tab_vertical_layout.addStretch()