diff --git a/docs/changes.md b/docs/changes.md index 2a3a7336..f7acc1e8 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -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 diff --git a/vedo/file_io.py b/vedo/file_io.py index dff286d4..80b94355 100644 --- a/vedo/file_io.py +++ b/vedo/file_io.py @@ -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() @@ -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) diff --git a/vedo/version.py b/vedo/version.py index 4d4f5e44..80206f35 100644 --- a/vedo/version.py +++ b/vedo/version.py @@ -1 +1 @@ -_version = '2024.5.2+dev09' +_version = '2024.5.2+dev10'