def gen_pick_img(path, force, crop, auto_id, skip_lights, skip_shaders): img_path = "C:/work/ids/{0}.exr".format(FileSystem.name(path)) exr_path = img_path.replace(".exr", ".objectId.exr") rgb_path = img_path.replace(".exr", "_rgb.png") ids_path = img_path.replace(".exr", "_ids.png") id_cache = img_path.replace(".exr", "_nodes.json") # reuse cached results if (not force) and FileSystem.valid(img_path): jconf = JsonConfig(id_cache) return exr_path, rgb_path, ids_path, dict(jconf) # render and extract existing ids from cgev.vray import sdk from cgev.vray import VRayScene sdk.enableFrameBuffer = True r = VRayScene(path, renderMode="production") token = r.renderIdPass(path=img_path, auto_id=auto_id, crop=crop, skip_lights=skip_lights, skip_shaders=skip_shaders) r.release() # cache ids mapping jconf = JsonConfig(token[3]) jconf.save(id_cache) return token
def runProcs(self): log.info("Detach processes ...") p = list() p.append("C:\\work\\scenes\\vray\\test\\cubes.vrscene") p.append("C:\\work\\scenes\\vray\\test\\sphere.vrscene") for i in range(self.numTest): for path in p: name = FileSystem.name(path) + '_' + str(i) self.detach(name, path)
def batchSceneExport(py_path, scene, out_path): name = FileSystem.name(scene) options = dict() tgt_path = "//stora/diska/tmp/aprevot/hello/test.vrscene" options["ImageFileName"] = FileSystem.name(tgt_path) + "." options["ImageDir"] = os.path.dirname(tgt_path) options["ImageExtension"] = "vrscene" options["SceneName"] = scene options["Layer"] = "VRScene" # options["ImageFileName"] = FileSystem.name(py_path) + "." # options["imageDir"] = os.path.dirname(py_path) # options["ImageExtension"] = "py" args = dict() args["scene"] = scene args["out_path"] = out_path wrap_script = writeWrapScript(py_path, FileSystem.name(scene), args) return batchMayaPy(wrap_script, options)