Example #1
0
    def __init__(self, parent, influence, value):
        ui.QWidget.__init__(self, parent)

        # variables
        self.influence = influence
        self.value = value

        isLocked = cmds.getAttr("{0}.liw".format(influence))

        # create layout
        layout = ui.QHBoxLayout(self)
        layout.setContentsMargins(3, 3, 3, 3)
        layout.setSpacing(5)

        # create lock
        self.lock = ui.QPushButton(self)
        self.lock.setFlat(True)
        self.lock.setCheckable(True)
        self.lock.setIcon(ui.QIcon(LOCK_ICON.get(isLocked)))
        self.lock.setFixedSize(ui.QSize(18, 18))
        self.lock.released.connect(self.toggleLocked)
        layout.addWidget(self.lock)

        # create label
        name = ui.QLabel(self)
        name.setText(influence)
        name.setFont(ui.FONT)
        name.setMinimumWidth(150)
        layout.addWidget(name)

        # create slider
        self.slider = ui.QSlider(self)
        self.slider.setInputMethodHints(ui.Qt.ImhNone)
        self.slider.setMaximum(1000)
        self.slider.setSingleStep(1)
        self.slider.setOrientation(ui.Qt.Horizontal)
        self.slider.valueChanged.connect(self.sliderValueChanged)
        layout.addWidget(self.slider)

        # create label
        self.spinbox = ui.QDoubleSpinBox(self)
        self.spinbox.setFont(ui.FONT)
        self.spinbox.setDecimals(3)
        self.spinbox.setRange(0, 1)
        self.spinbox.setSingleStep(0.001)
        self.spinbox.valueChanged.connect(self.spinboxValueChanged)
        layout.addWidget(self.spinbox)

        # set ui
        self.setValue(value)

        if isLocked:
            self.lock.setChecked(True)
            self.spinbox.setEnabled(False)
            self.slider.setEnabled(False)
Example #2
0
 def __init__(self, parent, vertex):
     ui.QWidget.__init__(self, parent)
     
     # create layout
     layout = ui.QHBoxLayout(self)
     layout.setContentsMargins(3, 3, 3, 3)
     layout.setSpacing(10)
     
     # create label
     name = ui.QLabel(self)
     name.setText(vertex.split("|")[-1])
     name.setFont(ui.BOLT_FONT)
     name.setStyleSheet(ORANGE_STYLESHEET)
     
     # set label size policy
     sizePolicy = ui.QSizePolicy(
         ui.QSizePolicy.Preferred, 
         ui.QSizePolicy.Preferred
     )
     sizePolicy.setHorizontalStretch(1)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(
         name.sizePolicy().hasHeightForWidth()
     )
     name.setSizePolicy(sizePolicy)
     layout.addWidget(name)
     
     # create warning
     self.warning = ui.QLabel(self)
     self.warning.setText("Exceeded Maximum Influences")
     self.warning.setFont(ui.FONT)
     self.warning.setStyleSheet(RED_STYLESHEET)
     self.warning.setVisible(False)
     layout.addWidget(self.warning)
     
     # create checkbox
     self.checkbox = ui.QCheckBox(self)
     self.checkbox.setText("Display All Influences")
     self.checkbox.setFont(ui.FONT)
     self.checkbox.stateChanged.connect(self.checkboxStateChanged)
     layout.addWidget(self.checkbox)
Example #3
0
    def __init__(self, parent):
        ui.QWidget.__init__(self, parent)

        # create layout
        layout = ui.QHBoxLayout(self)
        layout.setContentsMargins(3, 3, 3, 3)

        # create label
        label = ui.QLabel(self)
        label.setFont(ui.FONT)
        label.setText("Easing Method:")
        layout.addWidget(label)

        # creete option box
        options = [f for f in dir(tweening) if f.startswith("ease")]
        self.combo = ui.QComboBox(self)
        self.combo.setFont(ui.FONT)
        self.combo.addItems(options)
        layout.addWidget(self.combo)
Example #4
0
    def __init__(self, parent):
        ui.QWidget.__init__(self, parent)

        # create layout
        layout = ui.QHBoxLayout(self)
        layout.setContentsMargins(3, 3, 3, 3)
        layout.setSpacing(5)

        # create add button
        add = IconButton(self, ADD_ICON)
        add.setFlat(True)
        add.released.connect(self.addInfluence.emit)
        layout.addWidget(add)

        # create title
        label = ui.QLabel(self)
        label.setText("Add Influence")
        label.setFont(ui.BOLT_FONT)
        layout.addWidget(label)
Example #5
0
    def __init__(self, parent):
        ui.QWidget.__init__(self, parent)

        # variable
        self._influence = None

        # create layout
        layout = ui.QHBoxLayout(self)
        layout.setContentsMargins(3, 3, 3, 3)
        layout.setSpacing(5)

        # create joint
        joint = IconButton(self, JOINT_ICON)
        joint.released.connect(self.setInfluenceFromSelection)
        layout.addWidget(joint)

        # create label
        self.label = ui.QLabel(self)
        self.label.setText("< filler influence >")
        self.label.setFont(ui.FONT)
        layout.addWidget(self.label)
Example #6
0
    def __init__(self, parent):
        ui.QWidget.__init__(self, parent)

        # variable
        self._influence = None

        self._ssActive = None
        self._ssData = {}
        self._ssSettings = {}

        # create layout
        layout = ui.QHBoxLayout(self)
        layout.setContentsMargins(3, 3, 3, 3)
        layout.setSpacing(5)

        # create joint
        joint = IconButton(self, JOINT_ICON)
        joint.released.connect(self.setInfluenceFromSelection)
        layout.addWidget(joint)

        # create soft select
        soft = IconButton(self, SOFTSELECT_ICON)
        soft.released.connect(self.setSoftSelectionFromSelection)
        layout.addWidget(soft)

        # create label
        self.label = ui.QLabel(self)
        self.label.setText("< influence >")
        self.label.setFont(ui.FONT)
        layout.addWidget(self.label)

        # create remove button
        remove = IconButton(self, REMOVE_ICON)
        remove.setFlat(True)
        remove.released.connect(self.deleteLater)
        layout.addWidget(remove)