Skip to content

Commit

Permalink
fix screenshot clipping range
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Aug 20, 2024
1 parent 5413c6c commit 3706ec2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- add `plotter.reset_clipping_range()` to reset the camera clipping range based on the bounds of the visible actors #1170
- fix issue with find_cell() in #1095
- improvements to `volume.isosurface_discrete()` in #1180 by @snownontrace

- fix bug on video frame by resetting camera clipping range in #1180 by @snownontrace


## Soft-breaking Changes
Expand Down
5 changes: 4 additions & 1 deletion vedo/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,9 @@ def screenshot(filename="screenshot.png", scale=1, asarray=False) -> Union["vedo
if not vedo.plotter_instance or not vedo.plotter_instance.window:
# vedo.logger.error("in screenshot(), rendering window is not present, skip.")
return vedo.plotter_instance ##########

if vedo.plotter_instance.renderer:
vedo.plotter_instance.renderer.ResetCameraClippingRange()

if asarray and scale == 1 and not vedo.plotter_instance.offscreen:
nx, ny = vedo.plotter_instance.window.GetSize()
Expand All @@ -1796,7 +1799,7 @@ def screenshot(filename="screenshot.png", scale=1, asarray=False) -> Union["vedo
narr = np.flip(narr, axis=0)
return narr ##########


###########################
if filename.endswith(".pdf"):
writer = vtki.new("GL2PSExporter")
writer.SetRenderWindow(vedo.plotter_instance.window)
Expand Down
2 changes: 1 addition & 1 deletion vedo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version = '2024.5.2+dev09'
_version = '2024.5.2+dev10'

0 comments on commit 3706ec2

Please sign in to comment.