Skip to content

Commit

Permalink
[CO] possibility to override gif_path
Browse files Browse the repository at this point in the history
  • Loading branch information
helene-t committed Jul 19, 2022
1 parent 892b48c commit 1d4c9f2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions SciDataTool/GUI/WPlotManager/WPlotManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def __init__(self, parent=None):
module = __import__("SciDataTool")
DATA_DIR = getattr(module, "DATA_DIR")
self.save_path = DATA_DIR # Path to directory where animation are stored
self.gif_path = None
self.path_to_image = None # Path to recover the image for the animate button
self.main_widget = None
self.plot_arg_dict = {}
Expand Down Expand Up @@ -266,8 +267,12 @@ def gen_animate(self):
if wid.axis_name == animated_axis.split("[")[0]:
self.l_loading = wid.l_loading

gif = self.save_path + "/" + gif_name + str_format
gif = gif.replace("\\", "/")
if self.gif_path is not None:
gif_path = self.gif_path
else:
gif_path = self.save_path

gif = join(gif_path, gif_name + str_format)

# Using an index to make sure that we are generating a new gif everytime
idx = 1
Expand All @@ -289,7 +294,7 @@ def gen_animate(self):
self.worker = SaveGifWorker(
widget=self,
main_widget=self.main_widget,
gif=join(dirname(gif), "tmp.gif"),
gif=gif,
plot_input=plot_input,
data_selection=operations_selected,
is_3D=is_3D,
Expand Down

0 comments on commit 1d4c9f2

Please sign in to comment.