Skip to content

Instantly share code, notes, and snippets.

@sambler
Last active July 10, 2018 09:25
Show Gist options
  • Save sambler/4bf78b6dac859d41ebd2b9d980785b7b to your computer and use it in GitHub Desktop.
Save sambler/4bf78b6dac859d41ebd2b9d980785b7b to your computer and use it in GitHub Desktop.
fill in missing frames in an image sequence
#!/usr/bin/env python
# made for https://blender.stackexchange.com/q/112530/935
# fill in missing frames in an image sequence
# by linking missing frames to the previous existing frame
import os
base_filename = 'Display'
base_extension = '.png'
# filename is composed of basename a four digit zero padded number and extension
filename_format = '{}{:04}{}'
last_file = ''
for i in range(1,22):
fname = filename_format.format(base_filename,i,base_extension)
if os.path.exists(fname):
last_file = fname
else:
os.symlink(last_file, fname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment