[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23069] branches/blender2.5/blender/ release/io/engine_render_pov.py: patch from Maurice & Patsoko on blenderartist for win32 registry support,

Campbell Barton ideasman42 at gmail.com
Wed Sep 9 00:46:14 CEST 2009


Revision: 23069
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23069
Author:   campbellbarton
Date:     2009-09-09 00:46:14 +0200 (Wed, 09 Sep 2009)

Log Message:
-----------
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
?\239?\187?\191It's the version of r23036 + winreg patch from Maurice.

?\239?\187?\191About 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.

Modified Paths:
--------------
    branches/blender2.5/blender/release/io/engine_render_pov.py

Modified: branches/blender2.5/blender/release/io/engine_render_pov.py
===================================================================
--- branches/blender2.5/blender/release/io/engine_render_pov.py	2009-09-08 14:52:46 UTC (rev 23068)
+++ branches/blender2.5/blender/release/io/engine_render_pov.py	2009-09-08 22:46:14 UTC (rev 23069)
@@ -740,10 +740,13 @@
 		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





More information about the Bf-blender-cvs mailing list