def onHumanChanged(self, event): human = event.human if event.change == 'reset': self.filechooser.selection = 'default.hair' if human.hairObj: self.human = human mh.callAsync(self.updateHair)
def run(self): for filename, status in self.filenames: command = '%s "%s"' % ('aqsis -Progress', filename) renderProc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, universal_newlines=True) mh.callAsync(lambda:self.app.progress(0.0, status)) try: while True: line = renderProc.stdout.readline() if line == '': break progress = line.split()[1][0:-1] mh.callAsync(lambda:self.app.progress(float(progress)/100.0)) except: pass mh.callAsync(lambda:self.app.progress(1.0)) gui3d.app.prompt("Render finished", "The image is saved in {0}".format(self.renderPath), "OK", helpId="'renderFinishedPrompt'") """ for filename in self.filenames: command = '%s "%s"' % ('aqsis -progress -progressformat="progress %f %p %s %S" -v 0', filename[0]) renderProc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, universal_newlines=True) #for line in renderProc.stdout: #pass #print "Rendering finished ", renderProc.stdout """ """
def run(self): cache = DownloadCache(self.path) mh.callAsync(lambda:self.app.progress(0.0, 'Downloading media list')) success, code = cache.download(os.path.join(self.url, 'media.ini')) if success: f = open(os.path.join(self.path, 'media.ini'), 'r') filenames = f.readlines() n = float(len(filenames)) for index, filename in enumerate(filenames): try: filename = filename.split()[0] mh.callAsync(lambda:self.app.progress(index/n, 'Downloading %s' % filename)) url = os.path.join(self.url, filename) success, code = cache.download(url) except: pass f.close() mh.callAsync(lambda:self.app.progress(1.0)) else: mh.callAsync(lambda:self.app.progress(1.0)) mh.callAsync(lambda:self.app.prompt('Error', 'Failed to sync media from %s, error %d.' % (self.path, code), 'OK')) if self.callback: mh.callAsync(self.callback)
def onHumanTranslated(self, event): if gui3d.app.settings.get('censor', False): mh.callAsync(lambda:self.updateCensor())
def onCameraChanged(self, event): if gui3d.app.settings.get('censor', False): mh.callAsync(lambda:self.updateCensor())
def eventFilter(self, object, event): if event.type() == QtCore.QEvent.Resize: mh.callAsync(self._updateScrollBar) return False
def run(self): while self.running: sleep(1) callAsync(self.method)