diff --git a/vapory/io.py b/vapory/io.py index dd15552..62f6c27 100644 --- a/vapory/io.py +++ b/vapory/io.py @@ -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. @@ -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, diff --git a/vapory/vapory.py b/vapory/vapory.py index 150e6d6..0bebbf7 100644 --- a/vapory/vapory.py +++ b/vapory/vapory.py @@ -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. @@ -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: