Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice Raybaud <mauriceraybaud@hotmail.fr>2011-04-06 19:18:15 +0400
committerMaurice Raybaud <mauriceraybaud@hotmail.fr>2011-04-06 19:18:15 +0400
commitecf2c3afd6c7e81a2dbfab9ab434ea6e5ee0eeac (patch)
tree369c033031fb1f720ff2793f433dde80e438182f /render_povray
parentaeb3cb5ad051127b8a591b20a68286e839fdad5f (diff)
Further Error handling to allow win 32 bits blender builds to render with Povray 64 bits and the other way around.
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/render.py61
1 files changed, 40 insertions, 21 deletions
diff --git a/render_povray/render.py b/render_povray/render.py
index 9ff96ad1..f449d7b1 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -1638,60 +1638,79 @@ class PovrayRender(bpy.types.RenderEngine):
regKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, "Software\\POV-Ray\\v3.7\\Windows")
- #64 bits blender
+ # TODO, report api
+
+ # 64 bits blender
if bitness == 64:
try:
pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine64"
+ self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args)
+ # This would work too but means we have to wait until its done:
+ # os.system("%s %s" % (pov_binary, self._temp_file_ini))
+
except OSError:
# someone might run povray 32 bits on a 64 bits blender machine
try:
pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine"
+ self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args)
+
except OSError:
+ # TODO, report api
print("POV-Ray 3.7: could not execute '%s', possibly POV-Ray isn't installed" % pov_binary)
+ import traceback
+ traceback.print_exc()
+ print ("***-DONE-***")
+ return False
+
else:
print("POV-Ray 3.7 64 bits could not execute, running 32 bits instead")
+ print("Command line arguments passed: " + str(extra_args))
+ return True
+
else:
print("POV-Ray 3.7 64 bits found")
-
+ print("Command line arguments passed: " + str(extra_args))
+ return True
+
#32 bits blender
else:
try:
pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine"
+ self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args)
+
# someone might also run povray 64 bits with a 32 bits build of blender.
except OSError:
try:
pov_binary = winreg.QueryValueEx(regKey, "Home")[0] + "\\bin\\pvengine64"
+ self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args)
+
except OSError:
+ # TODO, report api
print("POV-Ray 3.7: could not execute '%s', possibly POV-Ray isn't installed" % pov_binary)
+ import traceback
+ traceback.print_exc()
+ print ("***-DONE-***")
+ return False
+
else:
print("Running POV-Ray 3.7 64 bits build with 32 bits Blender, \nYou might want to run Blender 64 bits as well.")
+ print("Command line arguments passed: " + str(extra_args))
+ return True
+
else:
print("POV-Ray 3.7 32 bits found")
+ print("Command line arguments passed: " + str(extra_args))
+ return True
+
else:
# DH - added -d option to prevent render window popup which leads to segfault on linux
extra_args.append("-d")
- # print("Extra Args: " + str(extra_args))
-
- if 1:
- # TODO, when POV-Ray isn't found this gives a cryptic error, would be nice to be able to detect if it exists
- try:
- self._process = subprocess.Popen([pov_binary, self._temp_file_ini] + extra_args) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
- except OSError:
- # TODO, report api
- print("POV-Ray 3.7: could not execute '%s', possibly POV-Ray isn't installed" % pov_binary)
- import traceback
- traceback.print_exc()
- print ("***-DONE-***")
- return False
-
- else:
- # This works too but means we have to wait until its done
- os.system("%s %s" % (pov_binary, self._temp_file_ini))
+ # TODO, when POV-Ray isn't found this can probably still give a cryptic error on linux,
+ # would be nice to be able to detect if it exists
- # print ("***-DONE-***")
- return True
+ print("Command line arguments passed: " + str(extra_args))
def _cleanup(self):
for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out):