Add-on: don't write a .flamenco.blend when already on shared storage

Skip writing the `.flamenco.blend` file when working directly on shared
storage. This was already the intended behaviour, but I think it got lost
in a recent refactor.
This commit is contained in:
Sybren A. Stüvel 2024-08-01 14:41:54 +02:00
parent b68e51976d
commit 6704f6619d

View File

@ -335,11 +335,18 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
) )
prefs.experimental.use_all_linked_data_direct = True prefs.experimental.use_all_linked_data_direct = True
filepath = Path(context.blend_data.filepath).with_suffix(".flamenco.blend") filepath = Path(context.blend_data.filepath)
self.log.info("Saving copy to temporary file %s", filepath) if job_submission.is_file_inside_job_storage(context, filepath):
bpy.ops.wm.save_as_mainfile( self.log.info(
filepath=str(filepath), compress=True, copy=True "Saving blendfile, already in shared storage: %s", filepath
) )
bpy.ops.wm.save_as_mainfile()
else:
filepath = filepath.with_suffix(".flamenco.blend")
self.log.info("Saving copy to temporary file %s", filepath)
bpy.ops.wm.save_as_mainfile(
filepath=str(filepath), compress=True, copy=True
)
self.temp_blendfile = filepath self.temp_blendfile = filepath
finally: finally:
# Restore the settings we changed, even after an exception. # Restore the settings we changed, even after an exception.