예제 #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)
예제 #2
0
    def __init__(self, parent):
        QtWidgets.QScrollArea.__init__(self, parent)

        self.setFrameShape(QtWidgets.QScrollArea.NoFrame)
        self.setAutoFillBackground(False)
        self.setWidgetResizable(True)
        self.setMouseTracking(True)
        # self.verticalScrollBar().setMaximumWidth(10)

        widget = QtWidgets.QWidget(self)

        # define custom properties
        self._rolloutStyle = AccordionWidget.Rounded
        self._dragDropMode = AccordionWidget.NoDragDrop
        self._scrolling = False
        self._scrollInitY = 0
        self._scrollInitVal = 0
        self._itemClass = AccordionItem

        layout = QtWidgets.QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addStretch(1)

        widget.setLayout(layout)

        self.setWidget(widget)
예제 #3
0
    def setupUi(self, re_manager):
        re_manager.setObjectName("re_manager")
        re_manager.resize(702, 722)
        self.centralwidget = QtWidgets.QWidget(re_manager)
        self.centralwidget.setEnabled(True)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.animsTreeView = QtWidgets.QTreeView(self.centralwidget)
        self.animsTreeView.setObjectName("animsTreeView")
        self.verticalLayout_2.addWidget(self.animsTreeView)
        self.animLoadSelectedBtn = QtWidgets.QPushButton(self.centralwidget)
        self.animLoadSelectedBtn.setObjectName("animLoadSelectedBtn")
        self.verticalLayout_2.addWidget(self.animLoadSelectedBtn)
        self.timeEditorBtn = QtWidgets.QPushButton(self.centralwidget)
        self.timeEditorBtn.setObjectName("timeEditorBtn")
        self.verticalLayout_2.addWidget(self.timeEditorBtn)
        self.loadSequencerBtn = QtWidgets.QPushButton(self.centralwidget)
        self.loadSequencerBtn.setObjectName("loadSequencerBtn")
        self.verticalLayout_2.addWidget(self.loadSequencerBtn)
        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName("verticalLayout")
        self.renameBonesBtn = QtWidgets.QPushButton(self.groupBox)
        self.renameBonesBtn.setObjectName("renameBonesBtn")
        self.verticalLayout.addWidget(self.renameBonesBtn)
        self.injectAnimBtn = QtWidgets.QPushButton(self.groupBox)
        self.injectAnimBtn.setObjectName("injectAnimBtn")
        self.verticalLayout.addWidget(self.injectAnimBtn)
        self.verticalLayout_2.addWidget(self.groupBox)
        re_manager.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(re_manager)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 702, 21))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        self.menuRecent_Files = QtWidgets.QMenu(self.menuFile)
        self.menuRecent_Files.setObjectName("menuRecent_Files")
        self.menuAbout = QtWidgets.QMenu(self.menubar)
        self.menuAbout.setObjectName("menuAbout")
        re_manager.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(re_manager)
        self.statusbar.setObjectName("statusbar")
        re_manager.setStatusBar(self.statusbar)
        self.actionImport_motlist = QtWidgets.QAction(re_manager)
        self.actionImport_motlist.setCheckable(False)
        self.actionImport_motlist.setObjectName("actionImport_motlist")
        self.actionAbout = QtWidgets.QAction(re_manager)
        self.actionAbout.setObjectName("actionAbout")
        self.menuFile.addAction(self.actionImport_motlist)
        self.menuFile.addAction(self.menuRecent_Files.menuAction())
        self.menuAbout.addAction(self.actionAbout)
        self.menubar.addAction(self.menuFile.menuAction())
        self.menubar.addAction(self.menuAbout.menuAction())

        self.retranslateUi(re_manager)
        QtCore.QMetaObject.connectSlotsByName(re_manager)
예제 #4
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
            }
        }
예제 #5
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
            }
        }