Save jobinfo.json to output directory
Previously it would be saved in the same directory as the blend file, which may be deeply nested in a directory structure. Now it's saved at the top of the BAT pack.
This commit is contained in:
parent
0452fd845b
commit
0a99b9e22e
@ -182,7 +182,7 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
self.log.info('Will output render files to %s', render_output)
|
self.log.info('Will output render files to %s', render_output)
|
||||||
|
|
||||||
# BAT-pack the files to the destination directory.
|
# BAT-pack the files to the destination directory.
|
||||||
outfile, missing_sources = await self.bat_pack(filepath)
|
outdir, outfile, missing_sources = await self.bat_pack(filepath)
|
||||||
if not outfile:
|
if not outfile:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Store the job ID in a file in the output dir.
|
# Store the job ID in a file in the output dir.
|
||||||
with open(str(outfile.parent / 'jobinfo.json'), 'w', encoding='utf8') as outfile:
|
with open(str(outdir / 'jobinfo.json'), 'w', encoding='utf8') as outfile:
|
||||||
import json
|
import json
|
||||||
|
|
||||||
job_info['missing_files'] = [str(mf) for mf in missing_sources]
|
job_info['missing_files'] = [str(mf) for mf in missing_sources]
|
||||||
@ -315,14 +315,14 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
|
|
||||||
return filepath
|
return filepath
|
||||||
|
|
||||||
async def bat_pack(self, filepath: Path) -> (typing.Optional[Path], typing.List[Path]):
|
async def bat_pack(self, filepath: Path) -> (Path, typing.Optional[Path], typing.List[Path]):
|
||||||
"""BAT-packs the blendfile to the destination directory.
|
"""BAT-packs the blendfile to the destination directory.
|
||||||
|
|
||||||
Returns the path of the destination blend file.
|
Returns the path of the destination blend file.
|
||||||
|
|
||||||
:param filepath: the blend file to pack (i.e. the current blend file)
|
:param filepath: the blend file to pack (i.e. the current blend file)
|
||||||
:returns: the destination blend file, or None if there were errors BAT-packing,
|
:returns: the destination directory, the destination blend file or None
|
||||||
and a list of missing paths.
|
if there were errors BAT-packing, and a list of missing paths.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -345,7 +345,7 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
self.log.exception('Unable to create output path %s', outdir)
|
self.log.exception('Unable to create output path %s', outdir)
|
||||||
self.report({'ERROR'}, 'Unable to create output path: %s' % ex)
|
self.report({'ERROR'}, 'Unable to create output path: %s' % ex)
|
||||||
self.quit()
|
self.quit()
|
||||||
return None, []
|
return outdir, None, []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
outfile, missing_sources = await bat_interface.copy(
|
outfile, missing_sources = await bat_interface.copy(
|
||||||
@ -355,15 +355,15 @@ class FLAMENCO_OT_render(async_loop.AsyncModalOperatorMixin,
|
|||||||
len(ex.files_remaining), ex.files_remaining[0])
|
len(ex.files_remaining), ex.files_remaining[0])
|
||||||
self.report({'ERROR'}, 'Unable to transfer %d files' % len(ex.files_remaining))
|
self.report({'ERROR'}, 'Unable to transfer %d files' % len(ex.files_remaining))
|
||||||
self.quit()
|
self.quit()
|
||||||
return None, []
|
return outdir, None, []
|
||||||
except bat_interface.Aborted:
|
except bat_interface.Aborted:
|
||||||
self.log.warning('BAT Pack was aborted')
|
self.log.warning('BAT Pack was aborted')
|
||||||
self.report({'WARNING'}, 'Aborted Flamenco file packing/transferring')
|
self.report({'WARNING'}, 'Aborted Flamenco file packing/transferring')
|
||||||
self.quit()
|
self.quit()
|
||||||
return None, []
|
return outdir, None, []
|
||||||
|
|
||||||
bpy.context.window_manager.flamenco_status = 'DONE'
|
bpy.context.window_manager.flamenco_status = 'DONE'
|
||||||
return outfile, missing_sources
|
return outdir, outfile, missing_sources
|
||||||
|
|
||||||
|
|
||||||
def scene_frame_range(context) -> str:
|
def scene_frame_range(context) -> str:
|
||||||
|
Reference in New Issue
Block a user