Skip to content

Commit

Permalink
Merge pull request #23 from tanuva/master
Browse files Browse the repository at this point in the history
Add parameter 'includedirs' to render()
  • Loading branch information
Zulko committed Oct 31, 2015
2 parents ac92684 + 131545f commit 04030fe
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 04030fe

Please sign in to comment.