diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-01 19:46:21 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-03-01 19:46:21 +0300 |
commit | 449fbde7d12731019089e8bf008667f44e859e09 (patch) | |
tree | d6800521dcf6087aefdc6dc29e54976d1e3c675b /release/scripts/startup/bl_operators/file.py | |
parent | 50500a43995d2acd2fb086f9aee86409cc83d400 (diff) |
Batch-previews generation: add option to control whether we save backup .blend1 file or not.
Requested by Aaron Carlisle (@blendify) over IRC.
Diffstat (limited to 'release/scripts/startup/bl_operators/file.py')
-rw-r--r-- | release/scripts/startup/bl_operators/file.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/file.py b/release/scripts/startup/bl_operators/file.py index efcc7d5c65e..64cc0aeddb3 100644 --- a/release/scripts/startup/bl_operators/file.py +++ b/release/scripts/startup/bl_operators/file.py @@ -86,6 +86,11 @@ class WM_OT_previews_batch_generate(Operator): name="Trusted Blend Files", description="Enable python evaluation for selected files", ) + use_backups = BoolProperty( + default=True, + name="Save Backups", + description="Keep a backup (.blend1) version of the files when saving with generated previews", + ) def invoke(self, context, event): context.window_manager.fileselect_add(self) @@ -126,6 +131,8 @@ class WM_OT_previews_batch_generate(Operator): cmd.append('--no_objects') if not self.use_intern_data: cmd.append('--no_data_intern') + if not self.use_backups: + cmd.append("--no_backups") if subprocess.call(cmd): self.report({'ERROR'}, "Previews generation process failed for file '%s'!" % blen_path) context.window_manager.progress_end() @@ -192,6 +199,11 @@ class WM_OT_previews_batch_clear(Operator): name="Trusted Blend Files", description="Enable python evaluation for selected files", ) + use_backups = BoolProperty( + default=True, + name="Save Backups", + description="Keep a backup (.blend1) version of the files when saving with cleared previews", + ) def invoke(self, context, event): context.window_manager.fileselect_add(self) @@ -233,6 +245,8 @@ class WM_OT_previews_batch_clear(Operator): cmd.append('--no_objects') if not self.use_intern_data: cmd.append('--no_data_intern') + if not self.use_backups: + cmd.append("--no_backups") if subprocess.call(cmd): self.report({'ERROR'}, "Previews clear process failed for file '%s'!" % blen_path) context.window_manager.progress_end() |