Last active
July 10, 2018 09:25
-
-
Save sambler/4bf78b6dac859d41ebd2b9d980785b7b to your computer and use it in GitHub Desktop.
fill in missing frames in an image sequence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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