Exemplo n.º 1
0
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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
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
Exemplo n.º 5
0
    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