def setupUi(self, parent): self.setupDefaultFormUi(parent) self.combo = QtWidgets.QComboBox(parent) for option in self.attr['options']: self.combo.addItem(option) if self._isValueTypeValid(self.attrValue): self._setFormValue(self.attrValue) self.combo.currentIndexChanged.connect(self._valueChanged) self.setDefaultFormWidget(self.combo)
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)