Example #1
0
    def __init__(self):
        super(Panel, self).__init__()

        table = QtWidgets.QTabWidget()

        layout1 = QtWidgets.QHBoxLayout()
        layout2 = QtWidgets.QHBoxLayout()
        layout3 = QtWidgets.QHBoxLayout()

        for i in range(5):
            layout1.addWidget(QtWidgets.QPushButton())

        for i in range(5):
            layout2.addWidget(QtWidgets.QCheckBox())

        for i in range(5):
            layout3.addWidget(QtWidgets.QLineEdit())

        tab1 = QtWidgets.QWidget()
        tab2 = QtWidgets.QWidget()
        tab3 = QtWidgets.QWidget()
        tab1.setLayout(layout1)
        tab2.setLayout(layout2)
        tab3.setLayout(layout3)

        table.addTab(tab1, "Push")
        table.addTab(tab2, "Checkbox")
        table.addTab(tab3, "Line edit")

        master_layout = QtWidgets.QHBoxLayout()
        master_layout.addWidget(table)
        self.setLayout(master_layout)
Example #2
0
    def setupUi(self):
        self.setObjectName("renameWindow")

        mainLayout = QtWidgets.QVBoxLayout(self)
        # groupboxes
        groupBox_rename = QtWidgets.QGroupBox("Rename")
        groupBox_replace = QtWidgets.QGroupBox("Replace")
        groupBox_prefix = QtWidgets.QGroupBox("Prefix")
        groupBox_suffix = QtWidgets.QGroupBox("Suffix")
        # lineedits
        lineEdit_rename = QtWidgets.QLineEdit(groupBox_rename)
        lineEdit_search = QtWidgets.QLineEdit(groupBox_replace)
        lineEdit_replace = QtWidgets.QLineEdit(groupBox_replace)
        lineEdit_prefix = QtWidgets.QLineEdit(groupBox_prefix)
        lineEdit_suffix = QtWidgets.QLineEdit(groupBox_suffix)
        # buttons
        btn_rename = QtWidgets.QPushButton("Rename", groupBox_rename)
        btn_apply = QtWidgets.QPushButton("Apply", groupBox_replace)
        btn_prefix = QtWidgets.QPushButton("Prefix", groupBox_prefix)
        btn_suffix = QtWidgets.QPushButton("Suffix", groupBox_suffix)
        # labels
        label_rename = QtWidgets.QLabel("eg: spine_#_jnt", groupBox_rename)
        label_search = QtWidgets.QLabel("Search for:", groupBox_replace)
        label_replace = QtWidgets.QLabel("Replace with:", groupBox_replace)
        # layout for rename section
        vLayout_rename = QtWidgets.QVBoxLayout(groupBox_rename)
        hLayout_rename = QtWidgets.QHBoxLayout()
        hLayout_rename.addWidget(lineEdit_rename)
        hLayout_rename.addWidget(btn_rename)
        vLayout_rename.addLayout(hLayout_rename)
        vLayout_rename.addWidget(label_rename)
        # layout for search / replace section
        gLayout_replace = QtWidgets.QGridLayout(groupBox_replace)
        gLayout_replace.addWidget(label_search, 0, 0, QtCore.Qt.AlignRight)
        gLayout_replace.addWidget(label_replace, 1, 0, QtCore.Qt.AlignRight)
        gLayout_replace.addWidget(lineEdit_search, 0, 1)
        gLayout_replace.addWidget(lineEdit_replace, 1, 1)
        gLayout_replace.addWidget(btn_apply, 1, 2)
        # layout for prefix
        hLayout_prefix = QtWidgets.QHBoxLayout(groupBox_prefix)
        hLayout_prefix.addWidget(lineEdit_prefix)
        hLayout_prefix.addWidget(btn_prefix)
        # layout for suffix
        hLayout_suffix = QtWidgets.QHBoxLayout(groupBox_suffix)
        hLayout_suffix.addWidget(lineEdit_suffix)
        hLayout_suffix.addWidget(btn_suffix)
        # main layout
        mainLayout.addWidget(groupBox_rename)
        mainLayout.addWidget(groupBox_replace)
        mainLayout.addWidget(groupBox_prefix)
        mainLayout.addWidget(groupBox_suffix)

        self.data = {
            'buttons': {
                'rename': btn_rename,
                'apply': btn_apply,
                'prefix': btn_prefix,
                'suffix': btn_suffix
            },
            'lineedit': {
                'rename': lineEdit_rename,
                'search': lineEdit_search,
                'replace': lineEdit_replace,
                'prefix': lineEdit_prefix,
                'suffix': lineEdit_suffix
            }
        }
Example #3
0
    def setupUi(self):
        self.setObjectName("controlFactory")

        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)

        # layouts
        mainLayout = QtWidgets.QVBoxLayout(self)
        vLayout_addCurve = QtWidgets.QVBoxLayout()
        hLayout_addCurve = QtWidgets.QHBoxLayout()
        vLayout_copyCurve = QtWidgets.QVBoxLayout()
        hLayout_copyCurve = QtWidgets.QHBoxLayout()
        vLayout_removeCurve = QtWidgets.QVBoxLayout()
        hLayout_removeCurve = QtWidgets.QHBoxLayout()
        vLayout_color = QtWidgets.QVBoxLayout()
        hLayout_color = QtWidgets.QHBoxLayout()
        vLayout_scale = QtWidgets.QVBoxLayout()
        hLayout_scale = QtWidgets.QHBoxLayout()
        vLayout_tweak = QtWidgets.QVBoxLayout()
        hLayout_tweak = QtWidgets.QHBoxLayout()
        vLayout_addGroups = QtWidgets.QVBoxLayout()
        hLayout_addOffsetGroups = QtWidgets.QHBoxLayout()

        vLayout_addCurve.addLayout(hLayout_addCurve)
        vLayout_copyCurve.addLayout(hLayout_copyCurve)
        vLayout_removeCurve.addLayout(hLayout_removeCurve)
        vLayout_color.addLayout(hLayout_color)
        vLayout_scale.addLayout(hLayout_scale)
        vLayout_tweak.addLayout(hLayout_tweak)
        vLayout_addGroups.addLayout(hLayout_addOffsetGroups)

        # buttons
        pb_addCurve = QtWidgets.QPushButton()
        pb_copyCurve = QtWidgets.QPushButton()
        pb_copyShapes = QtWidgets.QPushButton("Copy ControlShapes")
        pb_removeCurve = QtWidgets.QPushButton()
        pb_removeShapes = QtWidgets.QPushButton("Remove ControlShapes")
        pb_color = QtWidgets.QPushButton()
        pb_scale = QtWidgets.QPushButton()
        pb_tweak = QtWidgets.QPushButton()
        pb_addOffsetGroups = QtWidgets.QPushButton()
        pb_addGroups = QtWidgets.QPushButton("Add zero grp")
        pb_N = QtWidgets.QPushButton("N")
        pb_R = QtWidgets.QPushButton("R")
        pb_T = QtWidgets.QPushButton("T")
        pb_default = QtWidgets.QPushButton("X")
        pb_plusX = QtWidgets.QPushButton("+")
        pb_minusX = QtWidgets.QPushButton("-")
        pb_plusY = QtWidgets.QPushButton("+")
        pb_minusY = QtWidgets.QPushButton("-")
        pb_plusZ = QtWidgets.QPushButton("+")
        pb_minusZ = QtWidgets.QPushButton("-")
        pb_scaleDown = QtWidgets.QPushButton("-")
        pb_scaleUp = QtWidgets.QPushButton("+")
        pb_N.setSizePolicy(sizePolicy)
        pb_R.setSizePolicy(sizePolicy)
        pb_T.setSizePolicy(sizePolicy)
        pb_default.setSizePolicy(sizePolicy)

        pb_addCurve.setMaximumSize(QtCore.QSize(25, 25))
        pb_copyCurve.setMaximumSize(QtCore.QSize(25, 25))
        pb_removeCurve.setMaximumSize(QtCore.QSize(25, 25))
        pb_color.setMaximumSize(QtCore.QSize(25, 25))
        pb_scale.setMaximumSize(QtCore.QSize(25, 25))
        pb_tweak.setMaximumSize(QtCore.QSize(25, 25))
        pb_addOffsetGroups.setMaximumSize(QtCore.QSize(25, 25))
        pb_plusX.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_minusX.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_plusY.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_minusY.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_minusZ.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_plusZ.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_scaleDown.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_scaleUp.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_addCurve.setMinimumSize(QtCore.QSize(25, 25))
        pb_copyCurve.setMinimumSize(QtCore.QSize(25, 25))
        pb_removeCurve.setMinimumSize(QtCore.QSize(25, 25))
        pb_color.setMinimumSize(QtCore.QSize(25, 25))
        pb_scale.setMinimumSize(QtCore.QSize(25, 25))
        pb_tweak.setMinimumSize(QtCore.QSize(25, 25))
        pb_addOffsetGroups.setMinimumSize(QtCore.QSize(25, 25))

        # labels
        label_addCurve = QtWidgets.QLabel("Add Control Curve")
        label_addCurve.setFrameShape(QtWidgets.QFrame.NoFrame)
        label_copyCurve = QtWidgets.QLabel("Copy Control Curve")
        label_removeCurve = QtWidgets.QLabel("Remove Control Curve(s)")
        label_color = QtWidgets.QLabel("Color")
        label_scale = QtWidgets.QLabel("Scale")
        label_minScale = QtWidgets.QLabel("Min")
        label_maxScale = QtWidgets.QLabel("Max")
        label_title = QtWidgets.QLabel("Value")
        label_sliderValue = QtWidgets.QLabel("")
        label_rotation = QtWidgets.QLabel("Rotation")
        label_rtX = QtWidgets.QLabel("Rotate X")
        label_rtY = QtWidgets.QLabel("Rotate Y")
        label_rtZ = QtWidgets.QLabel("Rotate Z")
        label_addGroups = QtWidgets.QLabel("Add offset groups")
        label_minScale.setAlignment(QtCore.Qt.AlignCenter)
        label_maxScale.setAlignment(QtCore.Qt.AlignCenter)

        # minimize widgets
        widget_addCurve = QtWidgets.QWidget()
        widget_copy = QtWidgets.QWidget()
        widget_remove = QtWidgets.QWidget()
        widget_color = QtWidgets.QWidget()
        widget_scale = QtWidgets.QWidget()
        widget_tweak = QtWidgets.QWidget()
        widget_addGroups = QtWidgets.QWidget()

        vLayout_addCurve.addWidget(widget_addCurve)
        vLayout_copyCurve.addWidget(widget_copy)
        vLayout_removeCurve.addWidget(widget_remove)
        vLayout_color.addWidget(widget_color)
        vLayout_scale.addWidget(widget_scale)
        vLayout_tweak.addWidget(widget_tweak)
        vLayout_addGroups.addWidget(widget_addGroups)

        # checkbox
        cb_shapeOnly = QtWidgets.QCheckBox("ControlShape Only")
        cb_viewport = QtWidgets.QCheckBox("Viewport")
        cb_outliner = QtWidgets.QCheckBox("Outliner")
        cb_nonUniform = QtWidgets.QCheckBox("Non-uniform")
        cb_x = QtWidgets.QCheckBox("x")
        cb_y = QtWidgets.QCheckBox("y")
        cb_z = QtWidgets.QCheckBox("z")
        cb_zero = QtWidgets.QCheckBox("zero")
        cb_sdk = QtWidgets.QCheckBox("sdk")
        cb_offset = QtWidgets.QCheckBox("offset")
        cb_parent = QtWidgets.QCheckBox("parent")

        # line edits
        le_x = QtWidgets.QLineEdit()
        le_y = QtWidgets.QLineEdit()
        le_z = QtWidgets.QLineEdit()
        le_minScale = QtWidgets.QLineEdit()
        le_maxScale = QtWidgets.QLineEdit()
        le_minScale.setMaximumSize(QtCore.QSize(30, 16777215))
        le_maxScale.setMaximumSize(QtCore.QSize(30, 16777215))

        # slider
        hSlider_scaleFactor = QtWidgets.QSlider()

        # spacers
        spacerStart = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        spacerEnd = QtWidgets.QSpacerItem(40, 20,
                                          QtWidgets.QSizePolicy.Expanding,
                                          QtWidgets.QSizePolicy.Minimum)

        # add buttons to title layouts
        hLayout_addCurve.addWidget(pb_addCurve)
        hLayout_copyCurve.addWidget(pb_copyCurve)
        hLayout_removeCurve.addWidget(pb_removeCurve)
        hLayout_color.addWidget(pb_color)
        hLayout_scale.addWidget(pb_scale)
        hLayout_tweak.addWidget(pb_tweak)
        hLayout_addOffsetGroups.addWidget(pb_addOffsetGroups)

        # add labels to title layouts
        hLayout_addCurve.addWidget(label_addCurve)
        hLayout_copyCurve.addWidget(label_copyCurve)
        hLayout_removeCurve.addWidget(label_removeCurve)
        hLayout_color.addWidget(label_color)
        hLayout_scale.addWidget(label_scale)
        hLayout_tweak.addWidget(label_rotation)
        hLayout_addOffsetGroups.addWidget(label_addGroups)

        # addCurve layout
        vLayout_inner_addCurve = QtWidgets.QVBoxLayout(widget_addCurve)
        gLayout_addCurve = QtWidgets.QGridLayout()
        vLayout_inner_addCurve.addLayout(gLayout_addCurve)
        vLayout_inner_addCurve.addWidget(cb_shapeOnly)

        # copyCurve layout
        vLayout_copy = QtWidgets.QVBoxLayout(widget_copy)
        vLayout_copy.addWidget(pb_copyShapes)

        # removeCurve layout
        vLayout_remove = QtWidgets.QVBoxLayout(widget_remove)
        vLayout_remove.addWidget(pb_removeShapes)

        # color layout
        vLayout_colorWidget = QtWidgets.QVBoxLayout(widget_color)
        gLayout_color = QtWidgets.QGridLayout()
        gLayout_color.addWidget(pb_N, 0, 0, 1, 1)
        gLayout_color.addWidget(pb_R, 0, 2, 1, 1)
        gLayout_color.addWidget(pb_T, 0, 1, 1, 1)
        gLayout_color.addWidget(pb_default, 0, 3, 1, 1)
        hLayout_colorType = QtWidgets.QHBoxLayout()
        hLayout_colorType.addWidget(cb_viewport)
        hLayout_colorType.addWidget(cb_outliner)
        vLayout_colorWidget.addLayout(hLayout_colorType)
        vLayout_colorWidget.addLayout(gLayout_color)

        # scale layout
        vLayout_scaleWidget = QtWidgets.QVBoxLayout(widget_scale)
        vLayout_nonUniform = QtWidgets.QVBoxLayout()
        vLayout_nonUniform.addWidget(cb_nonUniform)
        hLayout_nonUniform = QtWidgets.QHBoxLayout()
        hLayout_nonUniform.setContentsMargins(30, -1, -1, -1)
        hLayout_nonUniform.addWidget(cb_x)
        hLayout_nonUniform.addWidget(cb_y)
        hLayout_nonUniform.addWidget(cb_z)
        vLayout_nonUniform.addLayout(hLayout_nonUniform)
        hLayout_upDown = QtWidgets.QHBoxLayout()
        vLayout_scaleFactor = QtWidgets.QVBoxLayout()
        hLayout_scaleFactor = QtWidgets.QHBoxLayout()
        vLayout_min = QtWidgets.QVBoxLayout()
        vLayout_min.addWidget(label_minScale)
        vLayout_min.addWidget(le_minScale)
        hLayout_scaleFactor.addLayout(vLayout_min)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        hLayout_scaleFactor.addItem(spacerItem)
        vLayout_sliderValue = QtWidgets.QVBoxLayout()
        vLayout_sliderValue.addWidget(label_title)
        vLayout_sliderValue.addWidget(label_sliderValue)
        hLayout_scaleFactor.addLayout(vLayout_sliderValue)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        hLayout_scaleFactor.addItem(spacerItem)
        vLayout_max = QtWidgets.QVBoxLayout()
        vLayout_max.addWidget(label_maxScale)
        vLayout_max.addWidget(le_maxScale)
        hLayout_scaleFactor.addLayout(vLayout_max)
        vLayout_scaleFactor.addLayout(hLayout_scaleFactor)
        hSlider_scaleFactor.setMinimum(1)
        hSlider_scaleFactor.setOrientation(QtCore.Qt.Horizontal)
        hSlider_scaleFactor.setTickPosition(QtWidgets.QSlider.NoTicks)
        vLayout_scaleFactor.addWidget(hSlider_scaleFactor)
        hLayout_upDown.addLayout(vLayout_scaleFactor)
        vLayout_btn = QtWidgets.QVBoxLayout()
        spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum,
                                       QtWidgets.QSizePolicy.Preferred)
        vLayout_btn.addItem(spacer)
        hLayout_btn = QtWidgets.QHBoxLayout()
        hLayout_btn.addWidget(pb_scaleDown)
        hLayout_btn.addWidget(pb_scaleUp)
        vLayout_btn.addLayout(hLayout_btn)
        hLayout_upDown.addLayout(vLayout_btn)
        vLayout_scaleWidget.addLayout(vLayout_nonUniform)
        vLayout_scaleWidget.addLayout(hLayout_upDown)

        # tweak layout
        gLayout_tweak = QtWidgets.QGridLayout(widget_tweak)
        gLayout_tweak.addItem(spacerStart, 0, 0, 1, 1)
        gLayout_tweak.addWidget(pb_plusX, 0, 4, 1, 1)
        gLayout_tweak.addWidget(le_x, 0, 2, 1, 1)
        gLayout_tweak.addWidget(pb_minusX, 0, 3, 1, 1)
        gLayout_tweak.addWidget(label_rtX, 0, 1, 1, 1)
        gLayout_tweak.addItem(spacerEnd, 0, 5, 1, 1)
        gLayout_tweak.addWidget(label_rtY, 1, 1, 1, 1)
        gLayout_tweak.addWidget(label_rtZ, 2, 1, 1, 1)
        gLayout_tweak.addWidget(le_y, 1, 2, 1, 1)
        gLayout_tweak.addWidget(le_z, 2, 2, 1, 1)
        gLayout_tweak.addWidget(pb_minusY, 1, 3, 1, 1)
        gLayout_tweak.addWidget(pb_minusZ, 2, 3, 1, 1)
        gLayout_tweak.addWidget(pb_plusY, 1, 4, 1, 1)
        gLayout_tweak.addWidget(pb_plusZ, 2, 4, 1, 1)

        # add groups layout
        vLayout_addOffsetGroups = QtWidgets.QVBoxLayout(widget_addGroups)
        hLayout_addGroups = QtWidgets.QHBoxLayout()
        hLayout_addGroups.addWidget(cb_zero)
        hLayout_addGroups.addWidget(cb_sdk)
        hLayout_addGroups.addWidget(cb_offset)
        hLayout_addGroups.addWidget(cb_parent)
        vLayout_addOffsetGroups.addLayout(hLayout_addGroups)
        vLayout_addOffsetGroups.addWidget(pb_addGroups)

        line_1 = QtWidgets.QFrame()
        line_1.setFrameShape(QtWidgets.QFrame.HLine)
        line_1.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_2 = QtWidgets.QFrame()
        line_2.setFrameShape(QtWidgets.QFrame.HLine)
        line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_3 = QtWidgets.QFrame()
        line_3.setFrameShape(QtWidgets.QFrame.HLine)
        line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_4 = QtWidgets.QFrame()
        line_4.setFrameShape(QtWidgets.QFrame.HLine)
        line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_5 = QtWidgets.QFrame()
        line_5.setFrameShape(QtWidgets.QFrame.HLine)
        line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_6 = QtWidgets.QFrame()
        line_6.setFrameShape(QtWidgets.QFrame.HLine)
        line_6.setFrameShadow(QtWidgets.QFrame.Sunken)

        mainLayout.addLayout(vLayout_addCurve)
        mainLayout.addWidget(line_1)
        mainLayout.addLayout(vLayout_copyCurve)
        mainLayout.addWidget(line_2)
        mainLayout.addLayout(vLayout_removeCurve)
        mainLayout.addWidget(line_3)
        mainLayout.addLayout(vLayout_color)
        mainLayout.addWidget(line_4)
        mainLayout.addLayout(vLayout_scale)
        mainLayout.addWidget(line_5)
        mainLayout.addLayout(vLayout_tweak)
        mainLayout.addWidget(line_6)
        mainLayout.addLayout(vLayout_addGroups)

        self.data = {
            'buttons': {
                'addCurve': pb_addCurve,
                'copyCurve': pb_copyCurve,
                'copyShapes': pb_copyShapes,
                'removeCurve': pb_removeCurve,
                'removeShapes': pb_removeShapes,
                'color': pb_color,
                'scale': pb_scale,
                'tweak': pb_tweak,
                'addOffsetGroups': pb_addOffsetGroups,
                'addGroups': pb_addGroups,
                'N': pb_N,
                'R': pb_R,
                'T': pb_T,
                'X': pb_default,
                'plusX': pb_plusX,
                'minusX': pb_minusX,
                'plusY': pb_plusY,
                'minusY': pb_minusY,
                'plusZ': pb_plusZ,
                'minusZ': pb_minusZ,
                'scaleDown': pb_scaleDown,
                'scaleUp': pb_scaleUp
            },
            'layouts': {
                'addCurve': gLayout_addCurve,
                'color': gLayout_color
            },
            'widgets': {
                'addCurve': widget_addCurve,
                'copy': widget_copy,
                'remove': widget_remove,
                'color': widget_color,
                'scale': widget_scale,
                'tweak': widget_tweak,
                'addGroups': widget_addGroups
            },
            'checkbox': {
                'shapeOnly': cb_shapeOnly,
                'viewport': cb_viewport,
                'outliner': cb_outliner,
                'nonUniform': cb_nonUniform,
                'x': cb_x,
                'y': cb_y,
                'z': cb_z,
                'zero': cb_zero,
                'sdk': cb_sdk,
                'offset': cb_offset,
                'parent': cb_parent
            },
            'lineedit': {
                'x': le_x,
                'y': le_y,
                'z': le_z,
                'minScale': le_minScale,
                'maxScale': le_maxScale
            },
            'slider': {
                'scale': hSlider_scaleFactor
            },
            'label': {
                'slider': label_sliderValue
            }
        }
Example #4
0
    def setupUi(self):
        self.setObjectName("dataIO")

        mainLayout = QtWidgets.QVBoxLayout(self)
        mainLayout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)

        pb_import = QtWidgets.QPushButton("Import")  # u'\uf093'
        pb_export = QtWidgets.QPushButton("Export")  # u'\uf0c7'
        hLayout1 = QtWidgets.QHBoxLayout()
        hLayout1.addWidget(pb_import)
        hLayout1.addWidget(pb_export)

        pb_skin = QtWidgets.QPushButton(u'SKIN')
        pb_ctrl = QtWidgets.QPushButton(u'CTRL')
        pb_channel = QtWidgets.QPushButton(u'CH')
        pb_sdk = QtWidgets.QPushButton(u'SDK')
        pb_skeleton = QtWidgets.QPushButton(u'SKEL')
        pb_blendshape = QtWidgets.QPushButton(u'BSHP')
        pb_pose = QtWidgets.QPushButton(u'POSE')
        btnLayout = QtWidgets.QHBoxLayout()
        btnLayout.addWidget(pb_skin)
        btnLayout.addWidget(pb_ctrl)
        btnLayout.addWidget(pb_channel)
        btnLayout.addWidget(pb_sdk)
        btnLayout.addWidget(pb_skeleton)
        btnLayout.addWidget(pb_blendshape)
        btnLayout.addWidget(pb_pose)

        le_filepath = QtWidgets.QLineEdit()
        pb_browse = QtWidgets.QPushButton(u'\uf07b')
        le_filepath.setText(cmds.workspace(q=1, rd=1) + 'skin.json')
        hLayout2 = QtWidgets.QHBoxLayout()
        hLayout2.addWidget(le_filepath)
        hLayout2.addWidget(pb_browse)

        pb_apply = QtWidgets.QPushButton(u'APPLY')
        vLayout = QtWidgets.QVBoxLayout()
        vLayout.addWidget(pb_apply)

        mainLayout.addLayout(hLayout1)
        mainLayout.addLayout(btnLayout)
        mainLayout.addLayout(hLayout2)
        mainLayout.addLayout(vLayout)

        w_skin = QtWidgets.QWidget()
        w_ctrl = QtWidgets.QWidget()
        w_channel = QtWidgets.QWidget()
        w_sdk = QtWidgets.QWidget()
        w_skeleton = QtWidgets.QWidget()
        w_blendshape = QtWidgets.QWidget()
        w_pose = QtWidgets.QWidget()
        mainLayout.addWidget(w_skin)
        mainLayout.addWidget(w_ctrl)
        mainLayout.addWidget(w_channel)
        mainLayout.addWidget(w_sdk)
        mainLayout.addWidget(w_skeleton)
        mainLayout.addWidget(w_blendshape)
        mainLayout.addWidget(w_pose)

        # set checkable
        pb_skin.setCheckable(1)
        pb_ctrl.setCheckable(1)
        pb_channel.setCheckable(1)
        pb_sdk.setCheckable(1)
        pb_skeleton.setCheckable(1)
        pb_blendshape.setCheckable(1)
        pb_pose.setCheckable(1)

        pb_import.setCheckable(1)
        pb_export.setCheckable(1)

        # set visible
        w_skin.hide()
        w_ctrl.hide()
        w_channel.hide()
        w_sdk.hide()
        w_skeleton.hide()
        w_pose.hide()

        # name all the important widgets
        names = {
            # Buttons
            "SkinButton": pb_skin,
            "CtrlButton": pb_ctrl,
            "ChannelButton": pb_channel,
            "SDKButton": pb_sdk,
            "SkeletonButton": pb_skeleton,
            "BlendshapeButton": pb_blendshape,
            "PoseButton": pb_pose,
            "ImportButton": pb_import,
            "ExportButton": pb_export,
            "BrowseButton": pb_browse,
            "ApplyButton": pb_apply,

            # LineEdits
            "FilePath": le_filepath,
        }

        for name, w in names.items():
            w.setObjectName(name)

        self.data = {
            'buttons': {
                'import': pb_import,
                'export': pb_export,
                'browse': pb_browse,
                'apply': pb_apply
            },
            'options': {
                'skin': pb_skin,
                'ctrl': pb_ctrl,
                'channel': pb_channel,
                'sdk': pb_sdk,
                'skeleton': pb_skeleton,
                'shp': pb_blendshape,
                'pose': pb_pose
            },
            'lineedits': {
                'browse': le_filepath
            },
            'widgets': {
                'skin': w_skin,
                'ctrl': w_ctrl,
                'channel': w_channel,
                'sdk': w_sdk,
                'skeleton': w_skeleton,
                'shp': w_blendshape,
                'pose': w_pose
            }
        }
Example #5
0
    def setupUi(self):
        self.setObjectName("jointFactory")

        mainLayout= QtWidgets.QVBoxLayout(self)

        # buttons
        pb_toggle = QtWidgets.QPushButton("Toggle Local Axes Visibility")
        pb_orientJoints = QtWidgets.QPushButton("Orient Joints")
        pb_planarOrientJoints = QtWidgets.QPushButton("Planar Orient Joints for 3")
        pb_minusX = QtWidgets.QPushButton("-")
        pb_plusX = QtWidgets.QPushButton("+")
        pb_minusY = QtWidgets.QPushButton("-")
        pb_plusY = QtWidgets.QPushButton("+")
        pb_minusZ = QtWidgets.QPushButton("-")
        pb_plusZ = QtWidgets.QPushButton("+")
        pb_insertJoints = QtWidgets.QPushButton("Apply")
        pb_copyJointOrient = QtWidgets.QPushButton("Copy Joint Orientation")
        pb_turnOffLRA = QtWidgets.QPushButton("Turn Off All LRA")

        pb_minusX.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_plusX.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_minusY.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_plusY.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_minusZ.setMaximumSize(QtCore.QSize(30, 16777215))
        pb_plusZ.setMaximumSize(QtCore.QSize(30, 16777215))

        # radio buttons
        rb_worldUpAxisX = QtWidgets.QRadioButton("x")
        rb_worldUpAxisY = QtWidgets.QRadioButton("y")
        rb_worldUpAxisZ = QtWidgets.QRadioButton("z")
        rb_aimAxisX = QtWidgets.QRadioButton("x")
        rb_aimAxisY = QtWidgets.QRadioButton("y")
        rb_aimAxisZ = QtWidgets.QRadioButton("z")
        rb_upAxisX = QtWidgets.QRadioButton("x")
        rb_upAxisY = QtWidgets.QRadioButton("y")
        rb_upAxisZ = QtWidgets.QRadioButton("z")

        rbg_worldUpAxis = QtWidgets.QButtonGroup(self)
        rbg_worldUpAxis.addButton(rb_worldUpAxisX)
        rbg_worldUpAxis.addButton(rb_worldUpAxisY)
        rbg_worldUpAxis.addButton(rb_worldUpAxisZ)
        rbg_aimAxis = QtWidgets.QButtonGroup(self)
        rbg_aimAxis.addButton(rb_aimAxisX)
        rbg_aimAxis.addButton(rb_aimAxisY)
        rbg_aimAxis.addButton(rb_aimAxisZ)
        rbg_upAxis = QtWidgets.QButtonGroup(self)
        rbg_upAxis.addButton(rb_upAxisX)
        rbg_upAxis.addButton(rb_upAxisY)
        rbg_upAxis.addButton(rb_upAxisZ)

        hLayout_worldUpAxis = QtWidgets.QHBoxLayout()
        hLayout_worldUpAxis.addWidget(rb_worldUpAxisX)
        hLayout_worldUpAxis.addWidget(rb_worldUpAxisY)
        hLayout_worldUpAxis.addWidget(rb_worldUpAxisZ)
        hLayout_aimAxis = QtWidgets.QHBoxLayout()
        hLayout_aimAxis.addWidget(rb_aimAxisX)
        hLayout_aimAxis.addWidget(rb_aimAxisY)
        hLayout_aimAxis.addWidget(rb_aimAxisZ)
        hLayout_upAxis = QtWidgets.QHBoxLayout()
        hLayout_upAxis.addWidget(rb_upAxisX)
        hLayout_upAxis.addWidget(rb_upAxisY)
        hLayout_upAxis.addWidget(rb_upAxisZ)

        # checkbox
        cb_orientChildren = QtWidgets.QCheckBox("Orient children")
        cb_orient2World = QtWidgets.QCheckBox("Orient Joint to World")

        cb_orientChildren.setLayoutDirection(QtCore.Qt.LeftToRight)
        cb_orient2World.setLayoutDirection(QtCore.Qt.LeftToRight)

        # combo box
        combo_upAxis = QtWidgets.QComboBox()
        combo_upAxis.addItem("+")
        combo_upAxis.addItem("-")
        combo_aimAxis = QtWidgets.QComboBox()
        combo_aimAxis.addItem("+")
        combo_aimAxis.addItem("-")
        combo_worldUpAxis = QtWidgets.QComboBox()
        combo_worldUpAxis.addItem("+")
        combo_worldUpAxis.addItem("-")

        # labels
        label_upAxis = QtWidgets.QLabel("Up Axis")
        label_worldUpAxis = QtWidgets.QLabel("World Up Axis:")
        label_aimAxis = QtWidgets.QLabel("Aim Axis:")
        label_x = QtWidgets.QLabel("x")
        label_y = QtWidgets.QLabel("y")
        label_z = QtWidgets.QLabel("z")
        label_insertJoints = QtWidgets.QLabel("Insert Joints:")
        label_upAxis.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        label_worldUpAxis.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)
        label_aimAxis.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter)

        # line edits
        le_x = QtWidgets.QLineEdit()
        le_y = QtWidgets.QLineEdit()
        le_z = QtWidgets.QLineEdit()
        le_insertJoints = QtWidgets.QLineEdit()

        spacerStart = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        spacerEnd = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        gLayout_orient = QtWidgets.QGridLayout()
        gLayout_orient.setContentsMargins(-1, -1, 0, -1)
        gLayout_orient.addLayout(hLayout_worldUpAxis, 4, 2, 1, 1)
        gLayout_orient.addLayout(hLayout_aimAxis, 2, 2, 1, 1)
        gLayout_orient.addWidget(cb_orientChildren, 0, 2, 1, 1)
        gLayout_orient.addWidget(combo_upAxis, 3, 3, 1, 1)
        gLayout_orient.addItem(spacerStart, 2, 0, 1, 1)
        gLayout_orient.addItem(spacerEnd, 2, 4, 1, 1)
        gLayout_orient.addWidget(cb_orient2World, 1, 2, 1, 1)
        gLayout_orient.addWidget(label_upAxis, 3, 1, 1, 1)
        gLayout_orient.addWidget(combo_worldUpAxis, 4, 3, 1, 1)
        gLayout_orient.addWidget(combo_aimAxis, 2, 3, 1, 1)
        gLayout_orient.addWidget(label_worldUpAxis, 4, 1, 1, 1)
        gLayout_orient.addWidget(label_aimAxis, 2, 1, 1, 1)
        gLayout_orient.addLayout(hLayout_upAxis, 3, 2, 1, 1)

        spacerEnd = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        spacerStart = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        gLayout_tweak = QtWidgets.QGridLayout()
        gLayout_tweak.addWidget(label_x, 0, 1, 1, 1)
        gLayout_tweak.addWidget(le_z, 2, 2, 1, 1)
        gLayout_tweak.addWidget(le_y, 1, 2, 1, 1)
        gLayout_tweak.addWidget(label_y, 1, 1, 1, 1)
        gLayout_tweak.addWidget(le_x, 0, 2, 1, 1)
        gLayout_tweak.addWidget(label_z, 2, 1, 1, 1)
        gLayout_tweak.addItem(spacerEnd, 0, 6, 1, 1)
        gLayout_tweak.addItem(spacerStart, 0, 0, 1, 1)
        gLayout_tweak.addWidget(pb_minusX, 0, 3, 1, 1)
        gLayout_tweak.addWidget(pb_plusX, 0, 4, 1, 1)
        gLayout_tweak.addWidget(pb_minusY, 1, 3, 1, 1)
        gLayout_tweak.addWidget(pb_plusY, 1, 4, 1, 1)
        gLayout_tweak.addWidget(pb_minusZ, 2, 3, 1, 1)
        gLayout_tweak.addWidget(pb_plusZ, 2, 4, 1, 1)

        line_1 = QtWidgets.QFrame()
        line_1.setFrameShape(QtWidgets.QFrame.HLine)
        line_1.setFrameShadow(QtWidgets.QFrame.Sunken)
        line_2 = QtWidgets.QFrame()
        line_2.setFrameShape(QtWidgets.QFrame.HLine)
        line_2.setFrameShadow(QtWidgets.QFrame.Sunken)

        spacerStart = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        spacerEnd = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        hLayout_insert = QtWidgets.QHBoxLayout()
        hLayout_insert.setContentsMargins(0, -1, 0, -1)
        hLayout_insert.addItem(spacerStart)
        hLayout_insert.addWidget(label_insertJoints)
        hLayout_insert.addWidget(le_insertJoints)
        hLayout_insert.addWidget(pb_insertJoints)
        hLayout_insert.addItem(spacerEnd)

        mainLayout.addWidget(pb_toggle)
        mainLayout.addLayout(gLayout_orient)
        mainLayout.addWidget(pb_orientJoints)
        mainLayout.addWidget(pb_planarOrientJoints)
        mainLayout.addWidget(line_1)
        mainLayout.addLayout(gLayout_tweak)
        mainLayout.addWidget(line_2)
        mainLayout.addLayout(hLayout_insert)
        mainLayout.addWidget(pb_copyJointOrient)
        mainLayout.addWidget(pb_turnOffLRA)
        mainLayout.setStretch(0, 1)

        self.data = {
            'buttons': {
                'toggle': pb_toggle,
                'orientJoints': pb_orientJoints,
                'planarOrientJoints': pb_planarOrientJoints,
                'minusX': pb_minusX,
                'plusX': pb_plusX,
                'minusY': pb_minusY,
                'plusY': pb_plusY,
                'minusZ': pb_minusZ,
                'plusZ': pb_plusZ,
                'insertJoints': pb_insertJoints,
                'copyJointOrient': pb_copyJointOrient,
                'turnOffLRA': pb_turnOffLRA
            },
            'radio': {
                'worldUpAxisX': rb_worldUpAxisX,
                'worldUpAxisY': rb_worldUpAxisY,
                'worldUpAxisZ': rb_worldUpAxisZ,
                'aimAxisX': rb_aimAxisX,
                'aimAxisY': rb_aimAxisY,
                'aimAxisZ': rb_aimAxisZ,
                'upAxisX': rb_upAxisX,
                'upAxisY': rb_upAxisY,
                'upAxisZ': rb_upAxisZ
            },
            'rbg': {
                'worldUpAxis': rbg_worldUpAxis,
                'aimAxis': rbg_aimAxis,
                'upAxis': rbg_upAxis
            },
            'checkbox': {
                'orientChildren': cb_orientChildren,
                'orient2World': cb_orient2World
            },
            'combo': {
                'upAxis': combo_upAxis,
                'aimAxis': combo_aimAxis,
                'worldUpAxis': combo_worldUpAxis
            },
            'lineedit': {
                'x': le_x,
                'y': le_y,
                'z': le_z,
                'insertJoints': le_insertJoints
            }
        }