Skip to content

Commit

Permalink
Add parameter 'includedirs' to render()
Browse files Browse the repository at this point in the history
includedirs may contain a list of additional include directories that will be passed on as povray's +L parameter.
  • Loading branch information
Marcel Brüggebors committed Oct 30, 2015
1 parent ac92684 commit 131545f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion vapory/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def ppm_to_numpy(filename=None, buffer=None, byteorder='>'):

def render_povstring(string, outfile=None, height=None, width=None,
quality=None, antialiasing=None, remove_temp=True,
show_window=False, tempfile=None):
show_window=False, tempfile=None, includedirs=None):

""" Renders the provided scene description with POV-Ray.
Expand Down Expand Up @@ -103,6 +103,9 @@ def render_povstring(string, outfile=None, height=None, width=None,
cmd.append('-D')
else:
cmd.append('+D')
if includedirs is not None:
for dir in includedirs:
cmd.append('+L%s'%dir)
cmd.append("Output_File_Type=%s"%format_type)
cmd.append("+O%s"%outfile)
process = subprocess.Popen(cmd, stderr=subprocess.PIPE,
Expand Down
6 changes: 4 additions & 2 deletions vapory/vapory.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def add_objects(self, objs):

def render(self, outfile=None, height=None, width=None,
quality=None, antialiasing=None, remove_temp=True,
auto_camera_angle=True, show_window=False, tempfile=None):
auto_camera_angle=True, show_window=False, tempfile=None,
includedirs=None):

""" Renders the scene to a PNG, a numpy array, or the IPython Notebook.
Expand All @@ -79,7 +80,8 @@ def render(self, outfile=None, height=None, width=None,
self.camera = self.camera.add_args(['right', [1.0*width/height, 0,0]])

return render_povstring(str(self), outfile, height, width,
quality, antialiasing, remove_temp, show_window, tempfile)
quality, antialiasing, remove_temp, show_window,
tempfile, includedirs)


class POVRayElement:
Expand Down

0 comments on commit 131545f

Please sign in to comment.