예제 #1
0
    def create_widgets(self):
        """
        Creates widgets
        """

        self.dialog_label = QtWidgets.QLabel()
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);\n"
                                        "font: 18pt;")
        self.dialog_label.setText("Create User")

        self.line = QtWidgets.QFrame()
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)

        self.name_line_edit = QtWidgets.QLineEdit()
        self.name_line_edit.setPlaceholderText("Enter Name")

        self.login_line_edit = QtWidgets.QLineEdit()
        self.login_line_edit.setPlaceholderText("stalker")

        self.email_line_edit = QtWidgets.QLineEdit()
        self.email_line_edit.setPlaceholderText("*****@*****.**")

        self.password_line_edit = QtWidgets.QLineEdit()
        self.password_line_edit.setPlaceholderText("******")

        self.ok_button = QtWidgets.QPushButton("OK")
        self.cancel_button = QtWidgets.QPushButton("Cancel")
예제 #2
0
파일: task.py 프로젝트: ktSevindik/anima
    def _setup_dialog(self):
        """create the UI elements
        """
        # set window title
        self.setWindowTitle("Duplicate Task Hierarchy")

        # set window size
        self.resize(285, 118)

        # create the main layout
        self.main_layout = QtWidgets.QVBoxLayout(self)
        self.setLayout(self.main_layout)

        # the label
        self.label = QtWidgets.QLabel(self)
        self.label.setText('Duplicated Task Name:')
        self.main_layout.addWidget(self.label)

        # the line edit
        self.line_edit = QtWidgets.QLineEdit(self)
        self.line_edit.setText(self.duplicated_task_name)
        self.main_layout.addWidget(self.line_edit)

        # the check box
        self.check_box = QtWidgets.QCheckBox(self)
        self.check_box.setText('Keep resources')
        self.check_box.setChecked(True)
        self.main_layout.addWidget(self.check_box)

        # the button box
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel |
            QtWidgets.QDialogButtonBox.Ok
        )
        self.main_layout.addWidget(self.button_box)

        # setup signals
        QtCore.QObject.connect(
            self.button_box,
            QtCore.SIGNAL("accepted()"),
            self.accept
        )
        QtCore.QObject.connect(
            self.button_box,
            QtCore.SIGNAL("rejected()"),
            self.reject
        )
예제 #3
0
    def setup_ui(self):
        """creates the UI widgets
        """
        self.setStyleSheet("""
        QLabel[labelField="true"] {
            font-weight: bold;
        }
        """)

        # the main layout
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # the form layout
        from anima.ui.lib import QtCore
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.form_layout)

        i = -1
        # -------------------------------------------------------------
        # Name Field
        i += 1
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setText("Name")
        self.name_label.setProperty("labelField", True)

        self.name_field = QtWidgets.QLineEdit(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.name_field)

        # -------------------------------------------------------------
        # Type Field
        i += 1
        self.type_label = QtWidgets.QLabel(self)
        self.type_label.setText("Type")
        self.type_label.setProperty("labelField", True)

        self.type_field = QtWidgets.QComboBox(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.type_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.type_field)

        # -------------------------------------------------------------
        # Created By Field
        i += 1
        self.created_by_label = QtWidgets.QLabel(self)
        self.created_by_label.setText("Created By")
        self.created_by_label.setProperty("labelField", True)

        self.created_by_field = QtWidgets.QLabel(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.created_by_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.created_by_field)

        # -------------------------------------------------------------
        # Updated By Field
        i += 1
        self.updated_by_label = QtWidgets.QLabel(self)
        self.updated_by_label.setText("Updated By")
        self.updated_by_label.setProperty("labelField", True)

        self.updated_by_field = QtWidgets.QLabel(self)

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.updated_by_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.updated_by_field)

        # -------------------------------------------------------------
        # Timing Field
        i += 1
        self.timing_label = QtWidgets.QLabel(self)
        self.timing_label.setText("Timing")
        self.timing_label.setProperty("labelField", True)

        self.timing_field = QtWidgets.QLabel(self)
        self.timing_field.setText('23 Hours ago -> an Hour ago!')

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.timing_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.timing_field)

        # -------------------------------------------------------------
        # Priority
        i += 1
        self.priority_label = QtWidgets.QLabel(self)
        self.priority_label.setText("Priority")
        self.priority_label.setProperty("labelField", True)

        self.priority_field = QtWidgets.QLabel(self)
        self.priority_field.setText('950')

        self.form_layout.setWidget(i, QtWidgets.QFormLayout.LabelRole,
                                   self.priority_label)
        self.form_layout.setWidget(i, QtWidgets.QFormLayout.FieldRole,
                                   self.priority_field)

        # Create signals
        QtCore.QObject.connect(self.type_field,
                               QtCore.SIGNAL('currentIndexChanged(QString)'),
                               self.type_field_changed)
예제 #4
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))
예제 #5
0
    def _setup_ui(self):
        """setup the ui elements
        """
        self.resize(750, 180)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        # Dialog Label
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setText('%s Filename Template' % self.mode)
        self.dialog_label.setStyleSheet("color: rgb(71, 143, 202);font: 18pt;")
        self.vertical_layout.addWidget(self.dialog_label)

        # Title Line
        line = QtWidgets.QFrame(self)
        line.setFrameShape(QtWidgets.QFrame.HLine)
        line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line)

        # Form Layout
        self.form_layout = QtWidgets.QFormLayout()
        self.form_layout.setLabelAlignment(QtCore.Qt.AlignRight
                                           | QtCore.Qt.AlignTrailing
                                           | QtCore.Qt.AlignVCenter)
        self.vertical_layout.addLayout(self.form_layout)

        # ------------------------------------------------
        # Target Entity Type Field

        # label
        self.target_entity_type_label = \
            QtWidgets.QLabel('Target Entity Type', self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                   self.target_entity_type_label)

        # field
        self.target_entity_type_combo_box = QtWidgets.QComboBox(self)
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                   self.target_entity_type_combo_box)

        # ------------------------------------------------
        # Name Field
        self.name_label = QtWidgets.QLabel('Name', self)
        self.form_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                   self.name_label)
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet('color: rgb(255, 0, 0);')

        from anima.ui.widgets import ValidatedLineEdit
        self.name_line_edit = ValidatedLineEdit(
            self, message_field=self.name_validator_label)

        self.name_fields_vertical_layout.addWidget(self.name_line_edit)
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(1, QtWidgets.QFormLayout.FieldRole,
                                   self.name_fields_vertical_layout)

        # ------------------------------------------------
        # Path Code Field
        self.path_label = QtWidgets.QLabel('Path', self)
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                   self.path_label)

        self.path_line_edit = QtWidgets.QLineEdit(self)
        # set the default value to something useful
        self.form_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                   self.path_line_edit)

        # ------------------------------------------------
        # Filename Code Field
        self.filename_label = QtWidgets.QLabel('Filename', self)
        self.form_layout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                   self.filename_label)

        self.filename_line_edit = QtWidgets.QLineEdit(self)
        self.form_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                   self.filename_line_edit)

        # ------------------------------------------------
        # Button Box
        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)

        # ------------------------------------------------
        # Default values
        self.target_entity_type_combo_box.addItems(
            ['Task', 'Asset', 'Shot', 'Sequence'])
        self.name_line_edit.set_invalid()  # Empty field is not valid
        self.path_line_edit.setText(
            '$REPO{{project.repository.code}}/{{project.code}}/'
            '{%- for parent_task in parent_tasks -%}{{parent_task.nice_name}}'
            '/{%- endfor -%}')
        self.filename_line_edit.setText(
            '{{version.nice_name}}_v{{"%03d"|format(version.version_number)}}')

        # ------------------------------------------------
        # Disable Fields
        if self.mode == 'Update':
            self.target_entity_type_combo_box.setEnabled(False)

        # ------------------------------------------------
        # Signals
        # Name
        QtCore.QObject.connect(self.name_line_edit,
                               QtCore.SIGNAL('textChanged(QString)'),
                               self.name_line_edit_changed)

        # Button box
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("accepted()"),
                               self.accept)
        QtCore.QObject.connect(self.button_box, QtCore.SIGNAL("rejected()"),
                               self.reject)
예제 #6
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
        )
예제 #7
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()
예제 #8
0
    def _setup_ui(self):
        self.setObjectName("Dialog")
        self.resize(502, 220)
        self.vertical_layout = QtWidgets.QVBoxLayout(self)
        self.vertical_layout.setObjectName("verticalLayout")
        self.dialog_label = QtWidgets.QLabel(self)
        self.dialog_label.setStyleSheet(
            "color: rgb(71, 143, 202);\n"
            "font: 18pt;"
        )
        self.dialog_label.setObjectName("dialog_label")
        self.dialog_label.setText("Create Repository")

        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.line.setObjectName("line")
        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.form_layout.setObjectName("form_layout")

        row_number = 0
        # -------------
        # Name
        # Label
        self.name_label = QtWidgets.QLabel(self)
        self.name_label.setObjectName("name_label")
        self.name_label.setText("Name")
        self.form_layout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.name_label)

        # Field
        self.name_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.name_fields_vertical_layout.setObjectName("name_fields_verticalLayout")
        self.name_validator_label = QtWidgets.QLabel(self)
        self.name_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.name_validator_label.setObjectName("name_validator_label")
        self.name_fields_vertical_layout.addWidget(self.name_validator_label)
        self.form_layout.setLayout(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.name_fields_vertical_layout
        )
        self.name_validator_label.setText("Validator Message")

        # create name_line_edit
        from anima.ui.widgets import ValidatedLineEdit
        self.name_line_edit = ValidatedLineEdit(
            message_field=self.name_validator_label
        )
        self.name_line_edit.setPlaceholderText('Enter Name')
        self.name_fields_vertical_layout.insertWidget(
            0, self.name_line_edit
        )

        row_number += 1
        # -------------
        # Code
        # Label
        self.code_label = QtWidgets.QLabel(self)
        self.code_label.setText("Code")
        self.code_label.setObjectName("code_label")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.code_label
        )

        # Field
        self.code_fields_vertical_layout = QtWidgets.QVBoxLayout()
        self.code_fields_vertical_layout.setObjectName("code_fields_verticalLayout")
        self.code_validator_label = QtWidgets.QLabel(self)
        self.code_validator_label.setStyleSheet("color: rgb(255, 0, 0);")
        self.code_validator_label.setObjectName("code_validator_label")
        self.code_fields_vertical_layout.addWidget(self.code_validator_label)
        self.form_layout.setLayout(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.code_fields_vertical_layout
        )

        # create code_line_edit
        from anima.ui.widgets import ValidatedLineEdit
        self.code_line_edit = ValidatedLineEdit(
            message_field=self.code_validator_label
        )
        self.code_line_edit.setPlaceholderText('Enter Code')
        self.code_fields_vertical_layout.insertWidget(
            0, self.code_line_edit
        )

        row_number += 1
        # -------------
        # Windows Path
        # Label
        self.windows_path_label = QtWidgets.QLabel(self)
        self.windows_path_label.setObjectName("windows_path_label")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.windows_path_label
        )
        self.windows_path_label.setText("Windows Path")

        # Field
        self.windows_path_line_edit = QtWidgets.QLineEdit(self)
        self.windows_path_line_edit.setObjectName("windows_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.windows_path_line_edit
        )

        row_number += 1
        # -------------
        # Linux Path
        # Label
        self.linux_label = QtWidgets.QLabel(self)
        self.linux_label.setObjectName("linux_label")
        self.linux_label.setText("Linux Path")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.linux_label
        )

        # Field
        self.linux_path_line_edit = QtWidgets.QLineEdit(self)
        self.linux_path_line_edit.setObjectName("linux_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.linux_path_line_edit
        )

        row_number += 1
        # -------------
        # OSX Path
        # Label
        self.osx_path_label = QtWidgets.QLabel(self)
        self.osx_path_label.setObjectName("osx_path_label")
        self.osx_path_label.setText("OSX Path")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.LabelRole,
            self.osx_path_label
        )

        # Field
        self.osx_path_line_edit = QtWidgets.QLineEdit(self)
        self.osx_path_line_edit.setObjectName("osx_path_lineEdit")
        self.form_layout.setWidget(
            row_number,
            QtWidgets.QFormLayout.FieldRole,
            self.osx_path_line_edit
        )
        self.vertical_layout.addLayout(self.form_layout)

        # Button Box
        self.button_box = QtWidgets.QDialogButtonBox(self)
        self.button_box.setOrientation(QtCore.Qt.Horizontal)
        self.button_box.setStandardButtons(
            QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok
        )
        self.button_box.setObjectName("button_box")
        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)
예제 #9
0
파일: toolbox.py 프로젝트: ktSevindik/anima
    def setup_ui(self):
        """add tools
        """
        # create the main tab layout
        main_tab_widget = QtWidgets.QTabWidget(self.widget())
        self.addWidget(main_tab_widget)

        # *********************************************************************
        #
        # GENERAL TAB
        #
        # *********************************************************************
        # 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

        # -------------------------------------------------------------------
        # Version Dialog

        from anima.ui.utils import add_button
        add_button('Open Version',
                   general_tab_vertical_layout,
                   GenericTools.version_dialog,
                   callback_kwargs={"mode": 1})

        add_button('Save As Version',
                   general_tab_vertical_layout,
                   GenericTools.version_dialog,
                   callback_kwargs={"mode": 0})

        # Browse $HIP
        add_button('Browse $HIP', general_tab_vertical_layout,
                   GenericTools.browse_hip)

        # Copy Path
        add_button('Copy Node Path', general_tab_vertical_layout,
                   GenericTools.copy_node_path)

        # Range from shot
        add_button('Range From Shot', general_tab_vertical_layout,
                   GenericTools.range_from_shot)

        # Update render settings
        add_button('Update Render Settings', general_tab_vertical_layout,
                   GenericTools.update_render_settings)

        def export_rsproxy_data_as_json_callback():
            """
            """
            import hou
            try:
                GenericTools.export_rsproxy_data_as_json()
            except (BaseException, hou.OperationFailed) as e:
                QtWidgets.QMessageBox.critical(main_tab_widget, "Export",
                                               "Error!<br><br>%s" % e)
            else:
                QtWidgets.QMessageBox.information(
                    main_tab_widget, "Export",
                    "Data has been exported correctly!")

        # Export RSProxy Data As JSON
        add_button('Export RSProxy Data As JSON', general_tab_vertical_layout,
                   export_rsproxy_data_as_json_callback)

        # Batch Rename
        batch_rename_layout = QtWidgets.QHBoxLayout()
        general_tab_vertical_layout.addLayout(batch_rename_layout)

        search_field = QtWidgets.QLineEdit()
        search_field.setPlaceholderText("Search")
        replace_field = QtWidgets.QLineEdit()
        replace_field.setPlaceholderText("Replace")
        replace_in_child_nodes_check_box = QtWidgets.QCheckBox()
        replace_in_child_nodes_check_box.setToolTip("Replace In Child Nodes")
        replace_in_child_nodes_check_box.setChecked(False)

        batch_rename_layout.addWidget(search_field)
        batch_rename_layout.addWidget(replace_field)
        batch_rename_layout.addWidget(replace_in_child_nodes_check_box)

        def search_and_replace_callback():
            search_str = search_field.text()
            replace_str = replace_field.text()
            GenericTools.rename_selected_nodes(
                search_str, replace_str,
                replace_in_child_nodes_check_box.isChecked())

        add_button("Search && Replace", batch_rename_layout,
                   search_and_replace_callback)

        # Import Shaders From Maya
        add_button('Import Shaders From Maya', general_tab_vertical_layout,
                   GenericTools.import_shaders_from_maya)

        # Create Focus Plane
        add_button('Creat Focus Plane', general_tab_vertical_layout,
                   GenericTools.create_focus_plane)

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

        # *********************************************************************
        #
        # CROWD TAB
        #
        # *********************************************************************

        # add the Crowd Tab
        crowd_tab_widget = QtWidgets.QWidget(self.widget())
        crowd_tab_vertical_layout = QtWidgets.QVBoxLayout()
        crowd_tab_widget.setLayout(crowd_tab_vertical_layout)

        main_tab_widget.addTab(crowd_tab_widget, 'Crowd')

        # crowd_tools_label = QtWidgets.QLabel("Crowd Tools")
        # crowd_tab_vertical_layout.addWidget(crowd_tools_label)

        from anima.env.houdini import crowd_tools
        # Bake Setup
        add_button('Create Bake Setup', crowd_tab_vertical_layout,
                   crowd_tools.create_bake_setup)
        # Bake Setup
        add_button('Create Render Setup', crowd_tab_vertical_layout,
                   crowd_tools.create_render_setup)

        # -------------------------------------------------------------------
        # Add the stretcher
        crowd_tab_vertical_layout.addStretch()
예제 #10
0
    def _setup_ui(self):
        """setups UI
        """
        try:
            _fromUtf8 = QtCore.QString.fromUtf8
        except AttributeError:
            _fromUtf8 = lambda s: s

        bmgc_project_name = self.project.GetName()
        bmgc_project_fps = self.project.GetSetting('timelineFrameRate')

        self.setWindowTitle('Conformer')
        self.resize(500, 100)

        self.vertical_layout = QtWidgets.QVBoxLayout(self)

        self.bmgc_project_label = QtWidgets.QLabel(self.vertical_layout.widget())
        self.bmgc_project_label.setText('%s - [%s fps] / Resolve' % (bmgc_project_name, bmgc_project_fps))
        self.bmgc_project_label.setStyleSheet(_fromUtf8("color: rgb(71, 143, 202);\n""font: 12pt;"))
        self.vertical_layout.addWidget(self.bmgc_project_label)

        line = QtWidgets.QFrame(self.vertical_layout.parent())
        line.setFrameShape(QtWidgets.QFrame.HLine)
        line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line)

        self.h_layout1 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.stalker_project_label = QtWidgets.QLabel(self.h_layout1.widget())
        self.stalker_project_label.setText('Stalker Project:')
        self.h_layout1.addWidget(self.stalker_project_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.project_combo_box = QtWidgets.QComboBox(self.h_layout1.widget())
        self.project_combo_box.setSizePolicy(size_policy)
        self.h_layout1.addWidget(self.project_combo_box)

        self.vertical_layout.addLayout(self.h_layout1)

        self.h_layout2 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.stalker_seq_label = QtWidgets.QLabel(self.h_layout2.widget())
        self.stalker_seq_label.setText('Stalker Seq:      ')
        self.h_layout2.addWidget(self.stalker_seq_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.seq_combo_box = QtWidgets.QComboBox(self.h_layout2.widget())
        self.seq_combo_box.setSizePolicy(size_policy)
        self.h_layout2.addWidget(self.seq_combo_box)

        self.vertical_layout.addLayout(self.h_layout2)

        self.h_layout3 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.stalker_scene_label = QtWidgets.QLabel(self.h_layout3.widget())
        self.stalker_scene_label.setText('Stalker Scene:  ')
        self.h_layout3.addWidget(self.stalker_scene_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.scene_combo_box = QtWidgets.QComboBox(self.h_layout3.widget())
        self.scene_combo_box.setSizePolicy(size_policy)
        self.h_layout3.addWidget(self.scene_combo_box)

        self.vertical_layout.addLayout(self.h_layout3)

        self.h_layout_shots = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.shot_in_label = QtWidgets.QLabel(self.h_layout_shots.widget())
        self.shot_in_label.setText('Shot In:')
        self.h_layout_shots.addWidget(self.shot_in_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.shot_in_combo_box = QtWidgets.QComboBox(self.h_layout_shots.widget())
        self.shot_in_combo_box.setSizePolicy(size_policy)
        self.h_layout_shots.addWidget(self.shot_in_combo_box)

        self.shot_out_label = QtWidgets.QLabel(self.h_layout_shots.widget())
        self.shot_out_label.setText('Shot Out:')
        self.h_layout_shots.addWidget(self.shot_out_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.shot_out_combo_box = QtWidgets.QComboBox(self.h_layout_shots.widget())
        self.shot_out_combo_box.setSizePolicy(size_policy)
        self.h_layout_shots.addWidget(self.shot_out_combo_box)

        self.vertical_layout.addLayout(self.h_layout_shots)

        self.h_layout4 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.width_label = QtWidgets.QLabel(self.h_layout4.widget())
        self.width_label.setText('Width:')
        self.h_layout4.addWidget(self.width_label)

        self.width_line = QtWidgets.QLineEdit(self.h_layout4.widget())
        self.width_line.setText('-')
        self.width_line.setEnabled(0)
        self.h_layout4.addWidget(self.width_line)

        self.height_label = QtWidgets.QLabel(self.h_layout4.widget())
        self.height_label.setText('Height:')
        self.h_layout4.addWidget(self.height_label)

        self.height_line = QtWidgets.QLineEdit(self.h_layout4.widget())
        self.height_line.setText('-')
        self.height_line.setEnabled(0)
        self.h_layout4.addWidget(self.height_line)

        self.fps_label = QtWidgets.QLabel(self.h_layout4.widget())
        self.fps_label.setText('Fps:')
        self.h_layout4.addWidget(self.fps_label)

        self.fps_line = QtWidgets.QLineEdit(self.h_layout4.widget())
        self.fps_line.setText('-')
        self.fps_line.setEnabled(0)
        self.h_layout4.addWidget(self.fps_line)

        self.vertical_layout.addLayout(self.h_layout4)

        self.h_layout4a = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.filter_statuses_check_box = QtWidgets.QCheckBox(self.h_layout4a.widget())
        self.filter_statuses_check_box.setText('Filter Statuses')
        self.h_layout4a.addWidget(self.filter_statuses_check_box)

        self.wip_check_box = QtWidgets.QCheckBox(self.h_layout4a.widget())
        self.wip_check_box.setText('WIP')
        self.h_layout4a.addWidget(self.wip_check_box)

        self.hrev_check_box = QtWidgets.QCheckBox(self.h_layout4a.widget())
        self.hrev_check_box.setText('HREV')
        self.h_layout4a.addWidget(self.hrev_check_box)

        self.prev_check_box = QtWidgets.QCheckBox(self.h_layout4a.widget())
        self.prev_check_box.setText('PREV')
        self.h_layout4a.addWidget(self.prev_check_box)

        self.completed_check_box = QtWidgets.QCheckBox(self.h_layout4a.widget())
        self.completed_check_box.setText('CMLT')
        self.h_layout4a.addWidget(self.completed_check_box)

        self.vertical_layout.addLayout(self.h_layout4a)

        self.h_layout5 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.task_name_label = QtWidgets.QLabel(self.h_layout5.widget())
        self.task_name_label.setText('Task Name:')
        self.h_layout5.addWidget(self.task_name_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.task_name_combo_box = QtWidgets.QComboBox(self.h_layout5.widget())
        self.task_name_combo_box.setSizePolicy(size_policy)
        self.h_layout5.addWidget(self.task_name_combo_box)

        self.ext_name_label = QtWidgets.QLabel(self.h_layout5.widget())
        self.ext_name_label.setText('Extension:')
        self.h_layout5.addWidget(self.ext_name_label)

        size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        self.ext_name_combo_box = QtWidgets.QComboBox(self.h_layout5.widget())
        self.ext_name_combo_box.setSizePolicy(size_policy)
        self.h_layout5.addWidget(self.ext_name_combo_box)

        self.plus_plates_check_box = QtWidgets.QCheckBox(self.h_layout5.widget())
        self.plus_plates_check_box.setText('+ Plates')
        self.h_layout5.addWidget(self.plus_plates_check_box)

        self.alpha_only_check_box = QtWidgets.QCheckBox(self.h_layout5.widget())
        self.alpha_only_check_box.setText('Alpha Only')
        self.h_layout5.addWidget(self.alpha_only_check_box)
        
        self.vertical_layout.addLayout(self.h_layout5)

        self.conform_button = QtWidgets.QPushButton(self.vertical_layout.widget())
        self.conform_button.setText('CONFORM ALL')
        self.vertical_layout.addWidget(self.conform_button)

        line1 = QtWidgets.QFrame(self.vertical_layout.parent())
        line1.setFrameShape(QtWidgets.QFrame.HLine)
        line1.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line1)

        self.h_layout6 = QtWidgets.QHBoxLayout(self.vertical_layout.widget())

        self.date_label = QtWidgets.QLabel(self.h_layout6.widget())
        self.date_label.setText('check From:')
        self.date_label.setAlignment(QtCore.Qt.AlignCenter)
        self.h_layout6.addWidget(self.date_label)

        self.start_date = QtWidgets.QDateEdit(self.h_layout6.widget())
        self.start_date.setDate(QtCore.QDate.currentDate()) # setDate(QtCore.QDate(2021, 1, 1))
        self.start_date.setCurrentSection(QtWidgets.QDateTimeEdit.MonthSection)
        self.start_date.setCalendarPopup(True)
        self.h_layout6.addWidget(self.start_date)

        self.now_label = QtWidgets.QLabel(self.h_layout6.widget())
        self.now_label.setText(':until Now')
        self.now_label.setAlignment(QtCore.Qt.AlignCenter)
        self.h_layout6.addWidget(self.now_label)

        self.vertical_layout.addLayout(self.h_layout6)

        self.updated_shot_list = QtWidgets.QListWidget(self.vertical_layout.widget())
        self.updated_shot_list.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
        self.vertical_layout.addWidget(self.updated_shot_list)

        self.status_button= QtWidgets.QPushButton(self.vertical_layout.widget())
        self.status_button.setText('LIST UPDATED SHOTS')
        self.vertical_layout.addWidget(self.status_button)

        self.conform_updates_button= QtWidgets.QPushButton(self.vertical_layout.widget())
        self.conform_updates_button.setText('CONFORM UPDATED SHOTS ONLY')
        self.vertical_layout.addWidget(self.conform_updates_button)

        line2 = QtWidgets.QFrame(self.vertical_layout.parent())
        line2.setFrameShape(QtWidgets.QFrame.HLine)
        line2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.vertical_layout.addWidget(line2)

        self.info_label = QtWidgets.QLabel(self.vertical_layout.widget())
        self.info_label.setText('check Console for Progress Info...')
        self.vertical_layout.addWidget(self.info_label)

        self.fill_ui_with_stalker_projects()