class VariablesTool(DockTool): """docstring for Variables tool.""" def __init__(self): super(VariablesTool, self).__init__() self.setMinimumSize(QtCore.QSize(200, 50)) self.content = QWidget() self.content.setObjectName("VariablesToolContent") self.verticalLayout = QVBoxLayout(self.content) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.setWidget(self.content) @staticmethod def getIcon(): return QtGui.QIcon(RESOURCES_DIR + "/variable.png") @staticmethod def isSingleton(): return True def onShow(self): super(VariablesTool, self).onShow() self.verticalLayout.addWidget(VariablesWidget(self.canvas)) @staticmethod def toolTip(): return "Variables editing/creation" @staticmethod def name(): return str("Variables")
class NodesBox(QWidget): """doc string for NodesBox""" def __init__(self, parent, canvas=None): super(NodesBox, self).__init__(parent) self.canvasRef = weakref.ref(canvas) self.verticalLayout = QVBoxLayout(self) self.verticalLayout.setObjectName("verticalLayout") self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.lineEdit = NodeBoxLineEdit(self) self.lineEdit.setObjectName("lineEdit") self.verticalLayout.addWidget(self.lineEdit) self.treeWidget = NodeBoxTreeWidget(self) self.treeWidget.setObjectName("treeWidget") self.treeWidget.headerItem().setText(0, "1") self.verticalLayout.addWidget(self.treeWidget) self.lineEdit.textChanged.connect(self.leTextChanged) self.treeWidget.refresh() def sizeHint(self): return QtCore.QSize(400, 250) def expandCategory(self): for i in self.treeWidget.categoryPaths: self.treeWidget.setItemExpanded(self.treeWidget.categoryPaths[i], True) def leTextChanged(self): if self.lineEdit.text() == '': self.lineEdit.setPlaceholderText("enter node name..") self.treeWidget.refresh() return self.treeWidget.refresh(None, self.lineEdit.text()) self.expandCategory()
class VariablesTool(DockTool): """docstring for Variables tool.""" def __init__(self): super(VariablesTool, self).__init__() self.setMinimumSize(QtCore.QSize(200, 50)) self.content = QWidget() self.content.setObjectName("VariablesToolContent") self.verticalLayout = QVBoxLayout(self.content) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.setWidget(self.content) @staticmethod def getIcon(): return QtGui.QIcon(":variable.png") @staticmethod def isSingleton(): return True def onShow(self): super(VariablesTool, self).onShow() varsWidget = VariablesWidget(self.pyFlowInstance) self.pyFlowInstance.fileBeenLoaded.connect(varsWidget.actualize) self.verticalLayout.addWidget(varsWidget) @staticmethod def toolTip(): return "Variables editing/creation" @staticmethod def name(): return str("Variables")
class HistoryTool(DockTool): """docstring for History tool.""" def __init__(self): super(HistoryTool, self).__init__() self.setMinimumSize(QtCore.QSize(200, 50)) self.content = QWidget() self.content.setObjectName("historyToolContent") self.verticalLayout = QVBoxLayout(self.content) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.undoStackView = QUndoView(self) self.undoStackView.setObjectName("undoStackView") self.verticalLayout.addWidget(self.undoStackView) self.setWidget(self.content) @staticmethod def getIcon(): return QtGui.QIcon(RESOURCES_DIR + "/history.png") def onShow(self): super(HistoryTool, self).onShow() self.undoStackView.setStack(self.canvas.undoStack) @staticmethod def defaultDockArea(): return QtCore.Qt.LeftDockWidgetArea @staticmethod def toolTip(): return "Undo stack" @staticmethod def name(): return str("History")
def __init__(self, name='modelPanelWidget', **kwargs): super(ModelPanelWidget, self).__init__(**kwargs) unique_name = name + str(id(self)) self.setObjectName(unique_name + 'Widget') main_layout = QVBoxLayout(self) main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setObjectName(unique_name + 'Layout') self.setLayout(main_layout) maya.cmds.setParent(main_layout.objectName()) pane_layout_name = maya.cmds.paneLayout() self._model_panel = maya.cmds.modelPanel(unique_name, label="ModelPanel", menuBarVisible=False) pane_layout_widget = gui.to_qt_object(pane_layout_name) main_layout.addWidget(pane_layout_widget) self.set_model_panel_options() self.hide_bar_layout() self.hide_menu_bar()