def render(scene, filename): scheduler = Scheduler.getInstance() for i in range(multiprocessing.cpu_count()): scheduler.registerWorker(LocalWorker(i, "wrk{}".format(i))) scheduler.start() queue = RenderQueue() scene.setDestinationFile(filename) job = RenderJob("myRenderJob", scene, queue) job.start() queue.waitLeft(0) queue.join() print(Statistics.getInstance().getStats())
def __run_mitsuba(self): self.mitsuba_scene.configure() scheduler = Scheduler.getInstance() for i in range(multiprocessing.cpu_count()): scheduler.registerWorker(LocalWorker(i, "worker_{}".format(i))) scheduler.start() queue = RenderQueue() self.mitsuba_scene.setDestinationFile(self.image_name) job = RenderJob("render job: {}".format(self.image_name), self.mitsuba_scene, queue) job.start() queue.waitLeft(0) queue.join() print(Statistics.getInstance().getStats()) scheduler.stop()