From 56f38f16133ec9163d5f0a45fd5226233b547f87 Mon Sep 17 00:00:00 2001 From: Beppo <53090100+beppo-dd@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:40:39 +0200 Subject: [PATCH] Result._plot_point_scalars: Use argument return_cpos in any case ... before, it was used only, when `if animate`. Now, it used in any case of the call `plotter.show`. --- ansys/mapdl/reader/rst.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ansys/mapdl/reader/rst.py b/ansys/mapdl/reader/rst.py index 542e7bff..afcea604 100644 --- a/ansys/mapdl/reader/rst.py +++ b/ansys/mapdl/reader/rst.py @@ -2752,6 +2752,11 @@ def _plot_point_scalars(self, scalars, rnum=None, grid=None, result_text = self.text_result_table(rnum) plotter.add_text(result_text, font_size=20, color=text_color) + # camera position added in 0.32.0 + show_kwargs = {} + if pv._version.version_info[1] > 31: + show_kwargs['return_cpos'] = return_cpos + if animate: if off_screen: # otherwise this never exits loop = False @@ -2761,11 +2766,6 @@ def _plot_point_scalars(self, scalars, rnum=None, grid=None, orig_pts = copied_mesh.points.copy() - # camera position added in 0.32.0 - show_kwargs = {} - if pv._version.version_info[1] > 31: - show_kwargs['return_cpos'] = return_cpos - plotter.show(interactive=False, auto_close=False, window_size=window_size, full_screen=full_screen, @@ -2822,7 +2822,8 @@ def q_callback(): elif screenshot: cpos = plotter.show(auto_close=False, interactive=interactive, window_size=window_size, - full_screen=full_screen) + full_screen=full_screen, + **show_kwargs) if screenshot is True: img = plotter.screenshot() else: @@ -2832,7 +2833,8 @@ def q_callback(): else: cpos = plotter.show(interactive=interactive, window_size=window_size, - full_screen=full_screen) + full_screen=full_screen, + **show_kwargs) if screenshot is True: return cpos, img