Add-on: remove .flamenco.blend after job submission
This commit is contained in:
parent
2215ed2d85
commit
5b1b0b30a9
@ -146,6 +146,7 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
|
|||||||
blendfile_on_farm: Optional[PurePosixPath] = None
|
blendfile_on_farm: Optional[PurePosixPath] = None
|
||||||
job_name: bpy.props.StringProperty(name="Job Name") # type: ignore
|
job_name: bpy.props.StringProperty(name="Job Name") # type: ignore
|
||||||
job: Optional[_SubmittedJob] = None
|
job: Optional[_SubmittedJob] = None
|
||||||
|
temp_blendfile: Optional[Path] = None
|
||||||
|
|
||||||
timer: Optional[bpy.types.Timer] = None
|
timer: Optional[bpy.types.Timer] = None
|
||||||
packthread: Optional[_PackThread] = None
|
packthread: Optional[_PackThread] = None
|
||||||
@ -207,6 +208,7 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
|
|||||||
bpy.ops.wm.save_as_mainfile(
|
bpy.ops.wm.save_as_mainfile(
|
||||||
filepath=str(filepath), compress=True, copy=True
|
filepath=str(filepath), compress=True, copy=True
|
||||||
)
|
)
|
||||||
|
self.temp_blendfile = filepath
|
||||||
finally:
|
finally:
|
||||||
# Restore the settings we changed, even after an exception.
|
# Restore the settings we changed, even after an exception.
|
||||||
render.use_file_extension = old_use_file_extension
|
render.use_file_extension = old_use_file_extension
|
||||||
@ -367,6 +369,11 @@ class FLAMENCO_OT_submit_job(FlamencoOpMixin, bpy.types.Operator):
|
|||||||
|
|
||||||
Does neither check nor abort the BAT pack thread.
|
Does neither check nor abort the BAT pack thread.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if self.temp_blendfile is not None:
|
||||||
|
self.log.info("Removing temporary file %s", self.temp_blendfile)
|
||||||
|
self.temp_blendfile.unlink(missing_ok=True)
|
||||||
|
|
||||||
if self.timer is not None:
|
if self.timer is not None:
|
||||||
context.window_manager.event_timer_remove(self.timer)
|
context.window_manager.event_timer_remove(self.timer)
|
||||||
self.timer = None
|
self.timer = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user