Skip to content
Snippets Groups Projects
render.py 202 KiB
Newer Older
  • Learn to ignore specific revisions
  •         filePov.write("}\n")
            filePov.close()
            ##################### end write ##########################################
    
            pov_binary = PovrayRender._locate_binary()
            
            if sys.platform[:3] == "win":
    
                p1=subprocess.Popen(["%s"%pov_binary,"/EXIT","%s"%iniPrevFile],
                    stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
    
                p1=subprocess.Popen(["%s"%pov_binary,"-d","%s"%iniPrevFile],
                    stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
    
            p1.wait()
    
            tex.use_nodes = True
            tree = tex.node_tree
            links = tree.links
            for n in tree.nodes:
                tree.nodes.remove(n)
            im = tree.nodes.new("TextureNodeImage")  
            pathPrev="%s.png"%outputPrevFile
            im.image = bpy.data.images.load(pathPrev)
            name=pathPrev
            name=name.split("/")
            name=name[len(name)-1]
            im.name = name  
            im.location = 200,200
            previewer = tree.nodes.new('TextureNodeOutput')    
            previewer.label = "Preview"
            previewer.location = 400,400
            links.new(im.outputs[0],previewer.inputs[0])
            #tex.type="IMAGE" # makes clip extend possible
            #tex.extension="CLIP"