def pullVersion(self): self.progressBar.setHidden(False) item = self.treeWidget_a.currentItem() doc_id = item.parent().hkid task = doc_id.split("_")[3] # TODO:clean this with a dict that contain task and extension if task in self.ma_task: ext = ".ma" else: ext = ".mb" ver = int(item.text(0)) self.statusbar.showMessage("Pulling %s %s" % (doc_id, str(ver))) pull = core.pull( doc_id=doc_id, ver=ver, extension=ext, progressbar=self.progressBar, msgbar=self.statusbar.showMessage ) if pull: global CHECK_DEPS fpath = pull[0] if os.path.exists(fpath): CHECK_DEPS = checkDeps_maya.UiCheckDependenciesMaya(fpath) CHECK_DEPS.show() self.statusbar.showMessage("%s %s pulled" % (doc_id, str(ver))) self.progressBar.setHidden(True)
def pullAnAssetVersion (): """ This is a simple example to pull to workspace a particular asset version. """ db = utils.getDb () version = 2 result = core.pull ( db = db, doc_id = "bls_chr_belanus_mod_main", version = version ) print result
def pullVersion ( self ) : self.progressBar.setHidden ( False ) item = self.treeWidget_a.currentItem () doc_id = item.parent().hkid ver = int ( item.text ( 0 ) ) self.statusbar.showMessage ( "Pulling %s %s" % ( doc_id, str(ver) ) ) pull = core.pull ( doc_id = doc_id, ver = ver , extension = ".mb", progressbar = self.progressBar, msgbar = self.statusbar.showMessage) if pull : # hkcmds.openFile ( pull [ 0 ] ) self.statusbar.showMessage("%s %s pulled" % ( doc_id, str(ver) )) self.progressBar.setHidden ( True )