def __init__(self, parent=None): super(NewProject, self).__init__(parent) self.logger = SetLogger(self) self.setWindowIcon(QIcon(get_app_icon(32, "NewProject"))) self.layout = QGridLayout(self) self.buildUI() self.setLayout(self.layout)
def __init__(self, parent=None): super(GeneralSetting, self).__init__(parent) self.logger = SetLogger(self) self.setSpacing(2) self.tbTDCB = QCheckBox("TD toolbar") self.tbTDCB.setChecked(False) self.tbCompCB = QCheckBox("Comp toolbar") self.tbArtCB = QCheckBox("Art toolbar") self.tbTexCB = QCheckBox("Tex toolbar") self.tbPostCB = QCheckBox('Post toolbar') self.subToolBarCB = QCheckBox("Sub Toolbar") self.mainToolBarCB = QCheckBox("Main Toolbar") self.statusBarCB = QCheckBox("Status Bar") self.subMenuCB = QCheckBox("Sub Menu") self.serStatusCB = QCheckBox("Server Status") self.notifiCB = QCheckBox("Notification") self.checkBoxes = [self.tbTDCB, self.tbCompCB, self.tbArtCB, self.tbTexCB, self.tbPostCB, self.subToolBarCB, self.mainToolBarCB, self.statusBarCB, self.subMenuCB, self.serStatusCB, self.notifiCB] self.keys = ['toolbarTD', 'toolbarComp', 'toolbarArt', 'toolbarTex', 'toolbarPost', 'subToolbar', 'toolbarMain', 'toolbarStatus', 'toolbarSubMenu', 'toolbarServer', 'toolbarNotifi'] self.settingGrp = 'mainUI' self.buildUI() self.reg = PObj(self)
def __init__(self, parent=None): super(NodeGraph, self).__init__(parent) self.logger = SetLogger(self) self.mtd = {} self.Nodes = [] self.setWindowIcon(IconPth(32, 'NodeGraph')) self.menuBar = MenuBar(self) self.view = View() self.sceneView = Scene(self) # Setup scene. self.view.setScene(self.sceneView) self.view.setRenderHint(ANTIALIAS) self.view.setViewportUpdateMode(UPDATE_FULLVIEW) sceneWidth = 1000 sceneHeight = 500 self.sceneView.nodeMoved.connect( self.view.nodeMoved) # Connect scene node moved signal self.sceneView.selectionChanged.connect( self.view._returnSelection) # Connect signals. self.sceneView.setSceneRect(0, 0, sceneWidth, sceneHeight) node1 = self.createNode({'name': 'Node1', 'pos': [0, 0]}) node2 = self.createNode({'name': 'Node2', 'pos': [20, 20]}) self.layout = QGridLayout() self.layout.addWidget(self.menuBar, 0, 0, 1, 1) self.layout.addWidget(self.view, 1, 0, 1, 1) self.setLayout(self.layout) self.resize(1000, 500) self.mtd['objName'] = '{0} {1}'.format(self.key, str(1)) self.mtd['unix'] = getUnix() self.mtd['nodes'] = self.view.getNodes()
def __init__(self, parent=None): super(TopTab5, self).__init__(parent) self.logger = SetLogger(self) self.layout = QGridLayout() self.buildUI() self.setLayout(self.layout) self.addLayout.emit(self)
def __init__(self, source_point, target_point, source, target, parent=None): super(Edge, self).__init__(parent) self.logger = SetLogger(self) self.applySetting() self.socketNode = None self.socketAttr = None self.socketKnob = None self.plugNode = None self.plugAttr = None self.plugKnob = None self.source_point = source_point self.target_point = target_point self.source = source # Source knob self.target = target # Target knob self.movable_point = None self.data = tuple()
def __init__(self, parent=None): super(MainMenuBar, self).__init__(parent) self.logger = SetLogger(self) with open(os.path.join(os.getenv(__envKey__), 'cfg', 'main.cfg'), 'r') as f: self.appInfo = json.load(f) self.url = __plmWiki__ self.buildMenu() self.setMaximumHeight(20)
def __init__(self, parent=None): super(TextEditor, self).__init__(parent) self.logger = SetLogger(self) self.setWindowIcon(IconPth(32, 'TextEditor')) self.layout = QHBoxLayout() self.buildUI() self.setLayout(self.layout)
def __init__(self, parent=None): super(Preferences, self).__init__(parent) self.logger = SetLogger(self) self.resize(200, 100) self.setWindowIcon(QIcon(get_app_icon(32, 'Configuration'))) self.layout = QGridLayout() self.buildUI() self.setLayout(self.layout)
def __init__(self, url='vnexpress.net', parent=None): super(PLMBrowser, self).__init__(parent) self.logger = SetLogger(self) self.setWindowIcon(IconPth(32, 'PLMBrowser')) self.url = url self.layout = QVBoxLayout() self.buildUI() self.setLayout(self.layout)
def __init__(self, parent=None): super(SignUp, self).__init__(parent) self.logger = SetLogger(self) self.setWindowIcon(IconPth(32, "SignUp")) self.resize(450, 900) self.layout = QGridLayout() self.buildUI() self.setLayout(self.layout) self.reg = PObj(self)
def __init__(self, settings, parent=None): super(PipelineManager, self).__init__(parent) self.logger = SetLogger(self) self.url = __homepage__ self.setObjectName(self.key) self.setWindowIcon(AppIcon("Logo")) self.settings = settings self.mainWidget = QWidget() self.layout = QGridLayout() self.mainWidget.setLayout(self.layout) self.buildUI() self.setCentralWidget(self.mainWidget) self.applySetting()
def __init__(self, nodeData, parent=None): super(Node, self).__init__(parent) self.logger = SetLogger(self) self.mtd = dict() self.Knobs = dict() self.Attrs = list() self.AttrsData = dict() self.Flags = list() self._parent = parent self.nodeName = nodeData['name'] self.nodeID = None self.nodeUnix = getUnix() self.drawingConnection = False self.attrCount = 0 self.currentDataType = None self.height() self.applySetting() self.index = -1 self.attr1 = self.createAttribute(attrData1) self.attr2 = self.createAttribute(attrData2) self.attr3 = self.createAttribute(attrData3) self.attr4 = self.createAttribute(attrData4) self.height() self._rect = self.boundingRect() self.mtd['nodeName'] = self.nodeName self.mtd['nodeUnix'] = self.nodeUnix self.mtd['pos'] = [self._rect.x(), self._rect.y()] self.mtd['width'] = self._rect.width() self.mtd['height'] = self._rect.height() if len(self.Attrs) > 0: self.mtd['attrs'] = self.Attrs for attr in self.Attrs: attrName = attr.mtd['attrName'] self.mtd[attrName] = attr.mtd self.highlight()
def __init__(self, parent=None): super(MainToolBar, self).__init__(parent) self.logger = SetLogger(self) with open(os.path.join(os.getenv(__envKey__), 'cfg', 'main.cfg'), 'r') as f: self.appInfo = json.load(f) self.tdToolBar = self.create_toolBar("TD", CONFIG_TDS) self.compToolBar = self.create_toolBar("VFX", CONFIG_VFX) self.artToolBar = self.create_toolBar("ART", CONFIG_ART) self.textureToolBar = self.create_toolBar('TEX', CONFIG_TEX) self.postToolBar = self.create_toolBar('POST', CONFIG_POST) self.toolBars = [ self.tdToolBar, self.compToolBar, self.artToolBar, self.textureToolBar, self.postToolBar ] self.setSizePolicy(SiPoMin, SiPoMin)
def __init__(self, parent=None): super(ServerStatus, self).__init__(parent) self.logger = SetLogger(self) self.server = ServerCfg() self.server.listen(QHostAddress(__serverUrl__), 9000) self.serverOpen = self.server.isListening() self.connected = get_app_icon(16, 'Connected') self.disconnected = get_app_icon(16, 'Disconnected') self.networkStatus = QLabel() self.networkStatus.setMaximumWidth(20) self.networkStatus.setPixmap(QPixmap(self.connected)) self.addWidget(self.networkStatus, 0, 0, 1, 1) self.onlineStage.connect(self.connection_status) self.onlineStage.emit(self.serverOpen) self.txt = Label({'txt': "Connecting"}) self.buildUI()
def __init__(self, parent=None): super(SysTrayIcon, self).__init__(parent) self.logger = SetLogger(self) self.db = QuerryDB() try: self.username, token, cookie, remember = self.db.query_table('curUser') except (ValueError, IndexError): self.username = '******' self.rightClickMenu = SysTrayIconMenu() self.rightClickMenu.executing.connect(self.executing.emit) self.rightClickMenu.showLayout.connect(self.showLayout.emit) self.setIcon(AppIcon('Logo')) self.setToolTip(__plmSlogan__) self.activated.connect(self.sys_tray_icon_activated) self.setContextMenu(self.rightClickMenu) self.eventObj=SystrayWheelEventObject() self.installEventFilter(self.eventObj) self.reg = PObj(self)
def __init__(self, attrData, parent=None): super(NodeAttr, self).__init__(parent) self.logger = SetLogger(self) self.mtd = dict() self.node = parent self.index = None self.AttrsData = dict() self.attrData = attrData self.dataType = None self.key = self.attrData['key'] self.value = self.attrData['value'] self.tooltip = self.attrData['tooltip'] self.alternate = self.attrData['alternate'] self.applySetting() if not self.dataType or self.dataType is None: try: self.dataType = self.attrData['dataType'] except KeyError: self.dataType = self.setDataType(type(self.value)) else: if self.dataType is None: self.dataType = self.setDataType(type(self.value)) else: pass self.mtd['dataType'] = self.dataType self.mtd['attrData'] = self.attrData self.knobL = self.createKnob('left') self.knobR = self.createKnob('right') self.mtd['attrName'] = self.key self.mtd['nodeName'] = self.node.nodeName self.mtd['value'] = self.value
def __init__(self, parent=None): super(StatusBar, self).__init__(parent) self.logger = SetLogger(self)
def __init__(self, parent=None): super(BotTab, self).__init__(parent) self.logger = SetLogger(self) self.layout = QVBoxLayout() self.buildUI() self.setLayout(self.layout)
class NewProject(QWidget): info = {} key = 'newProj' showLayout = pyqtSignal(str, str) def __init__(self, parent=None): super(NewProject, self).__init__(parent) self.logger = SetLogger(self) self.setWindowIcon(QIcon(get_app_icon(32, "NewProject"))) self.layout = QGridLayout(self) self.buildUI() self.setLayout(self.layout) def buildUI(self): MESSAGE = "DUE TO THE POSSIBILITY OF USING RENDER FARM SERVICE, PLEAE SET PROJECT PATH TO E DRIVE\n " \ "IF YOU DO NOT USE RENDER FARM, DRIVE E IS STILL PREFER." TITLE = "SET UP NEW PROJECT" # Title headGrp, headGrid = self.styleGB() headGrid.addWidget(Label({'txt': TITLE})) # Project Info prjInfGrp, prjInfGrid = self.styleGB("Project Info") self.prjLong = QLineEdit("DAMG team project") self.prjShort = QLineEdit("damg") self.prjPth = QLineEdit("E:/") setPthBtn = Button({ 'txt': "Set Path", 'stt': "Set project path", 'cl': self.onSetPthBtnClicked }) prjInfGrid.addWidget(Label({'txt': "Project Name"}), 0, 0, 1, 1) prjInfGrid.addWidget(self.prjLong, 0, 1, 1, 1) prjInfGrid.addWidget(Label({'txt': "Abbreviated as"}), 0, 2, 1, 1) prjInfGrid.addWidget(self.prjShort, 0, 3, 1, 1) prjInfGrid.addWidget(setPthBtn, 1, 0, 1, 1) prjInfGrid.addWidget(self.prjPth, 1, 1, 1, 3) # Notice!!! noticeGrp, noticeGrid = self.styleGB("NOTE!!!") noticeGrid.addWidget(Label({'txt': MESSAGE}), 0, 0, 1, 4) # Project details prjDetailGrp, prjDetailGrid = self.styleGB("Project Details") self.prjMode = QComboBox() self.prjMode.addItem("Studio Mode") self.prjMode.addItem("Group Mode") self.numOfChar = QLineEdit("1") self.numOfChar.setValidator(QIntValidator()) self.numOfChar.textChanged.connect(partial(self.populate_lst, "char")) self.numOfEnv = QLineEdit("1") self.numOfEnv.setValidator(QIntValidator()) self.numOfEnv.textChanged.connect(partial(self.populate_lst, "env")) self.numOfProp = QLineEdit("1") self.numOfProp.setValidator(QIntValidator()) self.numOfProp.textChanged.connect(partial(self.populate_lst, "prop")) self.numOfSeq = QLineEdit("1") self.numOfSeq.setValidator(QIntValidator()) self.numOfSeq.textChanged.connect(partial(self.populate_lst, "seq")) prjDetailGrid.addWidget(Label({'txt': "Project Mode"}), 0, 0, 1, 1) prjDetailGrid.addWidget(self.prjMode, 0, 1, 1, 1) prjDetailGrid.addWidget(Label({'txt': "Character: "}), 1, 0, 1, 1) prjDetailGrid.addWidget(self.numOfChar, 2, 0, 1, 1) prjDetailGrid.addWidget(Label({'txt': "Environment: "}), 1, 1, 1, 1) prjDetailGrid.addWidget(self.numOfEnv, 2, 1, 1, 1) prjDetailGrid.addWidget(Label({'txt': "Props: "}), 1, 2, 1, 1) prjDetailGrid.addWidget(self.numOfProp, 2, 2, 1, 1) prjDetailGrid.addWidget(Label({'txt': "Sequences: "}), 1, 3, 1, 1) prjDetailGrid.addWidget(self.numOfSeq, 2, 3, 1, 1) # Asset details charGrp, self.charLst = self.styleGBLst("Character List") envGrp, self.envLst = self.styleGBLst("Environment List") propGrp, self.propLst = self.styleGBLst("Props List") # Shot details seqGrp, self.seqLst = self.styleGBLst("Sequences List") # Buttons btnGrp, btnGrid = self.styleGB() prjLstBtn = Button({'txt': "Project List", 'stt': "Project List"}) crewLstBtn = Button({'txt': "Crews List", 'stt': "Crews List"}) newPrjBtn = Button({ 'txt': "Create Project", 'stt': "Create New Project" }) cancelBtn = Button({'txt': "Cancel", 'stt': "Cancel"}) btnGrid.addWidget(prjLstBtn, 0, 0) btnGrid.addWidget(crewLstBtn, 0, 1) btnGrid.addWidget(newPrjBtn, 0, 2) btnGrid.addWidget(cancelBtn, 0, 3) self.layout.addWidget(headGrp, 0, 0, 1, 4) self.layout.addWidget(prjInfGrp, 1, 0, 2, 4) self.layout.addWidget(noticeGrp, 3, 0, 1, 4) self.layout.addWidget(prjDetailGrp, 5, 0, 3, 4) self.layout.addWidget(charGrp, 8, 0, 1, 1) self.layout.addWidget(envGrp, 8, 1, 1, 1) self.layout.addWidget(propGrp, 8, 2, 1, 1) self.layout.addWidget(seqGrp, 8, 3, 1, 1) self.layout.addWidget(btnGrp, 9, 0, 1, 4) self.applySetting() def getZ(self, value): if value < 10: z = 1 elif value < 100: z = 2 elif value < 1000: z = 3 else: z = 4 return z def styleGB(self, title="", tl="grid"): if title == "": grpBox = QGroupBox() else: grpBox = QGroupBox(title) if tl.lower() == "grid": layout = QGridLayout() elif tl.lower() == "hbox": layout = QHBoxLayout() elif tl.lower() == "vbox": layout = QVBoxLayout() grpBox.setLayout(layout) return grpBox, layout def styleGBLst(self, title=""): grpBox, hbox = self.styleGB(title, "hbox") listWidget = QListWidget() hbox.addWidget(listWidget) return grpBox, listWidget def onSetPthBtnClicked(self): opts = QFileDialog.DontResolveSymlinks | QFileDialog.ShowDirsOnly dir = QFileDialog.getExistingDirectory(self, "Set production path", self.prjPth.text(), options=opts) if dir: self.prjPth.setText(dir) else: self.logger.debug("You should set a valid path") def populate_lst(self, name="char"): if name.lower() == "char": lst = self.charLst value = int(self.numOfChar.text()) elif name.lower() == "env": lst = self.envLst value = int(self.numOfEnv.text()) elif name.lower() == "prop": lst = self.propLst value = int(self.numOfProp.text()) elif name.lower() == "seq": lst = self.seqLst value = int(self.numOfSeq.text()) else: lst = None value = 0 lst.clear() z = self.getZ(value) for i in range(value): item = QListWidgetItem(lst) itemWidget = ItemWidget( name.lower(), "{0}_{1}".format(name.lower(), str(i + 1).zfill(z))) item.setSizeHint(itemWidget.sizeHint()) lst.addItem(item) lst.setItemWidget(item, itemWidget) def applySetting(self): self.setSizePolicy(SiPoMin, SiPoMin) self.setContentsMargins(1, 1, 1, 1) sections = ["char", "env", "prop", "seq"] for section in sections: self.populate_lst(section) def hideEvent(self, event): # self.specs.showState.emit(False) pass def closeEvent(self, event): self.showLayout.emit(self.key, 'hide') event.ignore()
application_title = __project__ main_python_file = "PLM.py" if not cfg.cfgs: print("Configurations has not completed yet!") else: print("Configurations has completed") if sys.platform == "win32": base = "Win32GUI" else: base = None from core.Loggers import SetLogger logger = SetLogger(__file__) report = logger.report for dir in os.listdir(os.getenv(__envKey__)): pltPth = os.path.join(os.getenv(__envKey__), dir) if os.path.isdir(pltPth): if not pltPth in sys.path: sys.path.append(pltPth) print(pltPth) with open('README.rst', 'r') as f: readme = f.read() packages = __packages_dir__ build_exe_options = {'packages': packages} #'include_files': includefiles,}