def load_selected_solution_ui(self): """Includes the selected solution widget in the layout, the description and custom channel box.""" # Clears the solution description label. self.solution_description.setText("") # Clears the space for the current selected solution layout. Remove the current widget in the interface. self.clear_solution_ui() # Gets the selected indexes of the tree elements. This way the menu can be different depending on the selection. sel_items = self.get_solution_trees_selected_items() # If a solution is selected in the tree, try to get the correspondent in the solutions instance tree. selected_solution = None if len(sel_items) == 1: selected_solution = self.solution_manager.get_solution_from_ui_object(sel_items[0]) # Adds the widget to the ui and the description. if selected_solution: # Sets the description. self.solution_description.setText(selected_solution.description) # Sets the widget. solution_widget = selected_solution.get_ui(reset=True) self.solution_widget_layout.addWidget(solution_widget) # Sets the channel box. pm.select(clear=True) pm.select(selected_solution.get_channel_box_nodes()) solution_channel_box = selected_solution.get_channel_box(reset=True) self.solution_channel_box_layout.addWidget(utils.mayaWindowToPySideWidget(solution_channel_box))
def initUI(self): self.setMinimumSize(200, 100) # layout self.setLayout(QtGui.QVBoxLayout()) self.layout().setSpacing(0) self.layout().setContentsMargins(2, 2, 2, 2) self.channelBox = pm.channelBox('channelBox') pySideChannelBox = utils.mayaWindowToPySideWidget(self.channelBox) self.layout().addWidget(pySideChannelBox)
def initUI(self): self.setMinimumSize(200, 100) # self.resize(600,400) # layout self.setLayout(QtGui.QVBoxLayout()) self.layout().setSpacing(0) self.layout().setContentsMargins(2, 2, 2, 2) self.nodeEditor = cmds.scriptedPanel(type="nodeEditorPanel", label="Node Editor") pySideNodeEditor = utils.mayaWindowToPySideWidget(self.nodeEditor) self.layout().addWidget(pySideNodeEditor)