def __init__(self, parent=None): """:param parent: Window to place Butter Help under.""" super(ButterHelpWindow, self).__init__(parent=parent) self.helpText = ( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:\'Sans Serif\'; font-size:10pt; font-weight:400; font-style:normal;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:12pt; font-weight:600;\">Butter</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">An animation curve filter for Maya.</p>\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">This filter allows you to quickly smooth and denoise high-density animation curves, usually from motion capture. If any curves are selected, the filter will manipulate only selected curves. If no curves are selected, the filter will manipulate all visible curves in the graph editor.</p>\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Quick tip: expand the window sideways for higher precision!</p>\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:11pt; font-weight:600;\">How to use:</span></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Enable the filter by clicking <span style=\" font-weight:600;\">Start interactive filter</span>.</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Select your filter type from [Highpass, Bandpass, Lowpass].</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Use the sliders to start filtering curves.</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Exit the filter by clicking <span style=\" font-weight:600;\">Exit filter</span>.</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Undo or redo as necessary.</p>\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">----</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">(c) Jeffrey "italic" Hoover</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">italic DOT rendezvous AT gmail DOT com</p>\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Licensed under the Apache 2.0 license.</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">This script can be used for commercial and non-commercial projects free of charge.</p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"https://www.apache.org/licenses/LICENSE-2.0\"><span style=\" text-decoration: underline; color:#0057ae;\">https://www.apache.org/licenses/LICENSE-2.0</span></a></p></body></html>" ) self.settings = QtCore.QSettings("italic", "Butter") self.__setup_ui() self.move(self.settings.value("help/position", QtCore.QPoint(0, 0))) self.resize(self.settings.value("help/size", QtCore.QSize(0, 0))) self.show()
def __show_ui(self): self.setObjectName("ConManHelpWindow") self.setWindowTitle("ConMan Help") self.resize(325, 250) self.setMinimumSize(325, 250) self.setMaximumSize(600, 425) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.sizePolicy().hasHeightForWidth()) self.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setPointSize(8) font.setFamily("Arial") self.setFont(font) self.centralwidget = QtWidgets.QWidget(self) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.centralwidget.sizePolicy().hasHeightForWidth()) self.centralwidget.setSizePolicy(sizePolicy) self.centralwidget.setMinimumSize(QtCore.QSize(325, 250)) self.centralwidget.setMaximumSize(QtCore.QSize(600, 425)) self.centralwidget.setObjectName("centralwidget") self.vlayout = QtWidgets.QVBoxLayout(self.centralwidget) self.vlayout.setSpacing(2) self.vlayout.setContentsMargins(2, 2, 2, 2) self.vlayout.setObjectName("VLayout") self.textwidget = QtWidgets.QTextEdit(self.centralwidget) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) self.textwidget.setSizePolicy(sizePolicy) self.textwidget.setReadOnly(True) self.textwidget.setObjectName("TextWidget") self.textwidget.setHtml(self.helpText) self.vlayout.addWidget(self.textwidget) self.setCentralWidget(self.centralwidget)
def __setup_ui(self): self.setWindowTitle("Constraint Manager") self.setObjectName("ConManWindow") self.resize(250, 425) self.setMinimumSize(250, 425) self.setMaximumSize(250, 425) font = QtGui.QFont() font.setPointSize(8) font.setFamily("Arial") self.setFont(font) self.setTabShape(QtWidgets.QTabWidget.Rounded) self.centralwidget = QtWidgets.QWidget(self) self.centralwidget.setMinimumSize(QtCore.QSize(250, 425)) self.centralwidget.setMaximumSize(QtCore.QSize(250, 425)) self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget) self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 250, 425)) self.LayoutVert1 = QtWidgets.QVBoxLayout(self.verticalLayoutWidget) self.LayoutVert1.setSpacing(2) self.LayoutVert1.setContentsMargins(5, -1, 5, -1) self.ObjList = QtWidgets.QListWidget() self.ObjList.setMinimumSize(QtCore.QSize(240, 125)) self.ObjList.setMaximumSize(QtCore.QSize(240, 125)) self.ObjList.setFrameShape(QtWidgets.QFrame.NoFrame) self.ObjList.setFrameShadow(QtWidgets.QFrame.Plain) self.ObjList.setToolTip( "Click to see switching options.\nDouble click to select constrained object." ) self.ButtonRow1 = QtWidgets.QHBoxLayout() self.ButtonRow1.setSpacing(0) self.ButtonAdd = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonAdd.setEnabled(True) self.ButtonAdd.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonAdd.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonAdd.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/pickHandlesComp.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonAdd.setIcon(icon) self.ButtonAdd.setIconSize(QtCore.QSize(40, 40)) self.ButtonAdd.setFlat(False) self.ButtonAdd.setToolTip("Add selected constraint nodes to the list.") self.ButtonParent = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonParent.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonParent.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonParent.setText("") icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/parentConstraint.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonParent.setIcon(icon1) self.ButtonParent.setIconSize(QtCore.QSize(40, 40)) self.ButtonParent.setFlat(False) self.ButtonParent.setToolTip( "Create a parent constraint with options below.") self.ButtonPoint = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonPoint.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonPoint.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonPoint.setText("") icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/posConstraint.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonPoint.setIcon(icon2) self.ButtonPoint.setIconSize(QtCore.QSize(40, 40)) self.ButtonPoint.setFlat(False) self.ButtonPoint.setToolTip( "Create a point constraint with options below.") self.ButtonOrient = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonOrient.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonOrient.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonOrient.setText("") icon3 = QtGui.QIcon() icon3.addPixmap(QtGui.QPixmap(":/orientConstraint.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonOrient.setIcon(icon3) self.ButtonOrient.setIconSize(QtCore.QSize(40, 40)) self.ButtonOrient.setFlat(False) self.ButtonOrient.setToolTip( "Create an orient constraint with options below.") self.ButtonScale = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonScale.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonScale.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonScale.setText("") icon4 = QtGui.QIcon() icon4.addPixmap(QtGui.QPixmap(":/scaleConstraint.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonScale.setIcon(icon4) self.ButtonScale.setIconSize(QtCore.QSize(40, 40)) self.ButtonScale.setFlat(False) self.ButtonScale.setToolTip( "Create a scale constraint with options below.") self.ButtonRemove = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonRemove.setMinimumSize(QtCore.QSize(40, 40)) self.ButtonRemove.setMaximumSize(QtCore.QSize(40, 40)) self.ButtonRemove.setText("") icon5 = QtGui.QIcon() icon5.addPixmap(QtGui.QPixmap(":/smallTrash.png"), QtGui.QIcon.Normal, QtGui.QIcon.On) self.ButtonRemove.setIcon(icon5) self.ButtonRemove.setIconSize(QtCore.QSize(40, 40)) self.ButtonRemove.setFlat(False) self.ButtonRemove.setToolTip("Remove constraint from the scene.") self.tabWidget = QtWidgets.QTabWidget(self.verticalLayoutWidget) self.tabWidget.setMinimumSize(QtCore.QSize(240, 205)) self.tabWidget.setMaximumSize(QtCore.QSize(240, 205)) self.tabWidget.setFont(font) self.tabWidget.setTabPosition(QtWidgets.QTabWidget.North) self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded) self.tabBar = QtWidgets.QTabBar(self.verticalLayoutWidget) self.tabWidget.setTabBar(self.tabBar) self.ConstraintOptions = QtWidgets.QWidget() self.gridLayoutWidget = QtWidgets.QWidget(self.ConstraintOptions) self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 240, 185)) self.OptionsGrid = QtWidgets.QGridLayout(self.gridLayoutWidget) self.OptionsGrid.setContentsMargins(-1, -1, -1, -1) self.OptionsGrid.setHorizontalSpacing(2) self.OptionsGrid.setVerticalSpacing(2) # Labels self.LabelOffset = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelOffset.setFont(font) self.LabelOffset.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelOffset.setText("Offset") self.LabelMOffset = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelMOffset.setFont(font) self.LabelMOffset.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelMOffset.setText("Maintain Off") self.LabelTr = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelTr.setFont(font) self.LabelTr.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelTr.setText("Translate") self.LabelRo = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelRo.setFont(font) self.LabelRo.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelRo.setText("Rotate") self.LabelSc = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelSc.setFont(font) self.LabelSc.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelSc.setText("Scale") self.LabelWeight = QtWidgets.QLabel(self.gridLayoutWidget) self.LabelWeight.setFont(font) self.LabelWeight.setLayoutDirection(QtCore.Qt.LeftToRight) self.LabelWeight.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.LabelWeight.setText("Weight") # Checkboxes self.CheckOffset = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckOffset.setChecked(True) self.CheckOffset.setText("") # Translate checkboxes self.CheckTrAll = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckTrAll.setFont(font) self.CheckTrAll.setChecked(True) self.CheckTrAll.setText("All") self.CheckTrX = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckTrX.setFont(font) self.CheckTrX.setText("X") self.CheckTrY = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckTrY.setFont(font) self.CheckTrY.setText("Y") self.CheckTrZ = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckTrZ.setFont(font) self.CheckTrZ.setText("Z") # Rotate checkboxes self.CheckRoAll = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckRoAll.setFont(font) self.CheckRoAll.setChecked(True) self.CheckRoAll.setText("All") self.CheckRoX = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckRoX.setFont(font) self.CheckRoX.setText("X") self.CheckRoY = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckRoY.setFont(font) self.CheckRoY.setText("Y") self.CheckRoZ = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckRoZ.setFont(font) self.CheckRoZ.setText("Z") # Scale checkboxes self.CheckScAll = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckScAll.setFont(font) self.CheckScAll.setChecked(True) self.CheckScAll.setText("All") self.CheckScX = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckScX.setFont(font) self.CheckScX.setText("X") self.CheckScY = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckScY.setFont(font) self.CheckScY.setText("Y") self.CheckScZ = QtWidgets.QCheckBox(self.gridLayoutWidget) self.CheckScZ.setFont(font) self.CheckScZ.setText("Z") # Spin boxes self.SpinOffsetX = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget) self.SpinOffsetX.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.SpinOffsetY = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget) self.SpinOffsetY.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.SpinOffsetZ = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget) self.SpinOffsetZ.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.SpinWeight = QtWidgets.QDoubleSpinBox(self.gridLayoutWidget) self.SpinWeight.setButtonSymbols(QtWidgets.QAbstractSpinBox.NoButtons) self.SpinWeight.setMaximum(1.0) self.SpinWeight.setSingleStep(0.1) self.SpinWeight.setProperty("value", 1.0) self.Switch = QtWidgets.QWidget() self.verticalLayoutWidget_2 = QtWidgets.QWidget(self.Switch) self.verticalLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 235, 110)) self.SwitchCol = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_2) self.SwitchCol.setSpacing(4) self.SwitchCol.setContentsMargins(5, 5, 5, 5) self.MenuSwitchTarget = QtWidgets.QComboBox( self.verticalLayoutWidget_2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) self.MenuSwitchTarget.setSizePolicy(sizePolicy) self.MenuSwitchTarget.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.MenuSwitchTarget.setFrame(True) self.MenuSwitchTarget.setToolTip("Select a target to switch to...") self.ButtonRow3 = QtWidgets.QHBoxLayout() self.ButtonRow3.setSpacing(4) self.ButtonOff = QtWidgets.QPushButton(self.verticalLayoutWidget_2) self.ButtonOff.setMinimumHeight(25) self.ButtonOff.setToolTip("Turn all target weights OFF.") self.ButtonOff.setText("OFF") self.ButtonAll = QtWidgets.QPushButton(self.verticalLayoutWidget_2) self.ButtonAll.setMinimumHeight(25) self.ButtonAll.setToolTip("Turn all target weights ON.") self.ButtonAll.setText("ALL") self.ButtonSwitch = QtWidgets.QPushButton(self.verticalLayoutWidget_2) self.ButtonSwitch.setText("Switch") self.ButtonSwitch.setMinimumHeight(25) self.ButtonSwitch.setToolTip("Weight constraint to a single target.") self.CheckVisTrans = QtWidgets.QCheckBox(self.verticalLayoutWidget_2) self.CheckVisTrans.setChecked(True) self.CheckVisTrans.setToolTip( "Keep object in the same position\nby updating constraint offsets." ) self.CheckVisTrans.setText("Maintain Visual Transforms") self.CheckKey = QtWidgets.QCheckBox(self.verticalLayoutWidget_2) self.CheckKey.setChecked(True) self.CheckKey.setToolTip( "Key offsets, transforms and blend attributes.") self.CheckKey.setText("Key") self.ButtonRow2 = QtWidgets.QHBoxLayout() self.ButtonRow2.setSpacing(0) self.ButtonHelp = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonHelp.setMinimumHeight(30) self.ButtonHelp.setFont(font) self.ButtonHelp.setToolTip("Open help documentation.") self.ButtonHelp.setText("Help") self.ButtonPurge = QtWidgets.QPushButton(self.verticalLayoutWidget) self.ButtonPurge.setMinimumHeight(30) self.ButtonPurge.setFont(font) self.ButtonPurge.setToolTip( "Remove all ConMan data. \nWARNING: CANNOT BE UNDONE") self.ButtonPurge.setText("Purge...") self.__place_ui() self.__set_connections() self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(self) self.__set_tab_order()