Skip to content
Snippets Groups Projects
Commit 8dc8d576 authored by Maurice Raybaud's avatar Maurice Raybaud
Browse files

Added Linux Binary detection thanks to Bela Mihalik's patch.

parent d96d9d39
No related branches found
No related tags found
No related merge requests found
...@@ -1707,10 +1707,37 @@ class PovrayRender(bpy.types.RenderEngine): ...@@ -1707,10 +1707,37 @@ class PovrayRender(bpy.types.RenderEngine):
# DH - added -d option to prevent render window popup which leads to segfault on linux # DH - added -d option to prevent render window popup which leads to segfault on linux
extra_args.append("-d") extra_args.append("-d")
# TODO, when POV-Ray isn't found this can probably still give a cryptic error on linux, isExists = False
# would be nice to be able to detect if it exists sysPathList = os.getenv("PATH").split(':')
sysPathList.append("")
print("Command line arguments passed: " + str(extra_args)) for dirName in sysPathList:
if (os.path.exists(os.path.join(dirName, pov_binary))):
isExists = True
break
if not isExists:
print("POV-Ray 3.7: could not found execute '%s' - not if PATH" % pov_binary)
import traceback
traceback.print_exc()
print ("***-DONE-***")
return False
try:
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'" % pov_binary)
import traceback
traceback.print_exc()
print ("***-DONE-***")
return False
else:
print("POV-Ray 3.7 found")
print("Command line arguments passed: " + str(extra_args))
return True
def _cleanup(self): def _cleanup(self):
for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out): for f in (self._temp_file_in, self._temp_file_ini, self._temp_file_out):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment