Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parameter 'includedirs' to render() #23

Merged
merged 1 commit into from
Oct 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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