def __init__(self, orientation, title, parent=None): super(SlidersGroup, self).__init__(title, parent) self.slider = QtGui.QSlider(orientation) self.slider.setFocusPolicy(QtCore.Qt.StrongFocus) self.slider.setTickPosition(QtGui.QSlider.TicksBothSides) self.slider.setTickInterval(10) self.slider.setSingleStep(1) self.scrollBar = QtGui.QScrollBar(orientation) self.scrollBar.setFocusPolicy(QtCore.Qt.StrongFocus) self.dial = QtGui.QDial() self.dial.setFocusPolicy(QtCore.Qt.StrongFocus) self.slider.valueChanged[int].connect(self.scrollBar.setValue) self.scrollBar.valueChanged[int].connect(self.dial.setValue) self.dial.valueChanged[int].connect(self.slider.setValue) self.dial.valueChanged[int].connect(self.valueChanged) if orientation == QtCore.Qt.Horizontal: direction = QtGui.QBoxLayout.TopToBottom else: direction = QtGui.QBoxLayout.LeftToRight slidersLayout = QtGui.QBoxLayout(direction) slidersLayout.addWidget(self.slider) slidersLayout.addWidget(self.scrollBar) slidersLayout.addWidget(self.dial) self.setLayout(slidersLayout)
def __init__(self, parent=getMayaWindow()): super(bSkinSaverUI, self).__init__(parent, QtCore.Qt.WindowStaysOnTopHint) tab_widget = QtGui.QTabWidget() objectsTab = QtGui.QWidget() verticesTab = QtGui.QWidget() tab_widget.addTab(objectsTab, "Objects") tab_widget.addTab(verticesTab, "Vertices") self.descLabel = QtGui.QLabel("(C) 2015 by Thomas Bittner", parent=self) self.setWindowTitle('bSkinSaver 1.1') self.objectsFileLine = QtGui.QLineEdit('/Users/thomas/default.weights', parent=self) self.selectObjectsFileButton = QtGui.QPushButton("Set File", parent=self) self.saveObjectsButton = QtGui.QPushButton("Save Weights from selected Objects", parent=self) self.loadObjectsButton = QtGui.QPushButton("Load", parent=self) self.loadObjectsSelectionButton = QtGui.QPushButton("Load to Selected Object", parent=self) objectsLayout = QtGui.QVBoxLayout(objectsTab) objectsLayout.setAlignment(QtCore.Qt.AlignTop) objectsLayout.setSpacing(3) objectsFileLayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight) objectsFileLayout.addWidget(self.objectsFileLine) objectsFileLayout.addWidget(self.selectObjectsFileButton) objectsLayout.addLayout(objectsFileLayout) objectsButtonLayout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom) objectsButtonLayout.setSpacing(0) objectsButtonLayout.addWidget(self.saveObjectsButton) objectsButtonLayout.addWidget(self.loadObjectsButton) objectsButtonLayout.addWidget(self.loadObjectsSelectionButton) objectsLayout.addLayout(objectsButtonLayout) self.verticesFileLine = QtGui.QLineEdit('/Users/thomas/defaultVertex.weights', parent=self) self.selectVerticesFileButton = QtGui.QPushButton("Set File", parent=self) self.saveVerticesButton = QtGui.QPushButton("Save Weights from selected Vertices", parent=self) self.loadVerticesButton = QtGui.QPushButton("Load onto selected Object", parent=self) self.ignoreSoftSelectionWhenSaving = QtGui.QCheckBox("ignore Soft Selection when Saving", parent=self) self.ignoreJointLocksWhenLoading = QtGui.QCheckBox("ignore Joint Locks when Loading", parent=self) verticesLayout = QtGui.QVBoxLayout(verticesTab) verticesLayout.setAlignment(QtCore.Qt.AlignTop) verticesLayout.setSpacing(3) verticesFileLayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight) verticesFileLayout.addWidget(self.verticesFileLine) verticesFileLayout.addWidget(self.selectVerticesFileButton) verticesLayout.addLayout(verticesFileLayout) verticesButtonLayout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom) verticesButtonLayout.setSpacing(0) verticesButtonLayout.addWidget(self.saveVerticesButton) verticesButtonLayout.addWidget(self.loadVerticesButton) verticesButtonLayout.addWidget(self.ignoreSoftSelectionWhenSaving) verticesButtonLayout.addWidget(self.ignoreJointLocksWhenLoading) verticesLayout.addLayout(verticesButtonLayout) self.layout = QtGui.QBoxLayout(QtGui.QBoxLayout.TopToBottom, self) self.layout.addWidget(tab_widget) self.layout.addWidget(self.descLabel) self.resize(400, 10) #select files self.connect(self.selectObjectsFileButton, QtCore.SIGNAL("clicked()"), self.selectObjectsFile) self.connect(self.selectVerticesFileButton, QtCore.SIGNAL("clicked()"), self.selectVerticesFile) self.connect(self.saveObjectsButton, QtCore.SIGNAL("clicked()"), self.saveObjects) self.connect(self.loadObjectsButton, QtCore.SIGNAL("clicked()"), self.loadObjects) self.connect(self.loadObjectsSelectionButton, QtCore.SIGNAL("clicked()"), self.loadObjectsSelection) self.connect(self.saveVerticesButton, QtCore.SIGNAL("clicked()"), self.saveVertices) self.connect(self.loadVerticesButton, QtCore.SIGNAL("clicked()"), self.loadVertices)