Skip to content

Commit

Permalink
Merge pull request #368 from carlocastoldi/screenshot-params
Browse files Browse the repository at this point in the history
add kwargs params to Render.screenshot() and Render.export()
  • Loading branch information
alessandrofelder authored Jun 17, 2024
2 parents 570cecd + f8ef5a3 commit 2b9e895
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions brainrender/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def render(
def close(self):
self.plotter.close()

def export(self, savepath):
def export(self, savepath, **kwargs):
"""
Exports the scene to a .html
file for online renderings.
Expand All @@ -302,7 +302,7 @@ def export(self, savepath):
_default_backend = vsettings.default_backend

if not self.is_rendered:
self.render(interactive=False)
self.render(interactive=False, **kwargs)

path = Path(savepath)
if path.suffix != ".html":
Expand All @@ -329,7 +329,7 @@ def export(self, savepath):

return str(path)

def screenshot(self, name=None, scale=None):
def screenshot(self, name=None, scale=None, **kwargs):
"""
Takes a screenshot of the current view
and save it to file.
Expand All @@ -341,7 +341,7 @@ def screenshot(self, name=None, scale=None):
"""

if not self.is_rendered:
self.render(interactive=False)
self.render(interactive=False, **kwargs)

timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
name = Path(name or f"brainrender_screenshot_{timestamp}")
Expand Down

0 comments on commit 2b9e895

Please sign in to comment.