def osl_compile(input_path, report): output_file = tempfile.NamedTemporaryFile(mode='w', suffix=".oso", delete=False) output_path = output_file.name output_file.close() ok = _cycles.osl_compile(input_path, output_path) if ok: report({'INFO'}, "OSL shader compilation succeeded") return ok, output_path
def compile_osl(self, inFile, outPath, nameOverride=""): if nameOverride == "": FileName = os.path.basename(inFile) FileNameNoEXT = os.path.splitext(FileName)[0] out_file = os.path.join(outPath, FileNameNoEXT) out_file += ".oso" else: FileNameNoEXT = os.path.splitext(nameOverride)[0] out_file = os.path.join(outPath, FileNameNoEXT) out_file += ".oso" ok = _cycles.osl_compile(inFile, out_file) return ok
def osl_compile(input_path, report): """compile .osl file with given filepath to temporary .oso file""" import tempfile output_file = tempfile.NamedTemporaryFile(mode='w', suffix=".oso", delete=False) output_path = output_file.name output_file.close() ok = _cycles.osl_compile(input_path, output_path) if ok: report({'INFO'}, "OSL shader compilation succeeded") return ok, output_path
def my_osl_compile(self, input_path): """compile .osl file with given filepath to temporary .oso file""" output_file = tempfile.NamedTemporaryFile(mode='w', suffix=".oso", delete=False) output_path = output_file.name output_file.close() ok = _cycles.osl_compile(input_path, output_path) print("osl compile output = %s" % output_path) if ok: print("OSL shader compilation succeeded") return ok, output_path