Exemplo n.º 1
0
    def __init__(self, parent=None):
        BackgroundWidget.__init__(self, parent)

        self.setFixedWidth(pyqt.dpi_scale(80))
        self.setFixedHeight(pyqt.dpi_scale(80))
        self.setScaledContents(True)

        self.set_background()

        self.setToolTip("Click here to Open About/Help window")
Exemplo n.º 2
0
 def __init__(self, chan_config=None, namespace=None, parent=None):
     super(ChannelTable, self).__init__(parent)
     self._fixed_square = pyqt.dpi_scale(17)
     self.chan_config = chan_config
     self.trigger_value_update = True
     self.namespace = namespace
     self.track_widgets = []
     self.create_menu()
     self.setup_table()
     self.config_table()
     self.itemSelectionChanged.connect(self.auto_sync_graph_editor)
Exemplo n.º 3
0
    def populate_controls(self):
        """Populate Controls attribute values

        Populate the controls values from the custom attributes
        of the component.

        """
        # populate tab
        self.tabs.insertTab(0, self.mainSettingsTab, "Main Settings")

        # populate main settings
        self.mainSettingsTab.name_lineEdit.setText(
            self.root.attr("comp_name").get())
        sideSet = ["C", "L", "R"]
        sideIndex = sideSet.index(self.root.attr("comp_side").get())
        self.mainSettingsTab.side_comboBox.setCurrentIndex(sideIndex)
        self.mainSettingsTab.componentIndex_spinBox.setValue(
            self.root.attr("comp_index").get())
        if self.root.attr("useIndex").get():
            self.mainSettingsTab.useJointIndex_checkBox.setCheckState(
                QtCore.Qt.Checked)
        else:
            self.mainSettingsTab.useJointIndex_checkBox.setCheckState(
                QtCore.Qt.Unchecked)
        self.mainSettingsTab.parentJointIndex_spinBox.setValue(
            self.root.attr("parentJointIndex").get())
        self.mainSettingsTab.host_lineEdit.setText(
            self.root.attr("ui_host").get())
        self.mainSettingsTab.subGroup_lineEdit.setText(
            self.root.attr("ctlGrp").get())
        self.mainSettingsTab.joint_offset_x_doubleSpinBox.setValue(
            self.root.attr("joint_rot_offset_x").get())
        self.mainSettingsTab.joint_offset_y_doubleSpinBox.setValue(
            self.root.attr("joint_rot_offset_y").get())
        self.mainSettingsTab.joint_offset_z_doubleSpinBox.setValue(
            self.root.attr("joint_rot_offset_z").get())

        # testing adding custom color per component
        self.mainSettingsTab.overrideColors_checkBox.setCheckState(
            QtCore.Qt.Checked if self.root.Override_Color.get()
            else QtCore.Qt.Unchecked)

        self.mainSettingsTab.useRGB_checkBox.setCheckState(
            QtCore.Qt.Checked if self.root.Use_RGB_Color.get()
            else QtCore.Qt.Unchecked)

        tab = self.mainSettingsTab

        index_widgets = ((tab.color_fk_spinBox,
                          tab.color_fk_label,
                          "color_fk"),
                         (tab.color_ik_spinBox,
                          tab.color_ik_label,
                          "color_ik"))

        rgb_widgets = ((tab.RGB_fk_pushButton, tab.RGB_fk_slider, "RGB_fk"),
                       (tab.RGB_ik_pushButton, tab.RGB_ik_slider, "RGB_ik"))

        for spinBox, label, source_attr in index_widgets:
            color_index = self.root.attr(source_attr).get()
            spinBox.setValue(color_index)
            self.updateWidgetStyleSheet(
                label, [i / 255.0 for i in MAYA_OVERRIDE_COLOR[color_index]])

        for button, slider, source_attr in rgb_widgets:
            self.updateRgbColorWidgets(
                button, self.root.attr(source_attr).get(), slider)

        # forceing the size of the color buttons/label to keep ui clean
        for widget in tuple(i[0] for i in rgb_widgets) + tuple(
                i[1] for i in index_widgets):
            widget.setFixedSize(pyqt.dpi_scale(30), pyqt.dpi_scale(20))

        self.toggleRgbIndexWidgets(tab.useRGB_checkBox,
                                   (w for i in index_widgets for w in i[:2]),
                                   (w for i in rgb_widgets for w in i[:2]),
                                   "Use_RGB_Color",
                                   tab.useRGB_checkBox.checkState())

        self.refresh_controls()

        # joint names tab
        if self.root.hasAttr("jointNamesDescription"):
            self.tabs.insertTab(
                2, self.jointNameDescriptor, "Joints Description Names")