Commit c9c7f7e1 authored by Alan Taylor's avatar Alan Taylor

make second attempt to combine blocks (using minimal memory) if first attempt fails

parent 8bffd17b
......@@ -516,6 +516,9 @@ def main():
sys.exit('\nexiting: blender instances may still be running on render nodes')
success = fio.create_final_image_from_blocks(image_config)
if not success:
success = fio.create_final_image_from_blocks(image_config, low_memory=True)
ana.create_heatmap(image_config, checked)
fio.backup_render(image_config)
......
......@@ -597,7 +597,7 @@ def backup_render(settings, initial_test=False):
# final composite
##############################################################################
def create_final_image_from_blocks(settings):
def create_final_image_from_blocks(settings, low_memory=False):
"""
combine the rendered blocks together to form the final image
......@@ -617,7 +617,8 @@ def create_final_image_from_blocks(settings):
extension = utils.file_extension(settings)
filename = 'composite_seed_' + str(settings['seed']) + '.' + extension
composite = 'convert -layers flatten -compress zip block_*_seed_*.' + extension + ' ' + filename
memory = '-limit memory 256MB -limit map 512MB ' if low_memory else ''
composite = 'convert ' + memory + '-layers flatten -compress zip block_*_seed_*.' + extension + ' ' + filename
# the shell is needed to parse the wildcards
with subprocess.Popen(composite, shell=True, \
......@@ -634,7 +635,7 @@ def create_final_image_from_blocks(settings):
proc.wait()
print('>> result written to: ' + filename)
return True
retval = True
else:
print('>> writing to: ' + filename + ' failed')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment