def setUi ( self ): ccpath = utils.getCCPath() """Username""" username = "******" icon = os.path.join ( utils.getCCPath (), "admin.png" ) self.label_username.setText ( "DB user" ) self.labelpixmap_username.setPixmap ( icon ) self.lineEdit_username.setText ( username ) """Password""" password = "******" icon = os.path.join ( utils.getCCPath (), "password.png" ) self.label_password.setText ( "DB password" ) self.labelpixmap_password.setPixmap ( icon ) self.lineEdit_password.setText ( password ) """DB adress""" adress = "127.0.0.1:5984" icon = os.path.join ( utils.getCCPath (), "adress.png" ) self.label_adress.setText ( "DB adress" ) self.labelpixmap_adress.setPixmap ( icon ) self.lineEdit_adress.setText ( adress ) """host Username""" username = "******" icon = os.path.join ( utils.getCCPath (), "admin.png" ) self.label_husername.setText ( "Host user" ) self.labelpixmap_husername.setPixmap ( icon ) self.lineEdit_husername.setText ( username ) """host adress""" hadress = "127.0.0.1" icon = os.path.join ( utils.getCCPath (), "adress.png" ) self.label_hadress.setText ( "Host adress" ) self.labelpixmap_hadress.setPixmap ( icon ) self.lineEdit_hadress.setText ( hadress ) """Homework root""" root = "homeworks" icon = os.path.join ( utils.getCCPath (), "hierarchy.png" ) self.label_root.setText ( "Host root" ) self.lineEdit_root.setText ( root ) self.labelpixmap_root.setPixmap ( icon ) """project""" project = "prj" icon = os.path.join ( utils.getCCPath (), "project.png" ) self.label_project.setText ( "Project slug" ) self.labelpixmap_project.setPixmap ( icon ) self.lineEdit_project.setText ( project ) """Create""" self.pushButton_create.setEnabled ( False ) self.pushButton_create.setIcon ( QtGui.QIcon ( os.path.join ( ccpath, "add.png" ) ) )
def refreshProject ( self, serveradress ): """If server exist set 'ok' icon """ self.server = False if utils.serverExists ( serveradress ) : icon = os.path.join ( utils.getCCPath (), "ok.png" ) self.server = utils.getServer ( serveradress ) """Clear current comboBox_project list""" self.comboBox_project.clear () icon = os.path.join ( utils.getCCPath (), "cross.png" ) self.projects = ["No project available"] if utils.serverExists ( serveradress ) : projects = core.lsProjectServer ( serveradress ) if len ( projects ) > 0 : self.projects = projects self.comboBox_project.addItems ( self.projects ) root = self.lineEdit_root.text() root = os.path.join ( root, "projects" ) for i in range ( 0, self.comboBox_project.count () ): proj = self.comboBox_project.itemText ( i ) curroot = os.path.join ( root, proj ) if proj == "No project available" or os.path.exists ( curroot ) : icon = os.path.join ( utils.getCCPath (), "cross.png" ) self.project_stat [ proj ] = False else: icon = os.path.join ( utils.getCCPath (), "ok.png" ) self.project_stat [ proj ] = True self.comboBox_project.setItemIcon ( i, QtGui.QIcon ( icon ) ) self.pushButton.setEnabled ( self.project_stat [ self.comboBox_project.currentText () ] )
def setUi ( self ): ccpath = utils.getCCPath() """Username""" username = "******" icon = os.path.join ( utils.getCCPath (), "admin.png" ) self.label_username.setText ( "DB user" ) self.labelpixmap_username.setPixmap ( icon ) self.lineEdit_username.setText ( username ) """Password""" password = "******" icon = os.path.join ( utils.getCCPath (), "password.png" ) self.label_password.setText ( "DB password" ) self.labelpixmap_password.setPixmap ( icon ) self.lineEdit_password.setText ( password ) """DB adress""" adress = "127.0.0.1:5984" icon = os.path.join ( utils.getCCPath (), "adress.png" ) self.label_adress.setText ( "DB adress" ) self.labelpixmap_adress.setPixmap ( icon ) self.lineEdit_adress.setText ( adress ) """DB project""" icon = os.path.join ( utils.getCCPath (), "refresh.png" ) self.label_project.setText ( "DB project" ) self.refresh.setIcon ( QtGui.QIcon ( icon ) ) """Homework root""" root = "/homeworks" icon = os.path.join ( utils.getCCPath (), "hierarchy.png" ) self.label_root.setText ( "Project root" ) self.lineEdit_root.setText ( root ) self.lineEdit_root.setReadOnly ( True ) self.labelpixmap_root.setPixmap ( icon ) """Description""" self.label_4.setText ( "Description" ) self.plainTextEdit.setPlainText ( "This is the project" ) self.pushButton.setText ( "Synchronize" ) self.pushButton.setIcon ( QtGui.QIcon ( os.path.join ( ccpath, "pull.png" ) ) ) self.project_stat = dict () self.project_stat [ "No project available" ] = False self.project_stat [ "" ] = False self.refreshClicked () self.projectChanged()
import badass.apps as apps import badass.utils as utils import badass.core as core import glob, os, PythonQt import PySide.QtGui as QtGui import commands CC_PATH = utils.getCCPath() PROJECT = utils.getProjectName() def hkTextureExport ( pattern ): files = glob.glob ( pattern ) #TODO: support progressbar for textures optimisation for file in files : # core.textureOptimise ( file ) core.textureBuild ( file ) def hkExportChannel ( channel_name = None, wedge = "wedge1", geo = None, dialog = False, animation = False ): "Check input geo" if geo == None : geo = mari.geo.current () "Get geo and channel" geo_name = geo.name () "Check channel name" if channel_name == None : channel_name = geo.currentChannel().name() "Reconstruct asset name"