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 kwargs params to Render.screenshot() and Render.export() #368

Merged
merged 1 commit into from
Jun 17, 2024
Merged
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
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 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 @@
_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 @@

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 @@
"""

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

Check warning on line 344 in brainrender/render.py

View check run for this annotation

Codecov / codecov/patch

brainrender/render.py#L344

Added line #L344 was not covered by tests

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