示例#1
0
    def setupUi(self, parent):
        self.setupDefaultFormUi(parent)

        self.checkbox = QtWidgets.QCheckBox(parent)
        if self._isValueTypeValid(self.attrValue):
            self._setFormValue(self.attrValue)
        self.checkbox.setMinimumHeight(self.LABEL_HEIGHT)
        self.checkbox.stateChanged.connect(self._valueChanged)

        self.setDefaultFormWidget(self.checkbox)
示例#2
0
    def setupContentUi(self, parent):
        layout = QtWidgets.QVBoxLayout(parent)

        # mirror settings
        # ---------------

        check = QtWidgets.QCheckBox(parent)
        check.setText("Include All Children")
        check.setStatusTip(
            "Recursively mirror the selected nodes and all of their children")
        check.setChecked(self.mirrorRecursive)
        check.stateChanged.connect(self.setMirrorRecursive)
        layout.addWidget(check)

        check = QtWidgets.QCheckBox(parent)
        check.setText("Transforms")
        check.setStatusTip("Mirror the transform matrices of the nodes")
        check.setChecked(self.mirrorTransforms)
        check.stateChanged.connect(self.setMirrorTransforms)
        layout.addWidget(check)

        check = QtWidgets.QCheckBox(parent)
        check.setText("Parenting")
        check.setStatusTip("Mirror the parenting structure of the nodes")
        check.setChecked(self.mirrorParenting)
        check.stateChanged.connect(self.setMirrorParenting)
        layout.addWidget(check)

        check = QtWidgets.QCheckBox(parent)
        check.setText("Appearance")
        check.setStatusTip("Mirror the name and color of the nodes")
        check.setChecked(self.mirrorAppearance)
        check.stateChanged.connect(self.setMirrorAppearance)
        layout.addWidget(check)

        check = QtWidgets.QCheckBox(parent)
        check.setText("Allow Node Creation")
        check.setStatusTip(
            "Allow the creation of nodes when mirroring recursively")
        check.setChecked(self.mirrorAllowCreate)
        check.stateChanged.connect(self.setMirrorAllowCreate)
        layout.addWidget(check)

        # mirror axis

        # mirror mode toggle

        # mirror actions
        # --------------
        gridLayout = QtWidgets.QGridLayout(parent)
        gridLayout.setMargin(0)
        gridLayout.setSpacing(2)

        pairBtn = QtWidgets.QPushButton(parent)
        pairBtn.setText("Pair")
        pairBtn.setStatusTip(
            "Pair the two selected nodes as mirroring counterparts")
        pairBtn.clicked.connect(cmd(editorutils.pairSelected))

        unpairBtn = QtWidgets.QPushButton(parent)
        unpairBtn.setText("Unpair")
        unpairBtn.setStatusTip(
            "Unpair the selected node or nodes (can be many at once)")
        unpairBtn.clicked.connect(cmd(editorutils.unpairSelected))

        mirrorBtn = QtWidgets.QPushButton(parent)
        mirrorBtn.setText("Mirror")
        mirrorBtn.setStatusTip(
            "Mirror the selected nodes using the current options")
        mirrorBtn.clicked.connect(self.mirrorSelected)

        gridItems = [
            [pairBtn, unpairBtn],
        ]
        viewutils.addItemsToGrid(gridLayout, gridItems)
        gridLayout.addWidget(mirrorBtn, 2, 0, 1, 2)
        layout.addLayout(gridLayout)
示例#3
0
    def setupContenUi(self, parent):
        layout = QtWidgets.QVBoxLayout(parent)
        layout.setMargin(0)

        # settings
        # --------
        self.keepChildPosCheck = QtWidgets.QCheckBox(parent)
        self.keepChildPosCheck.setText("Preserve Children")
        self.keepChildPosCheck.setStatusTip(
            "Preseve the positions of child nodes when rotating "
            "or orienting a transform or joint")
        self.keepChildPosCheck.setChecked(self.orientPreserveChildren)
        self.keepChildPosCheck.stateChanged.connect(
            self.setOrientPreserveChildren)

        self.keepShapeCheck = QtWidgets.QCheckBox(parent)
        self.keepShapeCheck.setText("Preserve Shapes")
        self.keepShapeCheck.setStatusTip(
            "Preseve the orientation of shapes when rotating nodes")
        self.keepShapeCheck.setChecked(self.orientPreserveShapes)
        self.keepShapeCheck.stateChanged.connect(self.setOrientPreserveShapes)

        self.syncJointAxesCheck = QtWidgets.QCheckBox(parent)
        self.syncJointAxesCheck.setText('Keep Axes Synced')
        self.syncJointAxesCheck.setStatusTip(
            "When enabled, joint translate and scale axes are automatically "
            "updated when the jointOrient and rotateAxis values are changed.")
        self.syncJointAxesCheck.setChecked(self.syncJointAxes)
        self.syncJointAxesCheck.stateChanged.connect(self.setSyncJointAxes)

        self.includeChildrenCheck = QtWidgets.QCheckBox(parent)
        self.includeChildrenCheck.setText("Include All Children")
        self.includeChildrenCheck.setStatusTip(
            "Update all child joints when using orient to joint or world")
        self.includeChildrenCheck.setChecked(self.orientIncludeChildren)
        self.includeChildrenCheck.stateChanged.connect(
            self.setOrientIncludeChildren)

        # joint orient axes
        hlayout = QtWidgets.QHBoxLayout(parent)
        hlayout.setSpacing(4)

        axisOrderLabel = QtWidgets.QLabel(parent)
        axisOrderLabel.setText("Orient Axes")

        self.axisOrderCombo = QtWidgets.QComboBox(parent)
        for option in self.AXIS_ORDER_OPTIONS:
            optionStr = '{0} forward, {1} up'.format(option[0], option[1])
            self.axisOrderCombo.addItem(optionStr)
        self.axisOrderCombo.setCurrentIndex(self.orientAxisOrder)
        self.axisOrderCombo.setStatusTip(
            "The local axes to use for forward / up / secondary")
        self.axisOrderCombo.currentIndexChanged.connect(
            self.setOrientAxisOrder)

        self.upAxisCombo = QtWidgets.QComboBox(parent)
        for option in self.UP_AXIS_OPTIONS:
            optionStr = '{0} world up'.format(option)
            self.upAxisCombo.addItem(optionStr)
        self.upAxisCombo.setCurrentIndex(self.orientUpAxis)
        self.upAxisCombo.setStatusTip(
            "The world axis that up vector of the joint should point towards")
        self.upAxisCombo.currentIndexChanged.connect(self.setOrientUpAxis)

        hlayout.addWidget(axisOrderLabel)
        hlayout.addWidget(self.axisOrderCombo)
        hlayout.addWidget(self.upAxisCombo)
        hlayout.addItem(viewutils.createHSpacer())

        layout.addWidget(self.keepChildPosCheck)
        layout.addWidget(self.keepShapeCheck)
        layout.addWidget(self.syncJointAxesCheck)
        layout.addWidget(self.includeChildrenCheck)
        layout.addLayout(hlayout)

        # button grid
        # -----------
        gridLayout = QtWidgets.QGridLayout(parent)
        gridLayout.setMargin(0)
        gridLayout.setSpacing(2)

        toggleCBBtn = QPushButton(parent)
        toggleCBBtn.setText('Toggle Channel Box Attrs')
        toggleCBBtn.setStatusTip(
            "Toggle the display of rotateAxis, localPivot, and other "
            "attributes in the channel box")
        toggleCBBtn.clicked.connect(
            cmd(editorutils.toggleDetailedChannelBoxForSelected))

        toggleLRABtn = QPushButton(parent)
        toggleLRABtn.setText('Toggle LRAs')
        toggleLRABtn.setStatusTip(
            "Toggle the display of local rotation axes")
        toggleLRABtn.clicked.connect(
            cmd(self.toggleLocalRotationAxesForSelected))

        syncAxesBtn = QtWidgets.QPushButton(parent)
        syncAxesBtn.setText("Sync Axes")
        syncAxesBtn.setStatusTip(
            "Match the translate and scale axes of a "
            "joint to its orientation")
        syncAxesBtn.clicked.connect(self.matchJointRotationToOrientForSelected)

        orientToJointBtn = QtWidgets.QPushButton(parent)
        orientToJointBtn.setText("Orient to Joint")
        orientToJointBtn.clicked.connect(self.orientToJointForSelected)

        orientToWorldBtn = QtWidgets.QPushButton(parent)
        orientToWorldBtn.setText("Orient to World")
        orientToWorldBtn.clicked.connect(self.orientToWorldForSelected)

        interactiveOrientBtn = QtWidgets.QPushButton(parent)
        interactiveOrientBtn.setText("Interactive Orient")
        interactiveOrientBtn.setEnabled(False)

        gridItems = [
            [orientToJointBtn, orientToWorldBtn],
            [interactiveOrientBtn, syncAxesBtn],
            [toggleCBBtn, toggleLRABtn],
        ]
        viewutils.addItemsToGrid(gridLayout, gridItems)
        layout.addLayout(gridLayout)

        # rotate orient buttons
        # ---------------------
        rotateForm = self.createRotateAxisForm(parent)
        layout.addWidget(rotateForm)