patch from Maurice & Patsoko on blenderartist for win32 registry support,

moved "import winreg" inline, (so other OS's don't import it), untested but should be ok.

--- From the thread
It's the version of r23036 + winreg patch from Maurice.

About the registry keys:
 - I have povray 3.6 and 3.7b34 installed on vista32.
 - In the registry, I have 3 choices : ' CurrentVersion ', ' v3.6 ', and ' v3.7'.
 - I've modified Maurice's patch by replacing CurrentVersion by v3.6. We have the benefit to have the keys for each version so I prefer use them rather than the 'floating-key-about-which-is-the current-version'. I found more secure like that.
This commit is contained in:
Campbell Barton 2009-09-08 22:46:14 +00:00
parent ee78c63bee
commit e6965c46fc

@ -740,10 +740,13 @@ class PovrayRender(bpy.types.RenderEngine):
pov_binary = "povray"
if sys.platform=='win32':
import winreg
regKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\POV-Ray\\v3.6\\Windows')
if bitness == 64:
pov_binary = "pvengine64"
pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine64'
else:
pov_binary = "pvengine"
pov_binary = winreg.QueryValueEx(regKey, 'Home')[0] + '\\bin\\pvengine'
if 1:
self.process = subprocess.Popen([pov_binary, self.temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE