def __init__(self, project, parent=None):
        super(ShotBuilder, self).__init__(project=project, name='Shot', parent=parent)

        self._current_icon_path = None

        self._icon_btn = QPushButton('Icon')
        self._icon_btn.setMinimumSize(QSize(150, 150))
        self._icon_btn.setMaximumSize(QSize(150, 150))
        self._icon_btn.setIconSize(QSize(150, 150))
        self._icon_btn.setIconSize(QSize(150, 150))
        self._description_text = QTextEdit()
        self._description_text.setPlaceholderText('Description')

        icon_layout = QHBoxLayout()
        icon_layout.setContentsMargins(5, 10, 5, 5)
        self.main_layout.addLayout(icon_layout)
        icon_layout.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding, QSizePolicy.Fixed))
        icon_layout.addWidget(self._icon_btn, Qt.AlignCenter)
        icon_layout.addItem(QSpacerItem(0, 10, QSizePolicy.Expanding, QSizePolicy.Fixed))

        self.main_layout.addWidget(self._description_text)

        self.main_layout.addItem(QSpacerItem(0, 5))
        self.main_layout.addLayout(splitters.SplitterLayout())

        # ============================================================================

        self._icon_btn.clicked.connect(self._set_icon)
    def __init__(self, project, name='Asset', parent=None):

        self._project = project

        super(BuilderWidget, self).__init__(parent=parent)

        base_layout = QVBoxLayout()
        base_layout.setContentsMargins(2, 2, 2, 2)
        base_layout.setSpacing(2)
        self.setLayout(base_layout)

        self.main_layout = QVBoxLayout()
        self.main_layout.setContentsMargins(2, 2, 2, 2)
        self.main_layout.setSpacing(2)
        base_layout.addLayout(self.main_layout)

        bottom_layout = QHBoxLayout()
        bottom_layout.setContentsMargins(2, 2, 2, 2)
        bottom_layout.setSpacing(2)
        base_layout.addLayout(splitters.SplitterLayout())
        base_layout.addLayout(bottom_layout)

        self.save_btn = QPushButton('Generate {} File'.format(name))
        self.load_btn = QPushButton('Load {} File'.format(name))
        bottom_layout.addWidget(self.save_btn)
        bottom_layout.addWidget(self.load_btn)

        self.save_btn.clicked.connect(self.save)
        self.load_btn.clicked.connect(self.load)
Пример #3
0
    def ui(self):
        super(ShotAssets, self).ui()

        self.setMouseTracking(True)

        self._add_btn = QPushButton('Add Asset File')
        self._add_btn.setIcon(resource.ResourceManager.instance().icon('add'))
        self.main_layout.addWidget(self._add_btn)
        self.main_layout.addLayout(splitters.SplitterLayout())

        self._grid_layout = QGridLayout()
        self._grid_layout.setSpacing(2)
        self._grid_layout.setContentsMargins(0, 0, 0, 0)
        self.main_layout.addLayout(self._grid_layout)

        scroll_widget = QWidget()
        scroll_area = QScrollArea()
        scroll_area.setWidgetResizable(True)
        scroll_area.setStyleSheet(
            'QScrollArea { background-color: rgb(57,57,57);}')
        scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        scroll_area.setWidget(scroll_widget)

        self._assets_layout = QVBoxLayout()
        self._assets_layout.setContentsMargins(1, 1, 1, 1)
        self._assets_layout.setSpacing(0)
        self._assets_layout.addStretch()
        scroll_widget.setLayout(self._assets_layout)
        self._grid_layout.addWidget(scroll_area, 1, 0, 1, 4)
    def ui(self):
        super(ShotOverrides, self).ui()

        self.setMouseTracking(True)

        self._load_btn = QPushButton('Load Overrides')
        self._load_btn.setIcon(
            resource.ResourceManager.instance().icon('open'))
        self.main_layout.addWidget(self._load_btn)
        self.main_layout.addLayout(splitters.SplitterLayout())

        scroll_widget = QWidget()
        scroll_area = QScrollArea()
        scroll_area.setWidgetResizable(True)
        scroll_area.setStyleSheet(
            'QScrollArea { background-color: rgb(57,57,57);}')
        scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        scroll_area.setWidget(scroll_widget)

        self._overrides_layout = QVBoxLayout()
        self._overrides_layout.setContentsMargins(1, 1, 1, 1)
        self._overrides_layout.setSpacing(0)
        self._overrides_layout.setAlignment(Qt.AlignTop)
        scroll_widget.setLayout(self._overrides_layout)
        self.main_layout.addWidget(scroll_area)
    def ui(self):
        super(BaseExporter, self).ui()

        main_splitter = QSplitter(Qt.Horizontal)
        main_splitter.setSizePolicy(QSizePolicy.Expanding,
                                    QSizePolicy.Expanding)
        self.main_layout.addWidget(main_splitter)

        self._export_list = self.EXPORTER_LIST_WIDGET_CLASS(
            project=self._project)
        self._properties_widget = self.EXPORTER_PROPERTIES_WIDGET_CLASS()
        main_splitter.addWidget(self._export_list)
        main_splitter.addWidget(self._properties_widget)

        self._progress = progressbar.ArtellaProgressBar(project=self._project)
        self._progress.setVisible(False)
        self.main_layout.addWidget(self._progress)

        self._save_btn = QPushButton(str(self.EXPORT_BUTTON_TEXT))
        self._save_btn.setIcon(artellapipe.resource.icon('save'))
        self._save_btn.setMinimumHeight(30)
        self._save_btn.setMinimumWidth(100)
        save_layout = QHBoxLayout()
        save_layout.setContentsMargins(0, 0, 0, 0)
        save_layout.setSpacing(0)
        save_layout.addItem(
            QSpacerItem(15, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))
        save_layout.addWidget(self._save_btn)
        save_layout.addItem(
            QSpacerItem(15, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))
        self.main_layout.addLayout(splitters.SplitterLayout())
        self.main_layout.addLayout(save_layout)
Пример #6
0
    def ui(self):
        super(ShotAssembler, self).ui()

        self._setup_menubar()

        self._dock_window = tpQtLib.DockWindow(use_scrollbar=True)
        self._dock_window.centralWidget().show()

        self._shots_props = shotproperties.ShotProps(project=self._project)
        self._shot_hierarchy = shothierarchy.ShotHierarchy()
        self._shot_assets = shotassetslist.ShotAssets(project=self._project)
        self._shot_overrides = shotoverrides.ShotOverrides(
            project=self._project)

        self._generate_btn = QPushButton('GENERATE SHOT')
        self._generate_btn.setIcon(
            resource.ResourceManager.instance().icon('magic'))
        self._generate_btn.setMinimumHeight(30)
        self._generate_btn.setMinimumWidth(80)

        self.main_layout.addWidget(self._shots_props)
        self.main_layout.addLayout(splitters.SplitterLayout())
        self.main_layout.addWidget(self._dock_window)
        self._dock_window.main_layout.addWidget(self._shot_hierarchy)
        self._shot_assets_dock = self._dock_window.add_dock(
            widget=self._shot_assets, name='Assets', pos=Qt.LeftDockWidgetArea)
        self._shot_overrides_dock = self._dock_window.add_dock(
            widget=self._shot_overrides,
            name='Overrides',
            tabify=False,
            pos=Qt.RightDockWidgetArea)
        self._shot_overrides_dock.setEnabled(False)
        self.main_layout.addLayout(splitters.SplitterLayout())
        self.main_layout.addWidget(self._generate_btn)

        self._progress = progressbar.ArtellaProgressBar(project=self._project)
        self._progress.setVisible(False)
        self.main_layout.addWidget(self._progress)
Пример #7
0
    def ui(self):
        super(ArtellaOverrideEditor, self).ui()

        self._override_widget = self._override.get_editor_widget()
        if self._override_widget:
            self.main_layout.addWidget(self._override_widget)
            save_btn = QPushButton('Save')
            save_btn.setIcon(artellapipe.resource.icon('save'))
            self.main_layout.addLayout(splitters.SplitterLayout())
            self.main_layout.addWidget(save_btn)
            save_btn.clicked.connect(self._on_save_override)
        else:
            close_btn = QPushButton('Close')
            close_btn.setIcon(artellapipe.resource.icon('delete'))
            self.main_layout.addWidget(close_btn)
            close_btn.clicked.connect(self.fade_close)
    def ui(self):
        super(ShotExporter, self).ui()

        self._exporters_menu_layout = QHBoxLayout()
        self._exporters_menu_layout.setContentsMargins(0, 0, 0, 0)
        self._exporters_menu_layout.setSpacing(5)
        self._exporters_menu_layout.setAlignment(Qt.AlignTop)
        self.main_layout.addLayout(self._exporters_menu_layout)

        self._exporters_btn_grp = QButtonGroup(self)
        self._exporters_btn_grp.setExclusive(True)

        self._main_stack = stack.SlidingStackedWidget()

        self.main_layout.addLayout(self._exporters_menu_layout)
        self.main_layout.addLayout(splitters.SplitterLayout())
        self.main_layout.addWidget(self._main_stack)
Пример #9
0
    def ui(self):
        super(AlembicManager, self).ui()

        export_icon = resource.ResourceManager().icon('export')
        import_icon = resource.ResourceManager().icon('import')

        buttons_layout = QHBoxLayout()
        buttons_layout.setContentsMargins(2, 2, 2, 2)
        buttons_layout.setSpacing(2)
        self.main_layout.addLayout(buttons_layout)
        self.main_layout.addLayout(splitters.SplitterLayout())

        self._exporter_btn = QPushButton('Exporter')
        self._exporter_btn.setIcon(export_icon)
        self._exporter_btn.setMinimumWidth(80)
        self._exporter_btn.setCheckable(True)
        self._importer_btn = QPushButton('Importer')
        self._importer_btn.setIcon(import_icon)
        self._importer_btn.setMinimumWidth(80)
        self._importer_btn.setCheckable(True)
        buttons_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))
        buttons_layout.addWidget(self._exporter_btn)
        buttons_layout.addWidget(self._importer_btn)
        buttons_layout.addItem(
            QSpacerItem(10, 0, QSizePolicy.Expanding, QSizePolicy.Preferred))

        self._buttons_grp = QButtonGroup(self)
        self._buttons_grp.setExclusive(True)
        self._buttons_grp.addButton(self._exporter_btn)
        self._buttons_grp.addButton(self._importer_btn)
        self._exporter_btn.setChecked(True)

        self._stack = stack.SlidingStackedWidget()
        self.main_layout.addWidget(self._stack)

        self._alembic_exporter = artellapipe.AlembicExporter(
            project=self.project)
        self._alembic_importer = artellapipe.AlembicImporter(
            project=self.project)

        self._stack.addWidget(self._alembic_exporter)
        self._stack.addWidget(self._alembic_importer)
Пример #10
0
    def ui(self):

        self.color_buttons = list()

        super(ColorDialog, self).ui()

        if tp.Dcc.get_name() == tp.Dccs.Maya and tp.Dcc.get_version() <= 2016:
            self.color_dialog = QColorDialog(parent=self)
            self.color_dialog.setWindowFlags(Qt.Widget)
            self.color_dialog.setOptions(QColorDialog.DontUseNativeDialog
                                         | QColorDialog.NoButtons)
            self.main_layout.addWidget(self.color_dialog)
        else:
            grid_layout = QGridLayout()
            grid_layout.setAlignment(Qt.AlignTop)
            self.main_layout.addLayout(grid_layout)
            color_index = 0
            for i in range(0, 4):
                for j in range(0, 8):
                    color_btn = QPushButton()
                    color_btn.setMinimumHeight(35)
                    color_btn.setMinimumWidth(35)
                    self.color_buttons.append(color_btn)
                    color_btn.setStyleSheet(
                        'background-color:rgb(%s,%s,%s);' %
                        (self.maya_colors[color_index][0] * 255,
                         self.maya_colors[color_index][1] * 255,
                         self.maya_colors[color_index][2] * 255))
                    grid_layout.addWidget(color_btn, i, j)
                    color_index += 1
            selected_color_layout = QHBoxLayout()
            self.main_layout.addLayout(selected_color_layout)
            self.color_slider = QSlider(Qt.Horizontal)
            self.color_slider.setMinimum(0)
            self.color_slider.setMaximum(31)
            self.color_slider.setValue(2)
            self.color_slider.setStyleSheet(
                "QSlider::groove:horizontal {border: 1px solid #999999;height: 25px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);margin: 2px 0;}QSlider::handle:horizontal {background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f);border: 1px solid #5c5c5c;width: 10px;margin: -2px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */border-radius: 1px;}"
            )
            selected_color_layout.addWidget(self.color_slider)

            color_label_layout = QHBoxLayout()
            color_label_layout.setContentsMargins(10, 10, 10, 0)
            self.main_layout.addLayout(color_label_layout)

            self.color_lbl = QLabel()
            self.color_lbl.setStyleSheet(
                "border: 1px solid black; background-color:rgb(0, 0, 0);")
            self.color_lbl.setMinimumWidth(45)
            self.color_lbl.setMaximumWidth(80)
            self.color_lbl.setMinimumHeight(80)
            self.color_lbl.setAlignment(Qt.AlignCenter)
            color_label_layout.addWidget(self.color_lbl)

        bottom_layout = QHBoxLayout()
        bottom_layout.setAlignment(Qt.AlignRight)
        self.main_layout.addLayout(bottom_layout)

        self.ok_btn = QPushButton('Ok')
        self.cancel_btn = QPushButton('Cancel')
        bottom_layout.addLayout(splitters.SplitterLayout())
        bottom_layout.addWidget(self.ok_btn)
        bottom_layout.addWidget(self.cancel_btn)
Пример #11
0
    def ui(self):
        super(JointOrient, self).ui()

        ### Auto Orient Joint Widget ###

        joint_ori_widget = QWidget()
        joint_ori_widget.setLayout(QVBoxLayout())
        joint_ori_widget.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed)
        joint_ori_widget.layout().setContentsMargins(0, 0, 0, 0)
        joint_ori_widget.layout().setSpacing(2)

        self.main_layout.addWidget(joint_ori_widget)

        joint_ori_splitter = splitters.Splitter('JOINT ORIENT')
        joint_ori_widget.layout().addWidget(joint_ori_splitter)

        aim_axis_layout = QHBoxLayout()
        aim_axis_layout.setContentsMargins(5, 5, 5, 5)
        aim_axis_layout.setSpacing(2)

        # Aim Axis
        aim_axis_box = QGroupBox()
        aim_axis_box.setLayout(aim_axis_layout)
        aim_axis_box.setTitle('Aim Axis')
        joint_ori_widget.layout().addWidget(aim_axis_box)
        self.aim_x_radio = QRadioButton('X')
        self.aim_y_radio = QRadioButton('Y')
        self.aim_z_radio = QRadioButton('Z')
        self.aim_rev_cbx = QCheckBox('Reverse')
        self.aim_x_radio.setChecked(True)

        aim_axis_layout.addWidget(self.aim_x_radio)
        aim_axis_layout.addWidget(self.aim_y_radio)
        aim_axis_layout.addWidget(self.aim_z_radio)
        aim_axis_layout.addWidget(self.aim_rev_cbx)

        # Up Axis
        up_axis_layout = QHBoxLayout()
        up_axis_layout.setContentsMargins(5, 5, 5, 5)
        up_axis_layout.setSpacing(2)

        up_axis_box = QGroupBox()
        up_axis_box.setLayout(up_axis_layout)
        up_axis_box.setTitle('Up Axis')
        joint_ori_widget.layout().addWidget(up_axis_box)
        self.up_x_radio = QRadioButton('X')
        self.up_y_radio = QRadioButton('Y')
        self.upZRadio = QRadioButton('Z')
        self.upRevCbx = QCheckBox('Reverse')
        self.up_y_radio.setChecked(True)

        up_axis_layout.addWidget(self.up_x_radio)
        up_axis_layout.addWidget(self.up_y_radio)
        up_axis_layout.addWidget(self.upZRadio)
        up_axis_layout.addWidget(self.upRevCbx)

        # Up World Axis
        up_world_axis_layout = QHBoxLayout()
        up_world_axis_layout.setContentsMargins(5, 5, 5, 5)
        up_world_axis_layout.setSpacing(5)

        up_world_axis_box = QGroupBox()
        up_world_axis_box.setLayout(up_world_axis_layout)
        up_world_axis_box.setTitle('Up World Axis')
        joint_ori_widget.layout().addWidget(up_world_axis_box)
        self.up_world_x_spin = QDoubleSpinBox()
        self.up_world_y_spin = QDoubleSpinBox()
        self.up_world_z_spin = QDoubleSpinBox()
        self.up_world_x_spin.setDecimals(3)
        self.up_world_y_spin.setDecimals(3)
        self.up_world_z_spin.setDecimals(3)
        self.up_world_x_spin.setRange(-360, 360)
        self.up_world_y_spin.setRange(-360, 360)
        self.up_world_z_spin.setRange(-360, 360)
        self.up_world_x_spin.setLocale(QLocale.English)
        self.up_world_y_spin.setLocale(QLocale.English)
        self.up_world_z_spin.setLocale(QLocale.English)
        self.up_world_x_spin.setValue(1.0)
        up_world_x = QPushButton('X')
        up_world_y = QPushButton('Y')
        up_world_z = QPushButton('Z')
        up_world_x.setMaximumWidth(20)
        up_world_y.setMaximumWidth(20)
        up_world_z.setMaximumWidth(20)

        up_world_axis_layout.addWidget(self.up_world_x_spin)
        up_world_axis_layout.addWidget(self.up_world_y_spin)
        up_world_axis_layout.addWidget(self.up_world_z_spin)
        up_world_axis_layout.addWidget(up_world_x)
        up_world_axis_layout.addWidget(up_world_y)
        up_world_axis_layout.addWidget(up_world_z)

        joint_ori_widget.layout().addLayout(splitters.SplitterLayout())

        joint_orient_btn_layout = QHBoxLayout()
        joint_orient_btn_layout.setAlignment(Qt.AlignCenter)
        joint_ori_widget.layout().addLayout(joint_orient_btn_layout)
        spacer_item = QSpacerItem(2, 2, QSizePolicy.Minimum,
                                  QSizePolicy.Minimum)
        joint_orient_btn_layout.addSpacerItem(spacer_item)
        joint_orient_btn = QPushButton('Apply')
        self.joint_orient_cbx = QCheckBox('Hierarchy')
        joint_orient_btn.setMaximumWidth(80)
        self.joint_orient_cbx.setChecked(True)
        joint_orient_btn_layout.addWidget(joint_orient_btn)
        joint_orient_btn_layout.addWidget(self.joint_orient_cbx)

        spacer_item = QSpacerItem(2, 2, QSizePolicy.Fixed)
        self.main_layout.addSpacerItem(spacer_item)

        ### Manual Orient Joint Widget ###
        manual_joint_ori_widget = QWidget()
        manual_joint_ori_widget.setLayout(QVBoxLayout())
        manual_joint_ori_widget.setSizePolicy(QSizePolicy.Minimum,
                                              QSizePolicy.Fixed)
        manual_joint_ori_widget.layout().setContentsMargins(5, 5, 5, 5)
        manual_joint_ori_widget.layout().setSpacing(10)

        self.main_layout.addWidget(manual_joint_ori_widget)

        manual_joint_ori_splitter = splitters.Splitter('MANUAL JOINT ORIENT')
        manual_joint_ori_widget.layout().addWidget(manual_joint_ori_splitter)

        manual_joint_ori_layout = QHBoxLayout()
        manual_joint_ori_widget.layout().addLayout(manual_joint_ori_layout)

        manual_joint_ori_lbl = QLabel('  X  Y  Z  ')
        self.manual_joint_ori_x_spin = QDoubleSpinBox()
        self.manual_joint_ori_y_spin = QDoubleSpinBox()
        self.manual_joint_ori_z_spin = QDoubleSpinBox()
        self.manual_joint_ori_x_spin.setDecimals(3)
        self.manual_joint_ori_y_spin.setDecimals(3)
        self.manual_joint_ori_z_spin.setDecimals(3)
        self.manual_joint_ori_x_spin.setRange(-360, 360)
        self.manual_joint_ori_y_spin.setRange(-360, 360)
        self.manual_joint_ori_z_spin.setRange(-360, 360)
        self.manual_joint_ori_x_spin.setLocale(QLocale.English)
        self.manual_joint_ori_y_spin.setLocale(QLocale.English)
        self.manual_joint_ori_z_spin.setLocale(QLocale.English)
        manualJointOriResetBtn = QPushButton('Reset')

        manual_joint_ori_layout.addWidget(manual_joint_ori_lbl)
        manual_joint_ori_layout.addWidget(self.manual_joint_ori_x_spin)
        manual_joint_ori_layout.addWidget(self.manual_joint_ori_y_spin)
        manual_joint_ori_layout.addWidget(self.manual_joint_ori_z_spin)
        manual_joint_ori_layout.addWidget(manualJointOriResetBtn)

        manual_joint_splitter_layout = QVBoxLayout()
        manual_joint_ori_widget.layout().addLayout(
            manual_joint_splitter_layout)

        degree_layout = QHBoxLayout()
        degree_layout.setContentsMargins(5, 5, 5, 5)
        degree_layout.setSpacing(2)

        degree_box = QGroupBox()
        degree_box.setLayout(degree_layout)
        degree_box.setStyleSheet("border:0px;")
        manual_joint_splitter_layout.layout().addWidget(degree_box)
        self.degree1_radio = QRadioButton('1')
        self.degree5_radio = QRadioButton('5')
        self.degree10_radio = QRadioButton('10')
        self.degree20_radio = QRadioButton('20')
        self.degree45_radio = QRadioButton('45')
        self.degree90_radio = QRadioButton('90')
        self.degree90_radio.setChecked(True)
        self._set_value_change(90)

        degree_layout.addWidget(self.degree1_radio)
        degree_layout.addWidget(self.degree5_radio)
        degree_layout.addWidget(self.degree10_radio)
        degree_layout.addWidget(self.degree20_radio)
        degree_layout.addWidget(self.degree45_radio)
        degree_layout.addWidget(self.degree90_radio)

        manual_joint_splitter_layout.addLayout(splitters.SplitterLayout())

        manual_joint_ori_buttons_layout = QHBoxLayout()
        manual_joint_ori_buttons_layout.setContentsMargins(2, 2, 2, 2)
        manual_joint_ori_buttons_layout.setSpacing(5)
        manual_joint_ori_widget.layout().addLayout(
            manual_joint_ori_buttons_layout)

        manual_joint_ori_add_btn = QPushButton('Add ( + ) ')
        manual_joint_ori_subtract_btn = QPushButton('Subract ( - ) ')

        manual_joint_ori_buttons_layout.addWidget(manual_joint_ori_add_btn)
        manual_joint_ori_buttons_layout.addWidget(
            manual_joint_ori_subtract_btn)

        manual_joint_ori_set_btn_layout = QVBoxLayout()
        manual_joint_ori_set_btn_layout.setAlignment(Qt.AlignCenter)
        manual_joint_ori_set_btn_layout.setContentsMargins(2, 2, 2, 2)
        manual_joint_ori_set_btn_layout.setSpacing(5)
        manual_joint_ori_widget.layout().addLayout(
            manual_joint_ori_set_btn_layout)

        manual_joint_ori_set_btn = QPushButton('Set')
        manual_joint_ori_set_btn.setMaximumWidth(100)
        self.manual_joint_ori_set_cbx = QCheckBox('Affect children')

        manual_joint_ori_set_btn_layout.addWidget(manual_joint_ori_set_btn)
        manual_joint_ori_set_btn_layout.addWidget(
            self.manual_joint_ori_set_cbx)

        set_rot_axis_widget = QWidget()
        set_rot_axis_widget.setLayout(QVBoxLayout())
        set_rot_axis_widget.setSizePolicy(QSizePolicy.Minimum,
                                          QSizePolicy.Fixed)
        set_rot_axis_widget.layout().setContentsMargins(5, 5, 5, 5)
        set_rot_axis_widget.layout().setSpacing(10)

        self.main_layout.addWidget(set_rot_axis_widget)

        set_rot_axis_splitter = splitters.Splitter('SET ROTATION AXIS')
        set_rot_axis_widget.layout().addWidget(set_rot_axis_splitter)

        set_rot_axis_layout = QVBoxLayout()
        set_rot_axis_widget.layout().addLayout(set_rot_axis_layout)

        set_rot_top_layout = QHBoxLayout()
        set_rot_top_layout.setSpacing(5)
        set_rot_axis_layout.addLayout(set_rot_top_layout)
        self.set_rot_axis_box = QComboBox()
        set_rot_top_layout.addWidget(self.set_rot_axis_box)
        for rotAxis in ['xyz', 'yzx', 'zxy', 'xzy', 'yxz', 'zyx']:
            self.set_rot_axis_box.addItem(rotAxis)
        set_rot_axis_common_btn = QPushButton('   <')
        set_rot_axis_common_btn.setMaximumWidth(45)
        set_rot_axis_common_btn.setStyleSheet(
            "QPushButton::menu-indicator{image:url(none.jpg);}")
        self.set_rot_axis_common_btn_menu = QMenu(self)
        self._set_common_rotation_axis()
        set_rot_axis_common_btn.setMenu(self.set_rot_axis_common_btn_menu)
        set_rot_top_layout.addWidget(set_rot_axis_common_btn)

        set_rot_axis_btn_layout = QHBoxLayout()
        set_rot_axis_btn_layout.setAlignment(Qt.AlignCenter)
        set_rot_axis_layout.addLayout(set_rot_axis_btn_layout)
        set_rot_axis_btn = QPushButton('Set')
        set_rot_axis_btn.setMaximumWidth(100)
        set_rot_axis_btn_layout.addWidget(set_rot_axis_btn)

        set_rot_axis_splitter_layout = QVBoxLayout()
        set_rot_axis_widget.layout().addLayout(set_rot_axis_splitter_layout)
        set_rot_axis_splitter_layout.addLayout(splitters.SplitterLayout())

        spacer_item = QSpacerItem(2, 2, QSizePolicy.Fixed)
        self.main_layout.addSpacerItem(spacer_item)

        layout_lra_buttons = QHBoxLayout()
        self.main_layout.addLayout(layout_lra_buttons)
        display_lra_btn = QPushButton('Display LRA')
        hide_lra_btn = QPushButton('Hide LRA')
        layout_lra_buttons.addWidget(display_lra_btn)
        layout_lra_buttons.addWidget(hide_lra_btn)

        select_hierarchy_btn = QPushButton('Select Hierarchy')
        self.main_layout.addWidget(select_hierarchy_btn)

        # ==== SIGNALS ==== #
        up_world_x.clicked.connect(partial(self._reset_axis, 'x'))
        up_world_y.clicked.connect(partial(self._reset_axis, 'y'))
        up_world_z.clicked.connect(partial(self._reset_axis, 'z'))
        joint_orient_btn.clicked.connect(self.orient_joints)

        manualJointOriResetBtn.clicked.connect(self._reset_manual_orient)
        manual_joint_ori_add_btn.clicked.connect(
            partial(self.manual_orient_joints, 'add'))
        manual_joint_ori_subtract_btn.clicked.connect(
            partial(self.manual_orient_joints, 'subtract'))
        manual_joint_ori_set_btn.clicked.connect(self.set_manual_orient_joints)

        self.degree1_radio.clicked.connect(partial(self._set_value_change, 0))
        self.degree5_radio.clicked.connect(partial(self._set_value_change, 5))
        self.degree10_radio.clicked.connect(partial(self._set_value_change,
                                                    10))
        self.degree20_radio.clicked.connect(partial(self._set_value_change,
                                                    20))
        self.degree45_radio.clicked.connect(partial(self._set_value_change,
                                                    45))
        self.degree90_radio.clicked.connect(partial(self._set_value_change,
                                                    90))

        set_rot_axis_btn.clicked.connect(self.set_rot_axis)

        display_lra_btn.clicked.connect(partial(self.set_lra, True))
        hide_lra_btn.clicked.connect(partial(self.set_lra, False))
        select_hierarchy_btn.clicked.connect(self.select_hierarchy)
Пример #12
0
    def ui(self):
        super(StandinExporter, self).ui()

        buttons_layout = QGridLayout()
        self.main_layout.addLayout(buttons_layout)

        icon_double_left = resource.ResourceManager.instance().icon('double_left')
        icon_double_left_hover = resource.ResourceManager.instance().icon('double_left_hover')

        name_lbl = QLabel('Standin Name: ')
        self.name_line = QLineEdit()
        self.name_line_btn = button.IconButton(icon=icon_double_left, icon_hover=icon_double_left_hover)
        buttons_layout.addWidget(name_lbl, 1, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self.name_line, 1, 1)
        buttons_layout.addWidget(self.name_line_btn, 1, 2)

        frame_range_lbl = QLabel('Frame Range: ')
        self.start = QSpinBox()
        self.start.setRange(-sys.maxint, sys.maxint)
        self.start.setFixedHeight(20)
        self.start.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.end = QSpinBox()
        self.end.setRange(-sys.maxint, sys.maxint)
        self.end.setFixedHeight(20)
        self.end.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        frame_range_widget = QWidget()
        frame_range_layout = QHBoxLayout()
        frame_range_layout.setContentsMargins(2, 2, 2, 2)
        frame_range_layout.setSpacing(2)
        frame_range_widget.setLayout(frame_range_layout)
        for widget in [frame_range_lbl, self.start, self.end]:
            frame_range_layout.addWidget(widget)
        buttons_layout.addWidget(frame_range_lbl, 3, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(frame_range_widget, 3, 1)

        folder_icon = resource.ResourceManager.instance().icon('folder')
        export_path_layout = QHBoxLayout()
        export_path_layout.setContentsMargins(2, 2, 2, 2)
        export_path_layout.setSpacing(2)
        export_path_widget = QWidget()
        export_path_widget.setLayout(export_path_layout)
        export_path_lbl = QLabel('Export Path: ')
        self.export_path_line = QLineEdit()
        self.export_path_line.setReadOnly(True)
        self.export_path_line.setText(self._project.get_path())
        self.export_path_btn = QPushButton()
        self.export_path_btn.setIcon(folder_icon)
        self.export_path_btn.setIconSize(QSize(18, 18))
        self.export_path_btn.setStyleSheet(
            "background-color: rgba(255, 255, 255, 0); border: 0px solid rgba(255,255,255,0);")
        export_path_layout.addWidget(self.export_path_line)
        export_path_layout.addWidget(self.export_path_btn)
        buttons_layout.addWidget(export_path_lbl, 4, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(export_path_widget, 4, 1)

        auto_sync_shaders_lbl = QLabel('Auto Sync Shaders?: ')
        self.auto_sync_shaders = QCheckBox()
        self.auto_sync_shaders.setChecked(True)
        buttons_layout.addWidget(auto_sync_shaders_lbl, 5, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self.auto_sync_shaders, 5, 1)

        self.main_layout.addLayout(splitters.SplitterLayout())

        export_layout = QHBoxLayout()
        self.export_btn = QPushButton('Export')
        self.export_btn.setEnabled(False)
        export_layout.addItem(QSpacerItem(25, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        export_layout.addWidget(self.export_btn)
        export_layout.addItem(QSpacerItem(25, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.main_layout.addLayout(export_layout)

        self.name_line.textChanged.connect(self.refresh)
        self.export_path_btn.clicked.connect(self._on_set_export_path)
        self.export_btn.clicked.connect(self._on_export)
        self.name_line_btn.clicked.connect(partial(self._get_selected, self.name_line))

        self.refresh()
    def ui(self):
        super(AlembicExporter, self).ui()

        self._stack = stack.SlidingStackedWidget()
        self.main_layout.addWidget(self._stack)

        exporter_widget = QWidget()
        exporter_layout = QVBoxLayout()
        exporter_layout.setContentsMargins(0, 0, 0, 0)
        exporter_layout.setSpacing(0)
        exporter_widget.setLayout(exporter_layout)
        self._stack.addWidget(exporter_widget)

        self._waiter = waiter.ArtellaWaiter(
            spinner_type=spinner.SpinnerType.Thumb)
        self._stack.addWidget(self._waiter)

        buttons_layout = QGridLayout()
        exporter_layout.addLayout(buttons_layout)

        name_lbl = QLabel('Alembic Name: ')
        self._name_line = QLineEdit()
        buttons_layout.addWidget(name_lbl, 0, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self._name_line, 0, 1)

        shot_name_lbl = QLabel('Shot Name: ')
        self._shot_line = QLineEdit()
        buttons_layout.addWidget(shot_name_lbl, 1, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self._shot_line, 1, 1)

        frame_range_lbl = QLabel('Frame Range: ')
        self._start = QSpinBox()
        self._start.setRange(-sys.maxint, sys.maxint)
        self._start.setFixedHeight(20)
        self._start.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self._end = QSpinBox()
        self._end.setRange(-sys.maxint, sys.maxint)
        self._end.setFixedHeight(20)
        self._end.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        frame_range_widget = QWidget()
        frame_range_layout = QHBoxLayout()
        frame_range_layout.setContentsMargins(2, 2, 2, 2)
        frame_range_layout.setSpacing(2)
        frame_range_widget.setLayout(frame_range_layout)
        for widget in [frame_range_lbl, self._start, self._end]:
            frame_range_layout.addWidget(widget)
        buttons_layout.addWidget(frame_range_lbl, 2, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(frame_range_widget, 2, 1)

        folder_icon = resource.ResourceManager().icon('folder')
        export_path_layout = QHBoxLayout()
        export_path_layout.setContentsMargins(2, 2, 2, 2)
        export_path_layout.setSpacing(2)
        export_path_widget = QWidget()
        export_path_widget.setLayout(export_path_layout)
        export_path_lbl = QLabel('Export Path: ')
        self._export_path_line = QLineEdit()
        self._export_path_line.setReadOnly(True)
        self._export_path_line.setText(self._project.get_path())
        self._export_path_btn = QPushButton()
        self._export_path_btn.setIcon(folder_icon)
        self._export_path_btn.setIconSize(QSize(18, 18))
        self._export_path_btn.setStyleSheet(
            "background-color: rgba(255, 255, 255, 0); border: 0px solid rgba(255,255,255,0);"
        )
        export_path_layout.addWidget(self._export_path_line)
        export_path_layout.addWidget(self._export_path_btn)
        buttons_layout.addWidget(export_path_lbl, 3, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(export_path_widget, 3, 1)

        exporter_layout.addLayout(splitters.SplitterLayout())

        checkboxes_layout = QVBoxLayout()
        checkboxes_layout.setContentsMargins(2, 2, 2, 2)
        checkboxes_layout.setSpacing(2)
        exporter_layout.addLayout(checkboxes_layout)

        self._open_folder_after_export_cbx = QCheckBox(
            'Open Folder After Export?')
        self._open_folder_after_export_cbx.setChecked(True)
        checkboxes_layout.addWidget(self._open_folder_after_export_cbx)
        self._export_all_alembics_together_cbx = QCheckBox(
            'Export All Selected Geometry in One Alembic?')
        self._export_all_alembics_together_cbx.setChecked(True)
        checkboxes_layout.addWidget(self._export_all_alembics_together_cbx)

        exporter_layout.addLayout(splitters.SplitterLayout())

        export_layout = QHBoxLayout()
        self._export_btn = QPushButton('Export')
        self._export_btn.setIcon(resource.ResourceManager().icon('export'))
        self._export_btn.setEnabled(False)
        export_layout.addItem(
            QSpacerItem(25, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        export_layout.addWidget(self._export_btn)
        export_layout.addItem(
            QSpacerItem(25, 0, QSizePolicy.Fixed, QSizePolicy.Fixed))
        self.main_layout.addLayout(export_layout)

        exporter_layout.addItem(
            QSpacerItem(0, 10, QSizePolicy.Preferred, QSizePolicy.Expanding))

        self.refresh()
Пример #14
0
    def ui(self):
        super(AlembicImporter, self).ui()

        buttons_layout = QGridLayout()
        self.main_layout.addLayout(buttons_layout)

        shot_name_lbl = QLabel('Shot Name: ')
        self._shot_line = QLineEdit()
        buttons_layout.addWidget(shot_name_lbl, 1, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(self._shot_line, 1, 1)
        shot_name_lbl.setVisible(False)
        self._shot_line.setVisible(False)

        folder_icon = resource.ResourceManager().icon('folder')
        alembic_path_layout = QHBoxLayout()
        alembic_path_layout.setContentsMargins(2, 2, 2, 2)
        alembic_path_layout.setSpacing(2)
        alembic_path_widget = QWidget()
        alembic_path_widget.setLayout(alembic_path_layout)
        alembic_path_lbl = QLabel('Alembic File: ')
        self._alembic_path_line = QLineEdit()
        self._alembic_path_line.setReadOnly(True)
        self._alembic_path_btn = QPushButton()
        self._alembic_path_btn.setIcon(folder_icon)
        self._alembic_path_btn.setIconSize(QSize(18, 18))
        self._alembic_path_btn.setStyleSheet(
            "background-color: rgba(255, 255, 255, 0); border: 0px solid rgba(255,255,255,0);"
        )
        alembic_path_layout.addWidget(self._alembic_path_line)
        alembic_path_layout.addWidget(self._alembic_path_btn)
        buttons_layout.addWidget(alembic_path_lbl, 2, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(alembic_path_widget, 2, 1)

        import_mode_layout = QHBoxLayout()
        import_mode_layout.setContentsMargins(2, 2, 2, 2)
        import_mode_layout.setSpacing(2)
        import_mode_widget = QWidget()
        import_mode_widget.setLayout(import_mode_layout)
        import_mode_lbl = QLabel('Import mode: ')
        self._create_radio = QRadioButton('Create')
        self._add_radio = QRadioButton('Add')
        self._merge_radio = QRadioButton('Merge')
        self._create_radio.setChecked(True)
        import_mode_layout.addWidget(self._create_radio)
        import_mode_layout.addWidget(self._add_radio)
        import_mode_layout.addWidget(self._merge_radio)
        buttons_layout.addWidget(import_mode_lbl, 3, 0, 1, 1, Qt.AlignRight)
        buttons_layout.addWidget(import_mode_widget, 3, 1)
        import_mode_lbl.setVisible(False)
        import_mode_widget.setVisible(False)

        self._auto_display_lbl = QLabel('Auto Display Smooth?: ')
        self._auto_smooth_display = QCheckBox()
        self._auto_smooth_display.setChecked(True)
        buttons_layout.addWidget(self._auto_display_lbl, 4, 0, 1, 1,
                                 Qt.AlignRight)
        buttons_layout.addWidget(self._auto_smooth_display, 4, 1)

        if tp.is_maya():
            maya_gpu_cache_lbl = QLabel('Import Alembic as GPU Cache?')
            self._maya_gpu_cache_cbx = QCheckBox()
            self._maya_gpu_cache_cbx.setChecked(True)
            buttons_layout.addWidget(maya_gpu_cache_lbl, 5, 0, 1, 1,
                                     Qt.AlignRight)
            buttons_layout.addWidget(self._maya_gpu_cache_cbx, 5, 1)
        elif tp.is_houdini():
            hou_archive_abc_node_lbl = QLabel('Import Alembic as Archive?')
            self._hou_archive_abc_node_cbx = QCheckBox()
            buttons_layout.addWidget(hou_archive_abc_node_lbl, 5, 0, 1, 1,
                                     Qt.AlignRight)
            buttons_layout.addWidget(self._hou_archive_abc_node_cbx, 5, 1)

        self.main_layout.addLayout(splitters.SplitterLayout())

        buttons_layout = QHBoxLayout()
        buttons_layout.setContentsMargins(2, 2, 2, 2)
        buttons_layout.setSpacing(2)
        self.main_layout.addLayout(buttons_layout)
        self._import_btn = QPushButton('Import')
        self._import_btn.setIcon(resource.ResourceManager().icon('import'))
        self._import_btn.setSizePolicy(QSizePolicy.Expanding,
                                       QSizePolicy.Preferred)
        self._reference_btn = QPushButton('Reference')
        self._reference_btn.setIcon(
            resource.ResourceManager().icon('reference'))
        self._reference_btn.setSizePolicy(QSizePolicy.Expanding,
                                          QSizePolicy.Preferred)
        buttons_layout.addWidget(self._import_btn)
        buttons_layout.addWidget(self._reference_btn)

        if tp.is_houdini():
            self._reference_btn.setEnabled(False)