From 567bffd80547eabffb94a7ecc070d04575c86521 Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Tue, 14 Jun 2016 07:26:25 -0700 Subject: [PATCH 1/2] we used to have two path for rendering a frame the one saving pngs was broken and not preserving pngs two paths are now unified this also fixes zoom on animations. fix #1845 --- Packages/vcs/vcs/VTKAnimate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/vcs/vcs/VTKAnimate.py b/Packages/vcs/vcs/VTKAnimate.py index fe83c6b2bb..610c96760f 100644 --- a/Packages/vcs/vcs/VTKAnimate.py +++ b/Packages/vcs/vcs/VTKAnimate.py @@ -134,7 +134,7 @@ def run(self): self.controller.draw_frame( allow_static=False, render_offscreen=False, - main_window_png=False) + main_window_png=True) self.controller.frame_num += 1 if self.controller.frame_num >= self.controller.number_of_frames(): @@ -280,8 +280,8 @@ def reclaim_renderers(self): be.showGUI() be.renWin.Render() - def draw_frame(self, frame_num=None, render_offscreen=True, - allow_static=True, main_window_png=False): + def draw_frame(self, frame_num=None, render_offscreen=False, + allow_static=False, main_window_png=True): """ Draws a frame on the canvas frame_num: Which frame to draw- defaults to self.frame_num @@ -295,8 +295,7 @@ def draw_frame(self, frame_num=None, render_offscreen=True, else: self.frame_num = frame_num - if render_offscreen or ( - allow_static and len(self.animation_files) == self.number_of_frames()): + if len(self.animation_files) == self.number_of_frames(): # Attempt to extract the renderers and place them onto the create # thread self.extract_renderers() @@ -346,4 +345,5 @@ def frame(self, frame): self.draw_frame( frame_num=frame, allow_static=False, - render_offscreen=False) + render_offscreen=False, + main_window_png=True) From 24922f7fbdf64c33bb1debe271ae920e69bb4f4a Mon Sep 17 00:00:00 2001 From: Charles Doutriaux Date: Wed, 15 Jun 2016 07:10:05 -0700 Subject: [PATCH 2/2] making @chaoshpere2112 happy, generating pngs only for save or zoomed pots --- Packages/vcs/vcs/VTKAnimate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/vcs/vcs/VTKAnimate.py b/Packages/vcs/vcs/VTKAnimate.py index 610c96760f..76079826f2 100644 --- a/Packages/vcs/vcs/VTKAnimate.py +++ b/Packages/vcs/vcs/VTKAnimate.py @@ -134,7 +134,7 @@ def run(self): self.controller.draw_frame( allow_static=False, render_offscreen=False, - main_window_png=True) + main_window_png=False) self.controller.frame_num += 1 if self.controller.frame_num >= self.controller.number_of_frames(): @@ -317,7 +317,7 @@ def draw_frame(self, frame_num=None, render_offscreen=False, self.vcs_self.backend.renWin.Render() - if main_window_png: + if main_window_png or self.playback_params.zoom_factor != 1: png_name = self.create_thread.get_frame_name(self.frame_num) self.vcs_self.png(png_name) self.animation_files = sorted( @@ -346,4 +346,4 @@ def frame(self, frame): frame_num=frame, allow_static=False, render_offscreen=False, - main_window_png=True) + main_window_png=False)