def setupUI(self):
        centralWidget = QtWidgets.QWidget()
        mainLayout = QtWidgets.QVBoxLayout()
        mainLayout.setAlignment(QtCore.Qt.AlignTop)

        pathLayout = UI.HorBox()
        browseBtn = UI.ButtonB('...')

        pathLayout.addWidget(self.sklFolder)
        pathLayout.addWidget(browseBtn)

        btnLayout = UI.HorBox()
        saveBtn = UI.ButtonB('Save skeleton')
        loadBtn = UI.ButtonB('Load skeleton')
        btnLayout.addWidget(saveBtn)
        btnLayout.addWidget(loadBtn)

        # mainLayout.addLayout(pathLayout)
        mainLayout.addLayout(btnLayout)

        centralWidget.setLayout(mainLayout)
        self.setCentralWidget(centralWidget)

        # browseBtn.clicked.connect(self.browseSklFolder)
        saveBtn.clicked.connect(self.saveSkl)
        loadBtn.clicked.connect(self.loadSkl)
    def setupUI(self):
        centralWidget = qt_handlers.qWidget()

        mainLayout = UI.VertBox()
        mainBox = UI.TitledBox(title='Controllers Util')

        nameLayout = UI.HorBox()
        self.ctrlNameEdit = UI.LabelEditWidget(label='Name')
        pickNameBtn = UI.ButtonB('<<')
        self.ctrlTargetPicker = UI.ObjectPickerWidget(label='Target')

        ctrlLayout = UI.HorBox()
        ctrlLayout.setAlignment(QtCore.Qt.AlignLeft)
        shapes = ['circle', 'box', 'square', 'joint']
        self.ctrlShape = UI.LabelComboWidget(label='Shape')
        # self.ctrlShape.setMaximumWidth(140)
        self.ctrlShape.combo.addItems(shapes)
        attrSeparator = UI.Separator(d=1)
        self.ctrlScaleSlider = UI.FloatSpinWidget(label='Scale')
        self.ctrlScaleSlider.spin.setValue(1.0)
        ctrlLayout.addWidget(self.ctrlShape)
        ctrlLayout.addWidget(attrSeparator)
        ctrlLayout.addWidget(self.ctrlScaleSlider)

        separator = UI.Separator()
        btnLayout = UI.HorBox()
        newBtn = UI.ButtonB('create')
        exportBtn = UI.ButtonB('export')
        importBtn = UI.ButtonB('import')

        btnLayout.addWidget(exportBtn)
        btnLayout.addWidget(importBtn)

        separator1 = UI.Separator()
        titleBar = UI.TitleBar(title='Library')
        separator2 = UI.Separator()

        nameLayout.addWidget(self.ctrlNameEdit)
        nameLayout.addWidget(pickNameBtn)
        mainBox.layout.addLayout(nameLayout)
        mainBox.layout.addWidget(self.ctrlTargetPicker)
        mainBox.layout.addLayout(ctrlLayout)
        mainBox.layout.addWidget(separator)
        mainBox.layout.addWidget(newBtn)
        mainBox.layout.addWidget(separator1)
        mainBox.layout.addWidget(titleBar)
        mainBox.layout.addWidget(separator2)
        mainBox.layout.addLayout(btnLayout)

        newBtn.released.connect(self.createCtrl)
        pickNameBtn.released.connect(self.setCtrlName)
        exportBtn.released.connect(self.exportShape)
        importBtn.released.connect(self.importShape)

        mainLayout.addWidget(mainBox)

        centralWidget.setLayout(mainLayout)
        self.setCentralWidget(centralWidget)
    def add_blueprints_ui(self):
        """
        Sets up the Blueprint tab UI
        Dynamically creates the UI for the creation of the blueprints by getting a list of python files holding the
         blueprints from modules/blueprint
        Currently each blueprint module gets a button
        """
        blueprints_layout = UI.VertBox()
        self.bp_box = UI.TitledBox(title='Blueprints')

        bp_ui_layout = QGridLayout()
        blueprints_list = self.get_bp_files_list()

        if blueprints_list:
            num_bp = len(blueprints_list)
            for i in range(num_bp):
                if blueprints_list[
                        i] != 'blueprint':  # we dont need to create an UI for the blueprint base class
                    python_module = self.import_python_module(
                        blueprints_list[i])
                    if python_module:
                        module_ui = self.create_bp_ui(
                            mod_name=python_module.BLUEPRINT_TYPE, index=i)
                        self.bp_modules_ui.append(module_ui)

        for i, m in enumerate(self.bp_modules_ui):
            bp_ui_layout.addWidget(m, i / 3, i % 3)

        btn_layout = UI.HorBox()
        btn_layout.setAlignment(Qt.AlignRight)

        edit_bp_btn = UI.ButtonB('Edit')
        delete_bp_btn = UI.ButtonB('Delete')
        delete_bp_btn.setStyleSheet(
            "background-color: rgb(250,10,20); font-weight: bold")
        btn_layout.addWidget(edit_bp_btn)
        btn_layout.addWidget(delete_bp_btn)

        self.bp_settings_ui_layout = UI.HorBox()

        self.bp_box.layout.addLayout(bp_ui_layout)
        self.bp_box.layout.addLayout(self.bp_settings_ui_layout)
        separator = UI.Separator()
        self.bp_box.layout.addWidget(separator)
        self.bp_box.layout.addWidget(self.bp_list)
        self.bp_box.layout.addLayout(btn_layout)

        blueprints_layout.addWidget(self.bp_box)
        self.bp_widget.setLayout(blueprints_layout)

        edit_bp_btn.released.connect(self.editSelectedBlueprint)
        self.bp_list.doubleClicked.connect(self.deselect_bp)
Exemple #4
0
    def setupUI(self):
        centralWidget = QtWidgets.QWidget()

        mainLayout = UI.VertBox()
        mainBox = UI.TitledBox(title='Skin IO')

        skinFolderLayout = UI.HorBox()
        self.skinFolderEdit = UI.LabelEditWidget(label='Skin Folder')
        skinFolderBtn = UI.ButtonB('<<')

        skinFolderLayout.addWidget(self.skinFolderEdit)
        skinFolderLayout.addWidget(skinFolderBtn)

        exportBtn = UI.ButtonB('Export')
        importBtn = UI.ButtonB('Import')

        exportBtn.clicked.connect(self.exportSkin)
        importBtn.clicked.connect(self.importSkin)
        skinFolderBtn.clicked.connect(self.setSkinsFolder)

        mainBox.layout.addLayout(skinFolderLayout)
        mainBox.layout.addWidget(exportBtn)
        mainBox.layout.addWidget(importBtn)

        mainLayout.addWidget(mainBox)

        centralWidget.setLayout(mainLayout)
        self.setCentralWidget(centralWidget)
Exemple #5
0
    def __init__(self, parent=getMayaWindow()):
        super(CharBrowserUI, self).__init__(parent)

        #
        self.repo_path = 'c:\\repo\\StarIsland_content\\'
        self.char_list = self.get_dirs(self.repo_path)
        self.back_folders_btn = []
        self.favorite_folders = []
        # UI members
        self.char_layout = UI.VertBox()
        self.back_folders_layout = UI.HorBox()
        self.back_folders_layout.setAlignment(QtCore.Qt.AlignLeft)
        self.char_combo = QtWidgets.QComboBox()
        self.char_combo.setMinimumHeight(30)
        self.char_combo.setEditable(1)
        self.char_combo.lineEdit().setReadOnly(1)
        self.char_combo.lineEdit().setAlignment(QtCore.Qt.AlignCenter)
        self.action_btn_layout = QtWidgets.QHBoxLayout()
        self.set_project_btn = UI.ActionButton('Set Project')
        self.open_file_btn = UI.ActionButton('Open File')
        self.save_file_btn = UI.ActionButton('Save File')

        self.char_browser = QtWidgets.QListWidget()
        #
        self.setWindowTitle('Staramba Char Browser')
        self.setObjectName(CharBrowserUIWin)

        self.setupUI()
        self.resize(400, 500)
Exemple #6
0
    def add_char_ui(self):
        """
        Sets up the UI for the character.

        Important:
        char_box.layout  - the layout where all the widgets should be added
        """
        char_layout = UI.VertBox()

        char_box = UI.TitledBox(title='Character')

        self.char_settings = char_settings.CharSettingsWidget()
        name_layout = UI.HorBox()
        self.char_name = UI.LabelEditWidget(label='Character name:', label_size=85, edit_size=80)
        self.char_name_suffix = UI.LabelEditWidget(label='+', label_size=10, edit_size=40)
        self.char_name_suffix.edit.setText('_' + MRIGLOBALS.CHAR)

        name_layout.addWidget(self.char_name)
        name_layout.addWidget(self.char_name_suffix)

        title = UI.TitleBar(title='Name')
        btn_layout = UI.HorBox()
        new_char_btn = UI.ButtonB('NEW')
        new_char_btn.setStyleSheet("background-color: rgb(0,100,200); font-weight: bold")
        delete_char_btn = UI.ButtonB('Rename')
        btn_layout.addWidget(new_char_btn)
        btn_layout.addWidget(delete_char_btn)

        separator = UI.Separator()

        char_box.layout.addWidget(self.char_settings)
        char_box.layout.addWidget(title)
        char_box.layout.addLayout(name_layout)
        char_box.layout.addWidget(separator)
        char_box.layout.addLayout(btn_layout)

        char_layout.addWidget(char_box)

        new_char_btn.clicked.connect(self.create_character)

        self.char_widget.setLayout(char_layout)
Exemple #7
0
    def setupUI(self):
        mainLayout = UI.VertBox()
        mainBox = UI.TitledBox(title='Mappings')
        mainBoxLayout = UI.HorBox()

        unmappedLayout = UI.VertBox()
        separator = UI.Separator(d=1)
        mapBtnLayout = UI.VertBox()
        mapBtnLayout.setAlignment(QtCore.Qt.AlignVCenter)
        separator1 = UI.Separator(d=1)
        importedLayout = UI.VertBox()

        mainBoxLayout.addLayout(unmappedLayout)
        mainBoxLayout.addWidget(separator)
        mainBoxLayout.addLayout(mapBtnLayout)
        mainBoxLayout.addWidget(separator1)
        mainBoxLayout.addLayout(importedLayout)

        #########
        label = QtWidgets.QLabel('Unmapped influences')
        label.setAlignment(QtCore.Qt.AlignHCenter)

        self.existingInfluences = QtWidgets.QListWidget()
        unmappedLayout.addWidget(label)
        unmappedLayout.addWidget(self.existingInfluences)
        ###############
        mapBtn = QtWidgets.QPushButton('>>>')
        mapBtn.setFixedWidth(30)
        mapBtn.released.connect(self.setInfluenceMapping)
        mapBtnLayout.addWidget(mapBtn)

        unmapBtn = QtWidgets.QPushButton('<<<')
        unmapBtn.setFixedWidth(30)
        unmapBtn.released.connect(self.resetInfluenceMapping)
        mapBtnLayout.addWidget(unmapBtn)

        #############
        label = QtWidgets.QLabel('Available imported influences')
        label.setAlignment(QtCore.Qt.AlignHCenter)
        self.importedInfluences = QtWidgets.QListWidget()
        importedLayout.addWidget(label)
        importedLayout.addWidget(self.importedInfluences)
        ################
        okBtn = QtWidgets.QPushButton('Ok')
        okBtn.clicked.connect(self.accept)

        mainBox.layout.addLayout(mainBoxLayout)
        mainLayout.addWidget(mainBox)
        mainLayout.addWidget(okBtn)
        self.setLayout(mainLayout)
    def add_char_ui(self):
        """
        Sets up the UI for the character.

        Important:
        char_box.layout  - the layout where all the widgets should be added
        """
        char_layout = UI.VertBox()

        char_box = UI.TitledBox(title='Character')

        # self.char_settings = char_settings.CharSettingsWidget()
        # name_layout = UI.HorBox()
        self.char_name = UI.LabelEditWidget(label='Character name:',
                                            label_size=85)
        self.char_name.edit.setReadOnly(1)
        self.char_name.hide()
        #
        # name_layout.addWidget(self.char_name)
        # name_layout.addWidget(self.char_name_suffix)
        #
        # title = UI.TitleBar(title='Name')
        btn_layout = UI.HorBox()
        new_char_btn = UI.ButtonB('NEW')
        new_char_btn.setStyleSheet(
            "background-color: rgb(0,100,200); font-weight: bold")
        delete_char_btn = UI.ButtonB('Rename')
        btn_layout.addWidget(new_char_btn)
        btn_layout.addWidget(delete_char_btn)

        separator = UI.Separator()

        # char_box.layout.addWidget(self.char_settings)
        # char_box.layout.addWidget(title)
        # char_box.layout.addLayout(name_layout)
        char_box.layout.addWidget(self.char_name)
        char_box.layout.addWidget(separator)
        char_box.layout.addLayout(btn_layout)

        char_layout.addWidget(char_box)

        new_char_btn.clicked.connect(self.open_char_dialog)

        self.char_widget.setLayout(char_layout)
Exemple #9
0
    def setupUI(self):
        centralWidget = QtWidgets.QWidget()

        mainLayout = UI.VertBox()
        mainBox = UI.TitledBox(title='Skin IO')

        skinFolderLayout = UI.HorBox()
        skinFolderBtn = UI.ButtonB('...')

        skinFolderLayout.addWidget(self.skinFolderEdit)
        skinFolderLayout.addWidget(skinFolderBtn)

        gridLayout = QtWidgets.QGridLayout()
        # titleMesh = QtWidgets.QLabel('Meshes')
        titleSkins = QtWidgets.QLabel('Skin Files')
        # gridLayout.addWidget(titleMesh, 0, 0)
        gridLayout.addWidget(titleSkins, 0, 0)
        # gridLayout.addWidget(self.meshesListWidget, 1, 0)
        gridLayout.addWidget(self.skinsListWidget, 1, 0)
        # self.meshesListWidget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.skinsListWidget.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)

        exportBtn = UI.ButtonB('Export')
        importBtn = UI.ButtonB('Import')

        exportBtn.clicked.connect(self.exportSkin)
        importBtn.clicked.connect(self.importSkin)
        skinFolderBtn.clicked.connect(self.browseSkinsFolder)

        mainBox.layout.addLayout(skinFolderLayout)
        mainBox.layout.addLayout(gridLayout)
        # mainBox.layout.addWidget(self.skinsListWidget)

        mainBox.layout.addWidget(self.useMeshName)
        mainBox.layout.addWidget(exportBtn)
        mainBox.layout.addWidget(importBtn)

        mainLayout.addWidget(mainBox)

        centralWidget.setLayout(mainLayout)
        self.setCentralWidget(centralWidget)
Exemple #10
0
    def setupUI(self):
        central_widget = QtWidgets.QWidget()

        main_layout = UI.VertBox()
        main_box = UI.TitledBox(title='Browse')

        if len(self.char_list) > 0:
            self.char_combo.addItems(self.char_list)

        self.char_combo.activated[str].connect(self.char_combo_changed)

        separator = UI.Separator()

        char_browser_layout = UI.HorBox()
        self.char_browser.hide()
        self.char_browser.itemDoubleClicked.connect(
            self.char_browser_double_clicked)
        char_browser_layout.addWidget(self.char_browser)

        self.char_layout.addWidget(self.char_combo)
        # self.char_layout.addWidget(self.main_dir)
        self.char_layout.addWidget(separator)
        self.char_layout.addLayout(self.back_folders_layout)
        self.char_layout.addLayout(char_browser_layout)

        self.set_project_btn.clicked.connect(self.set_project_clicked)
        self.open_file_btn.clicked.connect(self.open_file_clicked)
        self.save_file_btn.clicked.connect(self.save_file_clicked)

        self.action_btn_layout.addWidget(self.set_project_btn)
        self.action_btn_layout.addWidget(self.open_file_btn)
        self.action_btn_layout.addWidget(self.save_file_btn)

        main_box.layout.addLayout(self.char_layout)
        main_box.layout.addLayout(self.action_btn_layout)
        main_layout.addWidget(main_box)

        central_widget.setLayout(main_layout)
        self.setCentralWidget(central_widget)

        self.char_combo_changed(self.char_combo.currentText())