Пример #1
0
    def __init__(self, parent=None, *args, **kwargs):
        super(ScreenSpaceRigBakeLayout, self).__init__(*args, **kwargs)
        self.setupUi(self)        
        self.menubar = QtWidgets.QMenuBar(self)        
        self.options_menu = self.menubar.addMenu('Freeze')
        self.refresh_menu = self.menubar.addMenu('Refresh')
        # Freeze options actions
        self.animlayer_action = QtWidgets.QAction('Add to AnimLayer', self)
        self.animlayer_action.setCheckable(True)
        self.options_menu.addAction(self.animlayer_action)
        self.options_menu.addSeparator()
        self.freeze_action_group = QtWidgets.QActionGroup(self.options_menu)

        self.camera_space_action = QtWidgets.QAction('Freeze in Camera Space',
                                                     self)
        self.camera_space_action.setCheckable(True)
        self.options_menu.addAction(self.camera_space_action)
        self.camera_space_action.setActionGroup(self.freeze_action_group)

        self.world_space_action = QtWidgets.QAction('Freeze in World Space',
                                                    self)
        self.world_space_action.setCheckable(True)
        self.world_space_action.setChecked(True)
        self.options_menu.addAction(self.world_space_action)
        self.world_space_action.setActionGroup(self.freeze_action_group)
        # Refresh action
        self.refresh_action = QtWidgets.QAction('Refresh Rigs List', self)
        self.refresh_menu.addAction(self.refresh_action)
        # Set menubar        
        self.gridLayout.setMenuBar(self.menubar)        
        # Help menu
        help_menu = QtWidgets.QMenu('Help', self.menubar)
        commonmenus.create_help_menu_items(help_menu, tool_help_func=_open_help)
        # Add menus        
        self.menubar.addMenu(self.options_menu)
        self.menubar.addMenu(self.refresh_menu)
        self.menubar.addMenu(help_menu)        

        self.create_connections()
        self.refresh_rigsList()       
        self.populate_ui()        
Пример #2
0
    def setupUi(self, parent):
        self.transform_icon = QtGui.QIcon(':transform.svg')

        # Main layout
        self.gridLayout = QtWidgets.QGridLayout(parent)

        # Menu
        self.menu_bar = QtWidgets.QMenuBar()
        self.options_menu = self.menu_bar.addMenu('Freeze')
        self.refresh_menu = self.menu_bar.addMenu('Refresh')

        # Freeze options actions
        self.animlayer_action = QtWidgets.QAction('Add to AnimLayer', self)
        self.animlayer_action.setCheckable(True)
        self.options_menu.addAction(self.animlayer_action)

        self.options_menu.addSeparator()

        self.freeze_action_group = QtWidgets.QActionGroup(self)

        self.camera_space_action = QtWidgets.QAction('Freeze in Camera Space',
                                                     self)
        self.camera_space_action.setCheckable(True)
        self.options_menu.addAction(self.camera_space_action)
        self.camera_space_action.setActionGroup(self.freeze_action_group)

        self.world_space_action = QtWidgets.QAction('Freeze in World Space',
                                                    self)
        self.world_space_action.setCheckable(True)
        self.world_space_action.setChecked(True)
        self.options_menu.addAction(self.world_space_action)
        self.world_space_action.setActionGroup(self.freeze_action_group)

        # Refresh action
        self.refresh_action = QtWidgets.QAction('Refresh Rigs list', self)
        self.refresh_menu.addAction(self.refresh_action)

        self.gridLayout.setMenuBar(self.menu_bar)

        spacerItem = QtWidgets.QSpacerItem(5, 17,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 0, 0, 1, 1)

        # Full bake radio button
        self.full_bake_rdo_btn = QtWidgets.QRadioButton()
        self.gridLayout.addWidget(self.full_bake_rdo_btn, 0, 1, 1, 1)

        spacerItem1 = QtWidgets.QSpacerItem(5, 17,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem1, 0, 2, 1, 1)

        # Smart bake radio button
        self.smart_bake_rdo_btn = QtWidgets.QRadioButton()
        self.smart_bake_rdo_btn.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.smart_bake_rdo_btn.setAutoFillBackground(False)
        self.smart_bake_rdo_btn.setChecked(True)
        self.gridLayout.addWidget(self.smart_bake_rdo_btn, 0, 3, 1, 1)

        spacerItem2 = QtWidgets.QSpacerItem(5, 10,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem2, 0, 4, 1, 1)

        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()

        # Rigs label
        self.rigs_label = QtWidgets.QLabel()
        self.horizontalLayout_2.addWidget(self.rigs_label)

        # Rigs list
        self.rigs_list = QtWidgets.QTreeWidget()
        self.rigs_list.setFocusPolicy(QtCore.Qt.NoFocus)
        self.rigs_list.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.rigs_list.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.rigs_list.setIndentation(15)
        self.rigs_list.setHeaderHidden(True)
        self.horizontalLayout_2.addWidget(self.rigs_list)
        self.gridLayout.addLayout(self.horizontalLayout_2, 2, 0, 1, 5)

        self.horizontalLayout = QtWidgets.QHBoxLayout()

        # Name label
        self.name_label = QtWidgets.QLabel()
        self.horizontalLayout.addWidget(self.name_label)

        # Name line edit
        self.name_text = QtWidgets.QLineEdit()
        self.name_text.setFocusPolicy(QtCore.Qt.ClickFocus)
        self.horizontalLayout.addWidget(self.name_text)

        self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 5)

        # Widget labels
        self.full_bake_rdo_btn.setText('Full bake')
        self.smart_bake_rdo_btn.setText('Smart bake')
        self.rigs_label.setText('Rigs')
        self.name_label.setText('Name')

        self.context_menu = QtWidgets.QMenu()

        self.create_rig_action = QtWidgets.QAction('Create Screen-Space Rig',
                                                   self)
        self.context_menu.addAction(self.create_rig_action)

        self.create_freeze_rig_action = QtWidgets.QAction(
            'Create Freeze Rig', self)
        self.context_menu.addAction(self.create_freeze_rig_action)

        self.context_menu.addSeparator()

        self.match_rig_action = QtWidgets.QAction('Match Screen Z-Depth', self)
        self.context_menu.addAction(self.match_rig_action)

        self.context_menu.addSeparator()

        self.bake_rig_action = QtWidgets.QAction('Bake Rig', self)
        self.context_menu.addAction(self.bake_rig_action)

        self.delete_rig_action = QtWidgets.QAction('Delete Rig', self)
        self.context_menu.addAction(self.delete_rig_action)

        self.context_menu.addSeparator()

        self.select_action = QtWidgets.QAction('Select in Outliner', self)
        self.context_menu.addAction(self.select_action)
        return